aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'launcher')
-rw-r--r--launcher/Application.cpp2
-rw-r--r--launcher/settings/INISettingsObject.cpp16
2 files changed, 10 insertions, 8 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index b85729f0..d07ad99e 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -489,7 +489,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
// Initialize application settings
{
// Provide a fallback for migration from PolyMC
- m_settings.reset(new INISettingsObject({ BuildConfig.LAUNCHER_CONFIGFILE, "polymc.cfg" }, this));
+ m_settings.reset(new INISettingsObject({ BuildConfig.LAUNCHER_CONFIGFILE, "polymc.cfg", "multimc.cfg" }, this));
// Updates
// Multiple channels are separated by spaces
m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL);
diff --git a/launcher/settings/INISettingsObject.cpp b/launcher/settings/INISettingsObject.cpp
index 3677e238..da962ee9 100644
--- a/launcher/settings/INISettingsObject.cpp
+++ b/launcher/settings/INISettingsObject.cpp
@@ -23,14 +23,16 @@ INISettingsObject::INISettingsObject(QStringList paths, QObject *parent)
: SettingsObject(parent)
{
auto first_path = paths.constFirst();
- auto path = paths.takeFirst();
- while (!QFile::exists(path))
- path = paths.takeFirst();
+ for (auto path : paths) {
+ if (!QFile::exists(path))
+ continue;
- if (path != first_path && QFile::exists(path)) {
- // Copy the fallback to the preferred path.
- QFile::copy(path, first_path);
- qDebug() << "Copied settings from" << path << "to" << first_path;
+ if (path != first_path && QFile::exists(path)) {
+ // Copy the fallback to the preferred path.
+ QFile::copy(path, first_path);
+ qDebug() << "Copied settings from" << path << "to" << first_path;
+ break;
+ }
}
m_filePath = first_path;