Summary: | Plasma crashed in Positioner::sourceRowsAboutToBeRemoved() when moving files from Desktop to Pictures folder in Dolphin | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Jaak Ristioja <jaak> |
Component: | Folder | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | hein, kde, nate, rion4ik |
Priority: | NOR | Keywords: | drkonqi |
Version: | 5.26.5 | ||
Target Milestone: | 1.0 | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-desktop/-/commit/97794807a9a974ba32ee160665f0b69795888268 | Version Fixed In: | 6.1.1 |
Sentry Crash Report: |
Description
Jaak Ristioja
2023-02-24 08:37:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2069 *** Bug 481850 has been marked as a duplicate of this bug. *** Git commit f0ede2d83731952012be0d43c77916d18617edb2 by Marco Martin. Committed on 28/02/2024 at 08:49. Pushed by mart into branch 'master'. FolderView Positioner: fix rows insert and remove The positioner "proxy" model had problems both in rows insertion and removal. when an icon is dropped in an empty desktop area as the new "last" position, the positioner model creates new empty items for the GridView until it reaches the cell of the drop position. This broke because of connection slot invocation order: the connection to QAbstractItemModel::rowsInserted in FolderModel constructor was executed before the connection in positioner. In turn that connection emitted move, which invoked move on Positioner, which at this point thinks its still in the first rows insertion transaction, because its slot has not been executed yet, and m_beginInsertRowsCalled is still true, so there won't be a "correct" new beginInsertRows called. Make it a Queued connection to push it back. In the same way, when dragging from a "last" position, the Positioner model will remove all the trailing empty items. But it modified m_proxyToSource (from which rowCount() depends) before calling beginRemoveRows, sending the model into an inconsitent state and causing an assert. Make sure that m_proxyToSource is touched only after beginRemoveRows. Related: bug 481254 M +18 -11 containments/desktop/plugins/folder/foldermodel.cpp M +11 -6 containments/desktop/plugins/folder/positioner.cpp https://invent.kde.org/plasma/plasma-desktop/-/commit/f0ede2d83731952012be0d43c77916d18617edb2 Git commit e306c63ddbeaccea72a03fbb2c3dbd8245addef5 by Marco Martin. Committed on 28/02/2024 at 08:50. Pushed by mart into branch 'Plasma/6.0'. FolderView Positioner: fix rows insert and remove The positioner "proxy" model had problems both in rows insertion and removal. when an icon is dropped in an empty desktop area as the new "last" position, the positioner model creates new empty items for the GridView until it reaches the cell of the drop position. This broke because of connection slot invocation order: the connection to QAbstractItemModel::rowsInserted in FolderModel constructor was executed before the connection in positioner. In turn that connection emitted move, which invoked move on Positioner, which at this point thinks its still in the first rows insertion transaction, because its slot has not been executed yet, and m_beginInsertRowsCalled is still true, so there won't be a "correct" new beginInsertRows called. Make it a Queued connection to push it back. In the same way, when dragging from a "last" position, the Positioner model will remove all the trailing empty items. But it modified m_proxyToSource (from which rowCount() depends) before calling beginRemoveRows, sending the model into an inconsitent state and causing an assert. Make sure that m_proxyToSource is touched only after beginRemoveRows. Related: bug 481254 M +18 -11 containments/desktop/plugins/folder/foldermodel.cpp M +11 -6 containments/desktop/plugins/folder/positioner.cpp https://invent.kde.org/plasma/plasma-desktop/-/commit/e306c63ddbeaccea72a03fbb2c3dbd8245addef5 Git commit 4da2346e42302349422cf7c45e64e838fb4d630f by David Edmundson. Committed on 17/06/2024 at 12:44. Pushed by davidedmundson into branch 'master'. FolderView Positioner: fix dragging files across screens. f0ede2d83731952012be0d43c77916d18617edb2 fixed a bug in which items would disappear when dragging between screens. The rationale in the description was correct. The fix there was to queue the connection of rowsInserted so that we don't emit move signals before Positioner proxy model has processed any pending rowsInserted signals. This was incorrectly simplified in 99a3597285a92531efb09492421fac0a6a2e82dc . The important part isn't to process it after FolderModel gets a source model set, but to process it after Positioner gets the source model, which FolderView doesn't know about and the original bug introduced. Rather than a straight revert the code is adjusted to emit the move signal delayed. This is safer than delaying the processing of a signal with index arguments. Related: bug 481254 M +10 -4 containments/desktop/plugins/folder/foldermodel.cpp https://invent.kde.org/plasma/plasma-desktop/-/commit/4da2346e42302349422cf7c45e64e838fb4d630f Git commit 97794807a9a974ba32ee160665f0b69795888268 by David Edmundson, on behalf of David Edmundson. Committed on 17/06/2024 at 13:38. Pushed by davidedmundson into branch 'Plasma/6.1'. FolderView Positioner: fix dragging files across screens. f0ede2d83731952012be0d43c77916d18617edb2 fixed a bug in which items would disappear when dragging between screens. The rationale in the description was correct. The fix there was to queue the connection of rowsInserted so that we don't emit move signals before Positioner proxy model has processed any pending rowsInserted signals. This was incorrectly simplified in 99a3597285a92531efb09492421fac0a6a2e82dc . The important part isn't to process it after FolderModel gets a source model set, but to process it after Positioner gets the source model, which FolderView doesn't know about and the original bug introduced. Rather than a straight revert the code is adjusted to emit the move signal delayed. This is safer than delaying the processing of a signal with index arguments. Related: bug 481254 (cherry picked from commit 4da2346e42302349422cf7c45e64e838fb4d630f) Co-authored-by: David Edmundson <kde@davidedmundson.co.uk> M +10 -4 containments/desktop/plugins/folder/foldermodel.cpp https://invent.kde.org/plasma/plasma-desktop/-/commit/97794807a9a974ba32ee160665f0b69795888268 |