diff options
author | Xavier Valls <xaviervallspla@gmail.com> | 2021-05-15 16:11:19 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2021-05-30 15:44:09 +0300 |
commit | 1fdfc153bede248f82fd652b005e31179b3cd68b (patch) | |
tree | cdb6b697bc0cdd8c19f5206f568cf228f8adca4c | |
parent | 9ae5b491362bf1fe6b0790a2baadcefb910a2058 (diff) |
Fix unreachable setting of file permissions (#6514)
Fixes #6080
-rw-r--r-- | src/core/Database.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/Database.cpp b/src/core/Database.cpp index ccd0ffb21..be9adfa45 100644 --- a/src/core/Database.cpp +++ b/src/core/Database.cpp @@ -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; } |