Bug 420797 - Akregator adds empty item in new folder
Summary: Akregator adds empty item in new folder
Status: RESOLVED FIXED
Alias: None
Product: akregator
Classification: Applications
Component: general (show other bugs)
Version: 5.14.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-30 11:26 UTC by fpohtmeh
Modified: 2024-12-23 08:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Rss tree displays wrongly created fake item (10.21 KB, image/png)
2020-04-30 11:26 UTC, fpohtmeh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fpohtmeh 2020-04-30 11:26:51 UTC
Created attachment 128025 [details]
Rss tree displays wrongly created fake item

SUMMARY
If you create new folder and add an rss item into group, Akregator displays empty row along with rss item.

STEPS TO REPRODUCE
1. Install Akregator
2. Create folder
3. Add rss feed

OBSERVED RESULT
Folder contains two items, second one is empty and can't be edited or removed

EXPECTED RESULT
Single rss item in the folder

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.18
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2
Kernel Version: 5.3.0-51-generic
OS Type: 64-bit

ADDITIONAL INFORMATION
Comment 1 fpohtmeh 2020-04-30 11:31:08 UTC
Empty item is gone after application restart
Comment 2 Bug Janitor Service 2024-12-06 19:43:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/akregator/-/merge_requests/57
Comment 3 Carl Schwan 2024-12-23 08:59:03 UTC
Git commit 0c869e02caea41421d6a54feb2b03e3ec3aa9030 by Carl Schwan, on behalf of Wendi Gan.
Committed on 23/12/2024 at 08:54.
Pushed by carlschwan into branch 'master'.

Fix extra empty line when adding a new feed

When a new folder is created and a feed or folder is inserted into it, an extra empty line appears.
This happens because, in Folder::insertChild and Folder::prependChild, the node is added to m_children first. If the folder is newly created, during SubscriptionListModel::subscriptionAdded, QSortFilterProxyModelPrivate::create_mapping calls SubscriptionListModel::rowCount, which counts one extra row, leading to an extra empty line.
This commit modifies rowCount to decrement by 1 during insertion.
Related: bug 407935, bug 412215

M  +9    -2    src/subscription/subscriptionlistmodel.cpp
M  +1    -0    src/subscription/subscriptionlistmodel.h

https://invent.kde.org/pim/akregator/-/commit/0c869e02caea41421d6a54feb2b03e3ec3aa9030