┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2025-09-07 22:47:35 +0200
committerFelix Ernst <[email protected]>2025-09-07 22:47:35 +0200
commitfb4a4eb1884da2192bf17ab4f92f2ff01f531044 (patch)
tree7bfc5c7b4735742a3b824b6abd882f5eedbc1d7d /src/kitemviews
parentbfa9c13cb24da62bea8d45f9f99a884a50a039a3 (diff)
Fix crash between selection mode and folder icon chooser
Opening selection mode twice with a single folder selected causes a crash. SetFolderIconItemAction expects its widget to be destroyed but the SelectionMode::BottomBar code path keeps it alive, so the second call to QWidgetAction::createWidget() of the folder icon chooser crashes because the previously created widget still has a parent. This small check fixes the crash. Contrarily, the regular context menu does destroy the actions on hide, so no crash happens there. An alternative fix to what was implemented in this commit could look at the lifetime handling of the SelectionMode::BottomBar implementation. Its BottomBarContentsContainer is never destroyed, BottomBarContentsContainer::contextActionsFor does not set lifetimes on contextActions, or destroys its actions on hide. However, fixing this here in QWidgetAction::createWidget() also makes sense because the related QWidgetAction::requestWidget() method transfers ownership to the caller. It's not part of this API to expect the caller to delete the widget immediately. On the contrary QWidgetAction::requestWidget(QWidget *parent) is typically expected to be callable e.g. by toolbars as well where the action will persist indefinitely. BUG: 508648
Diffstat (limited to 'src/kitemviews')
0 files changed, 0 insertions, 0 deletions