From e0b899e96480e42a10614e0cd8a4ec26ab82f71d Mon Sep 17 00:00:00 2001 From: Larry Shaffer Date: Mon, 11 Jun 2012 11:21:33 -0600 Subject: [PATCH] Better fix for #5754. More of a hack but works well. Keeps all plugins from hijacking About or Preferences application menus on Mac. --- src/app/qgisapp.cpp | 13 +++++-------- src/app/qgisapp.h | 1 - 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index c0cb5d2e5cbe..129f085907fb 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -928,12 +928,6 @@ void QgisApp::createActions() connect( mActionCustomization, SIGNAL( triggered() ), this, SLOT( customize() ) ); #ifdef Q_WS_MAC - // copy of Options action that gets moved to app Preferences... - mActionOptionsMac = new QAction( mActionOptions->text(), this ); - mActionOptionsMac->setMenuRole( QAction::NoRole ); - mActionOptionsMac->setIcon( mActionOptions->icon() ); - connect( mActionOptionsMac, SIGNAL( triggered() ), this, SLOT( options() ) ); - // Window Menu Items mActionWindowMinimize = new QAction( tr( "Minimize" ), this ); @@ -1164,8 +1158,11 @@ void QgisApp::createMenus() } #ifdef Q_WS_MAC - // copy back the Options action after assigned to app Preferences... - mSettingsMenu->addAction( mActionOptionsMac ); + + // keep plugins from hijacking About and Preferences application menus + // these duplicate actions will be moved to application menus by Qt + mFileMenu->addAction( mActionAbout ); + mFileMenu->addAction( mActionOptions ); // Window Menu diff --git a/src/app/qgisapp.h b/src/app/qgisapp.h index 241972efe4d1..ba853fb66cd1 100644 --- a/src/app/qgisapp.h +++ b/src/app/qgisapp.h @@ -978,7 +978,6 @@ class QgisApp : public QMainWindow, private Ui::MainWindow // actions for menus and toolbars ----------------- #ifdef Q_WS_MAC - QAction *mActionOptionsMac; QAction *mActionWindowMinimize; QAction *mActionWindowZoom; QAction *mActionWindowSeparator1;