Summary: | Model error with Kickoff RunnerModel | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | David Edmundson <kde> |
Component: | Application Launcher (Kickoff) | Assignee: | David Edmundson <kde> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alirashidi127, germano.massullo, plasma-bugs |
Priority: | NOR | ||
Version: | master | ||
Target Milestone: | 1.0 | ||
Platform: | Other | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=472176 | ||
Latest Commit: | https://commits.kde.org/plasma-desktop/a2fe5212126c05f8638709d640bc1ba1589026b0 | Version Fixed In: | |
Sentry Crash Report: |
Description
David Edmundson
2018-12-21 19:01:13 UTC
Git commit 9371a7c96d4722b93b49b18df7b21780f2a9ad38 by David Edmundson. Committed on 03/01/2019 at 11:48. Pushed by davidedmundson into branch 'master'. Fix model updates in RunnerMatchesModel Summary: RunnerMatchesModel is backed by a list. When this list changes RunnerManagerModel add/removes the new number of rows then called dataChanged on everything that remained. It's a common pattern, but not a great one. Especially with QtQuick where moving a delegate is faster than updating all the properties of an existing one - unfortunately I can't find a nice solution to do this properly in linear time. The problem with the current code is we update the entire list in the insert/remove rows. This is a violation of the model rules as we're updating rows outside the rows listed inside begin/remove rows. It works, but Qt's model test fails. We also have a lot of duplicates of a crash in QtQuick after runner model changes, bug 369430. I think it could be related, but can't prove anything. This patch updates the rows that exist in both the before and after models before adding/removing the remaining rows. Test Plan: Added Qt model tester in https://phabricator.kde.org/P283 It now passes. Reviewers: #plasma, hein Reviewed By: #plasma, hein Subscribers: hein, apol, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D17725 M +5 -8 applets/kicker/plugin/runnermatchesmodel.cpp https://commits.kde.org/plasma-desktop/9371a7c96d4722b93b49b18df7b21780f2a9ad38 Git commit a2fe5212126c05f8638709d640bc1ba1589026b0 by David Edmundson. Committed on 15/08/2019 at 20:58. Pushed by davidedmundson into branch 'Plasma/5.12'. Fix model updates in RunnerMatchesModel Summary: RunnerMatchesModel is backed by a list. When this list changes RunnerManagerModel add/removes the new number of rows then called dataChanged on everything that remained. It's a common pattern, but not a great one. Especially with QtQuick where moving a delegate is faster than updating all the properties of an existing one - unfortunately I can't find a nice solution to do this properly in linear time. The problem with the current code is we update the entire list in the insert/remove rows. This is a violation of the model rules as we're updating rows outside the rows listed inside begin/remove rows. It works, but Qt's model test fails. We also have a lot of duplicates of a crash in QtQuick after runner model changes, bug 369430. I think it could be related, but can't prove anything. This patch updates the rows that exist in both the before and after models before adding/removing the remaining rows. Test Plan: Added Qt model tester in https://phabricator.kde.org/P283 It now passes. Reviewers: #plasma, hein Reviewed By: #plasma, hein Subscribers: hein, apol, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D17725 M +5 -8 applets/kicker/plugin/runnermatchesmodel.cpp https://commits.kde.org/plasma-desktop/a2fe5212126c05f8638709d640bc1ba1589026b0 *** Bug 410651 has been marked as a duplicate of this bug. *** *** Bug 411610 has been marked as a duplicate of this bug. *** |