Fix broken installs.

This commit is contained in:
Adam Treat 2023-07-09 11:50:44 -04:00
parent 85626b3dab
commit 58d6f40f50

View File

@ -421,6 +421,16 @@ QString MySettings::modelPath() const
{
QSettings setting;
setting.sync();
// We have to migrate the old setting because I changed the setting key recklessly in v2.4.11
// which broke a lot of existing installs
const bool containsOldSetting = setting.contains("modelPaths");
if (containsOldSetting) {
const bool containsNewSetting = setting.contains("modelPath");
if (!containsNewSetting)
setting.setValue("modelPath", setting.value("modelPaths"));
setting.remove("modelPaths");
setting.sync();
}
return setting.value("modelPath", defaultLocalModelsPath()).toString();
}