Commit 7eb95b28 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure that it doesn't crash on kontact

parent 3114cb00
Pipeline #64782 passed with stage
in 23 minutes and 52 seconds
......@@ -57,16 +57,18 @@ KMMainWin::KMMainWin(QWidget *)
KStandardAction::keyBindings(this, &KMMainWin::slotConfigureShortcuts, actionCollection());
mShowMenuBarAction = KStandardAction::showMenubar(this, &KMMainWin::slotToggleMenubar, actionCollection());
mHamburgerMenu = KStandardAction::hamburgerMenu(nullptr, nullptr, actionCollection());
mHamburgerMenu->setShowMenuBarAction(mShowMenuBarAction);
mHamburgerMenu->setMenuBar(menuBar());
connect(mHamburgerMenu, &KHamburgerMenu::aboutToShowMenu, this, [this]() {
updateHamburgerMenu();
// Immediately disconnect. We only need to run this once, but on demand.
// NOTE: The nullptr at the end disconnects all connections between
// q and mHamburgerMenu's aboutToShowMenu signal.
disconnect(mHamburgerMenu, &KHamburgerMenu::aboutToShowMenu, this, nullptr);
});
if (menuBar()) {
mHamburgerMenu = KStandardAction::hamburgerMenu(nullptr, nullptr, actionCollection());
mHamburgerMenu->setShowMenuBarAction(mShowMenuBarAction);
mHamburgerMenu->setMenuBar(menuBar());
connect(mHamburgerMenu, &KHamburgerMenu::aboutToShowMenu, this, [this]() {
updateHamburgerMenu();
// Immediately disconnect. We only need to run this once, but on demand.
// NOTE: The nullptr at the end disconnects all connections between
// q and mHamburgerMenu's aboutToShowMenu signal.
disconnect(mHamburgerMenu, &KHamburgerMenu::aboutToShowMenu, this, nullptr);
});
}
KStandardAction::quit(this, &KMMainWin::slotQuit, actionCollection());
createGUI(QStringLiteral("kmmainwin.rc"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment