Commit 05aefc40 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed existing backup settings file preventing another backup

Reviewed-by: Tobias Hunger
parent 2a93b540
......@@ -226,7 +226,9 @@ QVariantMap UserFileAccessor::restoreSettings(Project *project)
// Do we need to do a update?
if (fileVersion != m_lastVersion + 1) {
map.insert(QLatin1String(WAS_UPDATED), true);
QFile::copy(fileName, fileName + '.' + m_handlers.value(fileVersion)->displayUserFileVersion());
const QString backupFileName = fileName + '.' + m_handlers.value(fileVersion)->displayUserFileVersion();
QFile::remove(backupFileName); // Remove because copy doesn't overwrite
QFile::copy(fileName, backupFileName);
}
// Update:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment