feeds.opml is never backed up
ClosedPublic

Authored by marten on Sep 22 2017, 9:04 AM.

Details

Summary

According to the comments, Part::slotSaveFeedList() is intended to back up the feeds.opml file the first time that it is to be overwritten. This is a bit ambiguous, but according to the code and the use of the m_backedUpList flag it should happen the first time the file is saved in a run of the Akregator application. However, this never happens because QFile::copy() will not overwrite an existing file.

The effect of that is that the file will be backed up the first time that Akregator is ever run by a new user, and no backup will then be taken ever again. Evan that backup is not very useful as it will be a copy of the default feed list.

This change removes the destination file before the backup copy is taken.

Test Plan

Built akregator with this change. Verified (by checking file times) that a backup of feeds.opml is taken five minutes after Akregator is started and that a new backup is taken for each run.

Diff Detail

Repository
R201 Akregator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
marten created this revision.Sep 22 2017, 9:04 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptSep 22 2017, 9:04 AM
dvratil accepted this revision.Sep 22 2017, 9:11 AM
dvratil added a subscriber: dvratil.

Looks good, thanks. Can go to stable (Applications/17.08) branch.

This revision is now accepted and ready to land.Sep 22 2017, 9:11 AM
This revision was automatically updated to reflect the committed changes.