feature: make sure when portable settings are cleared a new blank file is created
This commit is contained in:
parent
b3fb8959a3
commit
46c6275c43
1 changed files with 12 additions and 0 deletions
|
|
@ -42,6 +42,18 @@ void clearSettings(bool enableRestart)
|
|||
qDebug("removing profile dir: %s", qPrintable(profileDir.absolutePath()));
|
||||
profileDir.removeRecursively();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (Settings::isNativeMode()) {
|
||||
// make a new empty portable settings file
|
||||
if (profileDir.mkpath(Settings::settingsPath())) {
|
||||
QFile file(Settings::settingsFile());
|
||||
file.open(QIODevice::WriteOnly);
|
||||
file.write(" ", 1);
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (enableRestart) {
|
||||
qDebug("restarting");
|
||||
restart();
|
||||
|
|
|
|||
Loading…
Reference in a new issue