dolphin/Do-not-delete-sub-menus-of-the-control-menu-explicitly.patch
Raymond Wooninck 42a290820e Accepting request 353761 from home:wolfi323:branches:KDE:Applications
Added Do-not-delete-sub-menus-of-the-control-menu-explicitly.patch: fixes a possible crash when closing the "Control" menu (boo#952460, kde#354558)

OBS-URL: https://build.opensuse.org/request/show/353761
OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/dolphin?expand=0&rev=24
2016-01-15 07:05:56 +00:00

61 lines
2.3 KiB
Diff

From: Frank Reininghaus <frank78ac@googlemail.com>
Date: Sun, 10 Jan 2016 10:18:30 +0000
Subject: Do not delete sub menus of the control menu explicitly
X-Git-Url: http://quickgit.kde.org/?p=dolphin.git&a=commitdiff&h=ddc050f23596493e8debd2dfd523fd572c098d63
---
Do not delete sub menus of the control menu explicitly
This is not necessary because the sub menus are children of the main
menu, such that they are deleted together with the other actions by
QMenu::clear().
This prevents a crash that can happen if a sub menu is open while
another menu action is clicked.
Thanks to Fabian Vogt and Wolfgang Bauer for investigating this issue!
BUG: 354558
FIXED-IN: 15.12.2
REVIEW: 126693
---
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -789,8 +789,8 @@
QMenu* menu = qobject_cast<QMenu*>(sender());
Q_ASSERT(menu);
- // All actions get cleared by QMenu::clear(). The sub-menus are deleted
- // by connecting to the aboutToHide() signal from the parent-menu.
+ // All actions get cleared by QMenu::clear(). This includes the sub-menus
+ // because 'menu' is their parent.
menu->clear();
KActionCollection* ac = actionCollection();
@@ -840,7 +840,6 @@
// Add "Go" menu
QMenu* goMenu = new QMenu(i18nc("@action:inmenu", "Go"), menu);
- connect(menu, &QMenu::aboutToHide, goMenu, &QMenu::deleteLater);
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Back)));
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Forward)));
goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Up)));
@@ -850,7 +849,6 @@
// Add "Tool" menu
QMenu* toolsMenu = new QMenu(i18nc("@action:inmenu", "Tools"), menu);
- connect(menu, &QMenu::aboutToHide, toolsMenu, &QMenu::deleteLater);
toolsMenu->addAction(ac->action("show_filter_bar"));
toolsMenu->addAction(ac->action("compare_files"));
toolsMenu->addAction(ac->action("open_terminal"));
@@ -864,7 +862,6 @@
// Add "Help" menu
QMenu* helpMenu = new QMenu(i18nc("@action:inmenu", "Help"), menu);
- connect(menu, &QMenu::aboutToHide, helpMenu, &QMenu::deleteLater);
helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::HelpContents)));
helpMenu->addAction(ac->action(KStandardAction::name(KStandardAction::WhatsThis)));
helpMenu->addSeparator();