summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Marten <[email protected]>2017-09-22 10:06:37 +0100
committerJonathan Marten <[email protected]>2017-09-22 11:05:36 +0100
commitfd591e353c956d078b9717da4464c83f9b8f59ac (patch)
treeaf53c39851c4b7a64efec9dd9e342df1b95de934
parent1bf6aa9f70450bb4d67a4d64af7a48760a5b516a (diff)
When backing up feeds.opml, remove any existing backup first
Otherwise QFile::copy() will not overwrite it and no backup will be taken. Differential Revision: https://phabricator.kde.org/D7933
-rw-r--r--src/akregator_part.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/akregator_part.cpp b/src/akregator_part.cpp
index 9f8b252..a928753 100644
--- a/src/akregator_part.cpp
+++ b/src/akregator_part.cpp
@@ -519,6 +519,9 @@ void Part::slotSaveFeedList()
// the first time we overwrite the feed list, we create a backup
if (!m_backedUpList) {
const QString backup = localFilePath() + QLatin1Char('~');
+ if (QFile::exists(backup)) {
+ QFile::remove(backup);
+ }
if (QFile::copy(localFilePath(), backup)) {
m_backedUpList = true;
}