aboutsummaryrefslogtreecommitdiff
path: root/launcher/settings
diff options
context:
space:
mode:
authorGideon9212 <gideon_gallagher@zoho.com>2022-10-18 17:28:42 -0700
committerGitHub <noreply@github.com>2022-10-18 17:28:42 -0700
commit570264e1e9b8ad4bdece6388c1e7462fd30b73c8 (patch)
tree6668c363a4184ee61f5d68c6c58f2b31b6d66809 /launcher/settings
parentc4edffb38811bd0c05e7b48ffa32e464308eab70 (diff)
parent325e58d98c26fb802956de75e8ddfcfe0d9e3782 (diff)
downloadPrismLauncher-570264e1e9b8ad4bdece6388c1e7462fd30b73c8.tar.gz
PrismLauncher-570264e1e9b8ad4bdece6388c1e7462fd30b73c8.tar.bz2
PrismLauncher-570264e1e9b8ad4bdece6388c1e7462fd30b73c8.zip
Merge branch 'develop' into develop
Signed-off-by: Gideon9212 <gideon_gallagher@zoho.com>
Diffstat (limited to 'launcher/settings')
-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;