aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-10-18 22:15:08 +0200
committerGitHub <noreply@github.com>2022-10-18 22:15:08 +0200
commit2ebaf460957edfdd286da426b4a754219149c159 (patch)
tree37e86729513210d19fdea77f8637337e1d93677d /launcher
parentfb4cf0b75d6d72b8f35317fb5c82e668f5cdfafe (diff)
parent3a95a3b7c18519943b6f6d13f43710f708553db3 (diff)
downloadPrismLauncher-2ebaf460957edfdd286da426b4a754219149c159.tar.gz
PrismLauncher-2ebaf460957edfdd286da426b4a754219149c159.tar.bz2
PrismLauncher-2ebaf460957edfdd286da426b4a754219149c159.zip
Merge pull request #82 from flowln/i_broke_something_again
Diffstat (limited to 'launcher')
-rw-r--r--launcher/settings/INISettingsObject.cpp16
1 files changed, 9 insertions, 7 deletions
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;