Browse Source

Correctly remove incomplete settings file

PR #17362.
adaptive-webui-19844
Chocobo1 2 years ago committed by GitHub
parent
commit
d2a29c2f87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/base/settingsstorage.cpp

5
src/base/settingsstorage.cpp

@ -188,10 +188,13 @@ bool SettingsStorage::writeNativeSettings() const @@ -188,10 +188,13 @@ bool SettingsStorage::writeNativeSettings() const
break;
}
const Path newPath {nativeSettings->fileName()};
if (nativeSettings->status() != QSettings::NoError)
{
Utils::Fs::removeFile(newPath);
return false;
}
const Path newPath {nativeSettings->fileName()};
QString finalPathStr = newPath.data();
const int index = finalPathStr.lastIndexOf(u"_new", -1, Qt::CaseInsensitive);
finalPathStr.remove(index, 4);

Loading…
Cancel
Save