From f8531ac632000bc69a961eecb04af0d4ee0500db Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 30 Jan 2018 11:17:25 +0100 Subject: [PATCH] MainMenu: Fix null session manager warnings in test mode --- src/lib/app/mainmenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/app/mainmenu.cpp b/src/lib/app/mainmenu.cpp index 6fd990e84..18cce35fd 100644 --- a/src/lib/app/mainmenu.cpp +++ b/src/lib/app/mainmenu.cpp @@ -79,7 +79,7 @@ void MainMenu::initSuperMenu(QMenu* superMenu) const superMenu->addAction(m_actions[QSL("File/NewWindow")]); superMenu->addAction(m_actions[QSL("File/NewPrivateWindow")]); superMenu->addAction(m_actions[QSL("File/OpenFile")]); - if (!mApp->isPrivate()) { + if (mApp->sessionManager()) { superMenu->addSeparator(); QMenu* sessionsSubmenu = new QMenu(tr("Sessions")); connect(sessionsSubmenu, SIGNAL(aboutToShow()), mApp->sessionManager(), SLOT(aboutToShowSessionsMenu())); @@ -493,7 +493,7 @@ void MainMenu::init() ADD_ACTION("File/CloseWindow", m_menuFile, QIcon::fromTheme(QSL("window-close")), tr("Close Window"), SLOT(closeWindow()), "Ctrl+Shift+W"); m_menuFile->addSeparator(); - if (!mApp->isPrivate()) { + if (mApp->sessionManager()) { QMenu* sessionsSubmenu = new QMenu(tr("Sessions")); connect(sessionsSubmenu, SIGNAL(aboutToShow()), mApp->sessionManager(), SLOT(aboutToShowSessionsMenu())); m_menuFile->addMenu(sessionsSubmenu);