Skip to content

Commit e0b899e

Browse files
committed
Better fix for #5754. More of a hack but works well.
Keeps all plugins from hijacking About or Preferences application menus on Mac.
1 parent 790140b commit e0b899e

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/app/qgisapp.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -928,12 +928,6 @@ void QgisApp::createActions()
928928
connect( mActionCustomization, SIGNAL( triggered() ), this, SLOT( customize() ) );
929929

930930
#ifdef Q_WS_MAC
931-
// copy of Options action that gets moved to app Preferences...
932-
mActionOptionsMac = new QAction( mActionOptions->text(), this );
933-
mActionOptionsMac->setMenuRole( QAction::NoRole );
934-
mActionOptionsMac->setIcon( mActionOptions->icon() );
935-
connect( mActionOptionsMac, SIGNAL( triggered() ), this, SLOT( options() ) );
936-
937931
// Window Menu Items
938932

939933
mActionWindowMinimize = new QAction( tr( "Minimize" ), this );
@@ -1164,8 +1158,11 @@ void QgisApp::createMenus()
11641158
}
11651159

11661160
#ifdef Q_WS_MAC
1167-
// copy back the Options action after assigned to app Preferences...
1168-
mSettingsMenu->addAction( mActionOptionsMac );
1161+
1162+
// keep plugins from hijacking About and Preferences application menus
1163+
// these duplicate actions will be moved to application menus by Qt
1164+
mFileMenu->addAction( mActionAbout );
1165+
mFileMenu->addAction( mActionOptions );
11691166

11701167
// Window Menu
11711168

src/app/qgisapp.h

-1
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
978978
// actions for menus and toolbars -----------------
979979

980980
#ifdef Q_WS_MAC
981-
QAction *mActionOptionsMac;
982981
QAction *mActionWindowMinimize;
983982
QAction *mActionWindowZoom;
984983
QAction *mActionWindowSeparator1;

0 commit comments

Comments
 (0)