Bug 329004 - EntityOrderProxyModel emits layoutChanged on every dataChanged signal
Summary: EntityOrderProxyModel emits layoutChanged on every dataChanged signal
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kdepimlibs
Classification: Applications
Component: akonadi (show other bugs)
Version: GIT (master)
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-19 15:22 UTC by Christian Mollekopf
Modified: 2020-10-19 23:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Mollekopf 2013-12-19 15:22:51 UTC
This is actually a problem of QSortFilterProxyModel with dynamic sorting. The QSortFilterProxyModel just unconditionally resorts and emits layoutChanged on every dataChanged signal it receives in order to react to changes that would affect sorting.

This however causes all following models to have to redo their internal mapping and in particular it causes the selection in the FolderTreeWidget of kmail to be cleared. Since we use KSelectionProxymodels to set the messagelist based on the selection in the FolderTreeWidget (and we also use the selection to reference collections in the ETM), the layoutChanged signals are probably rather expensive.

Especially since the ETM emits a dataChanged signal for every collection fetch (for status updates), that is then everytime translated to a layoutChanged by the EntityCollectionOrderProxyModel (which is a EntityOrderProxyModel) in kmail.

We should either fix QSortFilterProxyModel to first check if it actually requires resorting before emitting layoutChanged, or work around the problem in EntityOrderProxyModel (and possibly other similar proxymodels).

Reproducible: Always
Comment 1 Sandro Knauß 2020-10-19 23:09:20 UTC
Thank you for taking the time to file a bug report.

The compontent kdepimlibs don't exist anymore since 2011. It was splitted into several parts some moved to Frameworks the other are still under de KDE PIM umbrella. 

The entire code base went through significant changes. We ported the source code in meanwhile  to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2.

We welcome you to try out the new 20.08 release and give your feedback.