forked from qt-creator/qt-creator
Fixed existing backup settings file preventing another backup
Reviewed-by: Tobias Hunger
This commit is contained in:
@@ -226,7 +226,9 @@ QVariantMap UserFileAccessor::restoreSettings(Project *project)
|
|||||||
// Do we need to do a update?
|
// Do we need to do a update?
|
||||||
if (fileVersion != m_lastVersion + 1) {
|
if (fileVersion != m_lastVersion + 1) {
|
||||||
map.insert(QLatin1String(WAS_UPDATED), true);
|
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:
|
// Update:
|
||||||
|
|||||||
Reference in New Issue
Block a user