Skip to content

Commit

Permalink
Apply patch from mgannon
Browse files Browse the repository at this point in the history
Prevent Akregator from overwriting feeds.opml with an emtpy feed list
BUG: 381929
FIXED-IN: 5.7.3

Quitting akregator causes ~/.local/share/akregator/data/feeds.opml to be overwritten using an empty feed
list with the result that upon relaunching an error message appears and only the standard built in feeds are available.

In troubleshooting the issue, I noticed that slotSaveFeedList() is called five times between quitting the
program and the program is finally shutdown. It is only the last time that the function is called with
an empty list. This implies that there might be an error in the slot logic, since
the function should only need to be called once. The attached patch seemed the easiest way to deal with the issue.

Test Plan

i. Start a clean installation of akregator.
ii. Import a list of feeds from an opml file.
iii. Logout from the kde desktop
iv. Login into the kde desktop.

Without the patch, an error message appears saying it is unable to open the file.

Differential Revision: https://phabricator.kde.org/D10466
  • Loading branch information
Montel committed Feb 26, 2018
1 parent 27bb0ac commit 6678efb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/akregator_part.cpp
Expand Up @@ -526,6 +526,10 @@ void Part::slotSaveFeedList()
}

const QString xml = m_mainWidget->feedListToOPML().toString();
if (xml.isEmpty()) {
return;
}

m_storage->storeFeedList(xml);
if (writeToTextFile(xml, localFilePath())) {
return;
Expand Down

0 comments on commit 6678efb

Please sign in to comment.