From 57501a92664528281f835d66397abab7a7977da8 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Sun, 24 Nov 2024 04:30:12 -0800 Subject: [PATCH] only reset to default on first run --- cockatrice/src/client/ui/window_main.cpp | 1 + cockatrice/src/settings/download_settings.cpp | 12 +----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/cockatrice/src/client/ui/window_main.cpp b/cockatrice/src/client/ui/window_main.cpp index 4de3b3cb3..28e8a186e 100644 --- a/cockatrice/src/client/ui/window_main.cpp +++ b/cockatrice/src/client/ui/window_main.cpp @@ -878,6 +878,7 @@ void MainWindow::startupConfigCheck() // no config found, 99% new clean install qDebug() << "Startup: old client version empty, assuming first start after clean install"; alertForcedOracleRun(VERSION_STRING, false); + SettingsCache::instance().downloads().resetToDefaultURLs(); // populate the download urls SettingsCache::instance().setClientVersion(VERSION_STRING); } else if (SettingsCache::instance().getClientVersion() != VERSION_STRING) { // config found, from another (presumably older) version diff --git a/cockatrice/src/settings/download_settings.cpp b/cockatrice/src/settings/download_settings.cpp index 636bdfbad..922ad74c5 100644 --- a/cockatrice/src/settings/download_settings.cpp +++ b/cockatrice/src/settings/download_settings.cpp @@ -12,19 +12,9 @@ void DownloadSettings::setDownloadUrls(const QStringList &downloadURLs) setValue(QVariant::fromValue(downloadURLs), "urls", "downloads"); } -/** - * If reset or first run, this method contains the default URLs we will populate - */ QStringList DownloadSettings::getAllURLs() { - auto downloadURLs = getValue("urls", "downloads").toStringList(); - - // First run, these will be empty - if (downloadURLs.count() == 0) { - resetToDefaultURLs(); - } - - return downloadURLs; + return getValue("urls", "downloads").toStringList(); } void DownloadSettings::resetToDefaultURLs()