mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 19:20:45 +00:00
Improvement to that QSettings migration
This commit is contained in:
parent
21f342218f
commit
01fba5f351
@ -96,13 +96,15 @@ int compareVersion(QString version);
|
|||||||
|
|
||||||
void MigrateSettings()
|
void MigrateSettings()
|
||||||
{
|
{
|
||||||
|
QSettings settings(getDeveloperName(), getAppName());
|
||||||
|
if (settings.contains("Version")) { return; } // done, we are new
|
||||||
|
|
||||||
QSettings oldcopy(getDeveloperName(), getAppName()+"-Testing");
|
QSettings oldcopy(getDeveloperName(), getAppName()+"-Testing");
|
||||||
if (oldcopy.contains("Migrated")) { return; }
|
if (oldcopy.contains("Migrated")) { return; }
|
||||||
|
|
||||||
//QString oldfile = oldcopy.fileName();
|
//QString oldfile = oldcopy.fileName();
|
||||||
QStringList keys = oldcopy.allKeys();
|
QStringList keys = oldcopy.allKeys();
|
||||||
|
|
||||||
QSettings settings(getDeveloperName(), getAppName());
|
|
||||||
|
|
||||||
for (int i=0; i<keys.size(); ++i) {
|
for (int i=0; i<keys.size(); ++i) {
|
||||||
const QString & key = keys[i];
|
const QString & key = keys[i];
|
||||||
@ -110,6 +112,7 @@ void MigrateSettings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
oldcopy.setValue("Migrated", true);
|
oldcopy.setValue("Migrated", true);
|
||||||
|
settings.setValue("Version", FullVersionString);
|
||||||
|
|
||||||
qDebug() << keys;
|
qDebug() << keys;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user