From kde-commits Thu Jan 14 19:38:27 2016 From: Frank Reininghaus Date: Thu, 14 Jan 2016 19:38:27 +0000 To: kde-commits Subject: [dolphin/Applications/15.12] src: Do not delete sub menus of the control menu explicitly Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=145280032028109 Git commit ddc050f23596493e8debd2dfd523fd572c098d63 by Frank Reininghaus. Committed on 14/01/2016 at 19:36. Pushed by freininghaus into branch 'Applications/15.12'. 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 M +2 -5 src/dolphinmainwindow.cpp http://commits.kde.org/dolphin/ddc050f23596493e8debd2dfd523fd572c098d63 diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 9b05168..81c55e8 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -789,8 +789,8 @@ void DolphinMainWindow::updateControlMenu() QMenu* menu =3D qobject_cast(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-me= nus + // because 'menu' is their parent. menu->clear(); = KActionCollection* ac =3D actionCollection(); @@ -840,7 +840,6 @@ void DolphinMainWindow::updateControlMenu() = // Add "Go" menu QMenu* goMenu =3D new QMenu(i18nc("@action:inmenu", "Go"), menu); - connect(menu, &QMenu::aboutToHide, goMenu, &QMenu::deleteLater); goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Ba= ck))); goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Fo= rward))); goMenu->addAction(ac->action(KStandardAction::name(KStandardAction::Up= ))); @@ -850,7 +849,6 @@ void DolphinMainWindow::updateControlMenu() = // Add "Tool" menu QMenu* toolsMenu =3D 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 @@ void DolphinMainWindow::updateControlMenu() = // Add "Help" menu QMenu* helpMenu =3D 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();