Commit 6678efb7 authored by Laurent Montel's avatar Laurent Montel 😁

Apply patch from mgannon

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
parent 27bb0ac8
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment