Qt: Fix bug where config-based RAIntegration occasionally failed

This commit is contained in:
Stenzek 2024-08-04 20:58:10 +10:00
parent c3bf267936
commit 0c15c9eaa8
No known key found for this signature in database
2 changed files with 7 additions and 5 deletions

View File

@ -442,10 +442,6 @@ bool System::Internal::CPUThreadInitialize(Error* error)
// This will call back to Host::LoadSettings() -> ReloadSources().
LoadSettings(false);
#ifdef ENABLE_RAINTEGRATION
if (Host::GetBaseBoolSettingValue("Cheevos", "UseRAIntegration", false))
Achievements::SwitchToRAIntegration();
#endif
if (g_settings.achievements_enabled)
Achievements::Initialize();

View File

@ -45,8 +45,8 @@
#include "scmversion/scmversion.h"
#include "imgui.h"
#include "core/bus.h"
#include "imgui.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QDateTime>
@ -167,6 +167,12 @@ bool QtHost::PerformEarlyHardwareChecks()
bool QtHost::EarlyProcessStartup()
{
// Config-based RAIntegration switch must happen before the main window is displayed.
#ifdef ENABLE_RAINTEGRATION
if (!Achievements::IsUsingRAIntegration() && Host::GetBaseBoolSettingValue("Cheevos", "UseRAIntegration", false))
Achievements::SwitchToRAIntegration();
#endif
Error error;
if (System::Internal::ProcessStartup(&error)) [[likely]]
return true;