Skip to content

Commit

Permalink
modplug: restore settings on load
Browse files Browse the repository at this point in the history
The settings restoration is currently done in the preferences
dialog. This was dropped accidentally with the introduction of
coreservices in #3446.
Strictly speaking it would be cleaner to not rely on a temporary
widget here. For now this enures modplug tracker files can be
loaded and play correctly after application startup.
  • Loading branch information
snue committed Jun 23, 2022
1 parent 935ba94 commit 55ecdc0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/coreservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include "mixer/playermanager.h"
#include "moc_coreservices.cpp"
#include "preferences/settingsmanager.h"
#ifdef __MODPLUG__
#include "preferences/dialog/dlgprefmodplug.h"
#endif
#include "soundio/soundmanager.h"
#include "sources/soundsourceproxy.h"
#include "util/db/dbconnectionpooled.h"
Expand Down Expand Up @@ -313,6 +316,13 @@ void CoreServices::initialize(QApplication* pApp) {
m_pVCManager->init();
#endif

#ifdef __MODPLUG__
// Restore the configuration for the modplug library before trying to load a module.
DlgPrefModplug modplugPrefs{nullptr, pConfig};
modplugPrefs.loadSettings();
modplugPrefs.applySettings();
#endif

// Inhibit Screensaver
m_pScreensaverManager = std::make_shared<ScreensaverManager>(pConfig);
connect(&PlayerInfo::instance(),
Expand Down

0 comments on commit 55ecdc0

Please sign in to comment.