Commit b14a7c7b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure that it doesn't crash on kontact

parent b15f25c1
Pipeline #64783 passed with stage
in 8 minutes and 12 seconds
...@@ -60,16 +60,18 @@ MainWindow::MainWindow(QWidget *parent) ...@@ -60,16 +60,18 @@ MainWindow::MainWindow(QWidget *parent)
KStandardAction::quit(qApp, &QApplication::quit, actionCollection()); KStandardAction::quit(qApp, &QApplication::quit, actionCollection());
mShowMenuBarAction = KStandardAction::showMenubar(menuBar(), &QMenuBar::setVisible, actionCollection()); mShowMenuBarAction = KStandardAction::showMenubar(menuBar(), &QMenuBar::setVisible, actionCollection());
mHamburgerMenu = KStandardAction::hamburgerMenu(nullptr, nullptr, actionCollection()); if (menuBar()) {
mHamburgerMenu->setShowMenuBarAction(mShowMenuBarAction); mHamburgerMenu = KStandardAction::hamburgerMenu(nullptr, nullptr, actionCollection());
mHamburgerMenu->setMenuBar(menuBar()); mHamburgerMenu->setShowMenuBarAction(mShowMenuBarAction);
connect(mHamburgerMenu, &KHamburgerMenu::aboutToShowMenu, this, [this]() { mHamburgerMenu->setMenuBar(menuBar());
updateHamburgerMenu(); connect(mHamburgerMenu, &KHamburgerMenu::aboutToShowMenu, this, [this]() {
// Immediately disconnect. We only need to run this once, but on demand. updateHamburgerMenu();
// NOTE: The nullptr at the end disconnects all connections between // Immediately disconnect. We only need to run this once, but on demand.
// q and mHamburgerMenu's aboutToShowMenu signal. // NOTE: The nullptr at the end disconnects all connections between
disconnect(mHamburgerMenu, &KHamburgerMenu::aboutToShowMenu, this, nullptr); // q and mHamburgerMenu's aboutToShowMenu signal.
}); disconnect(mHamburgerMenu, &KHamburgerMenu::aboutToShowMenu, this, nullptr);
});
}
setStandardToolBarMenuEnabled(true); setStandardToolBarMenuEnabled(true);
createStandardStatusBarAction(); createStandardStatusBarAction();
......
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