only reset to default on first run

This commit is contained in:
RickyRister 2024-11-24 04:30:12 -08:00
parent 63de07a515
commit 57501a9266
2 changed files with 2 additions and 11 deletions

View file

@ -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

View file

@ -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()