Skip to content

Commit

Permalink
Qt: Fix bug where config-based RAIntegration occasionally failed
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Aug 4, 2024
1 parent c3bf267 commit 0c15c9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/core/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
8 changes: 7 additions & 1 deletion src/duckstation-qt/qthost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@

#include "scmversion/scmversion.h"

#include "imgui.h"
#include "core/bus.h"
#include "imgui.h"

#include <QtCore/QCoreApplication>
#include <QtCore/QDateTime>
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0c15c9e

Please sign in to comment.