Qt: Fix app icon ending up as null

This commit is contained in:
Stenzek
2025-09-28 20:27:30 +10:00
parent 3d4115613c
commit a50997a554

View File

@@ -118,6 +118,7 @@ static void SetAppRoot();
static void SetResourcesDirectory();
static bool SetDataDirectory();
static bool SetCriticalFolders();
static void LoadResources();
static void SetDefaultSettings(SettingsInterface& si, bool system, bool controller);
static void MigrateSettings();
static void SaveSettings();
@@ -246,8 +247,6 @@ bool QtHost::EarlyProcessStartup()
return false;
}
// Load resources.
s_state.app_icon = QIcon(QStringLiteral(":/icons/duck.png"));
return true;
}
@@ -599,6 +598,11 @@ bool QtHost::SetDataDirectory()
return true;
}
void QtHost::LoadResources()
{
s_state.app_icon = QIcon(QStringLiteral(":/icons/duck.png"));
}
void Host::LoadSettings(const SettingsInterface& si, std::unique_lock<std::mutex>& lock)
{
}
@@ -3274,8 +3278,10 @@ bool QtHost::ParseCommandLineParametersAndInitializeConfig(QApplication& app,
return false;
}
// Check the file we're starting actually exists.
// Not the best location for this, but early enough.
LoadResources();
// Check the file we're starting actually exists.
if (autoboot && !autoboot->path.empty() && !FileSystem::FileExists(autoboot->path.c_str()))
{
QMessageBox::critical(