Fix unreachable setting of file permissions (#6514)

Fixes #6080
This commit is contained in:
Xavier Valls 2021-05-15 15:11:19 +02:00 committed by Jonathan White
parent 9ae5b49136
commit 1fdfc153be

View file

@ -486,8 +486,9 @@ bool Database::restoreDatabase(const QString& filePath)
// Only try to restore if the backup file actually exists
if (QFile::exists(backupFilePath)) {
QFile::remove(filePath);
return QFile::copy(backupFilePath, filePath);
QFile::setPermissions(filePath, perms);
if (QFile::copy(backupFilePath, filePath)) {
return QFile::setPermissions(filePath, perms);
}
}
return false;
}