From 55ecdc0e1ff13c05ea185ef450d4d599b04d53e1 Mon Sep 17 00:00:00 2001 From: Stefan Nuernberger Date: Thu, 23 Jun 2022 17:00:38 +0200 Subject: [PATCH] modplug: restore settings on load 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. --- src/coreservices.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/coreservices.cpp b/src/coreservices.cpp index e37a798ce27..205df0d4b6b 100644 --- a/src/coreservices.cpp +++ b/src/coreservices.cpp @@ -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" @@ -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(pConfig); connect(&PlayerInfo::instance(),