feature: make sure when portable settings are cleared a new blank file is created

This commit is contained in:
sithlord48
2025-03-31 19:54:23 -04:00
committed by Nick Bolton
parent b3fb8959a3
commit 46c6275c43

View File

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