From bcf559cd50e2f4228241174e79f6180c5de9fc75 Mon Sep 17 00:00:00 2001
From: con <qtc-committer@nokia.com>
Date: Thu, 5 Mar 2009 15:26:48 +0100
Subject: [PATCH] Fixes:    - Don't use multiple key shortcuts on Mac

Task:     - 244529
Details:  - It just doesn't work in Mac menus (at least not with Qt, but
I suspect it's some Mac thingy), so just don't do it.
---
 src/plugins/cpaster/cpasterplugin.cpp       |  4 ++++
 src/plugins/git/gitplugin.cpp               | 18 ++++++++++++++++++
 src/plugins/subversion/subversionplugin.cpp |  6 ++++++
 3 files changed, 28 insertions(+)

diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp
index 84e1aee202b..d7a88930d90 100644
--- a/src/plugins/cpaster/cpasterplugin.cpp
+++ b/src/plugins/cpaster/cpasterplugin.cpp
@@ -100,13 +100,17 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
 
     m_postAction = new QAction(tr("Paste Snippet..."), this);
     command = actionManager->registerAction(m_postAction, "CodePaster.Post", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+P")));
+#endif
     connect(m_postAction, SIGNAL(triggered()), this, SLOT(post()));
     cpContainer->addAction(command);
 
     m_fetchAction = new QAction(tr("Fetch Snippet..."), this);
     command = actionManager->registerAction(m_fetchAction, "CodePaster.Fetch", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+C,Alt+F")));
+#endif
     connect(m_fetchAction, SIGNAL(triggered()), this, SLOT(fetch()));
     cpContainer->addAction(command);
 
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 57c170114a0..29af5429887 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -277,41 +277,53 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
     m_diffAction = new QAction(tr("Diff Current File"), this);
     command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext);
     command->setAttribute(Core::Command::CA_UpdateText);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D")));
+#endif
     connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
     gitContainer->addAction(command);
 
     m_statusAction = new QAction(tr("File Status"), this);
     command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S")));
+#endif
     command->setAttribute(Core::Command::CA_UpdateText);
     connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile()));
     gitContainer->addAction(command);
 
     m_logAction = new QAction(tr("Log File"), this);
     command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L")));
+#endif
     command->setAttribute(Core::Command::CA_UpdateText);
     connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile()));
     gitContainer->addAction(command);
 
     m_blameAction = new QAction(tr("Blame"), this);
     command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B")));
+#endif
     command->setAttribute(Core::Command::CA_UpdateText);
     connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile()));
     gitContainer->addAction(command);
 
     m_undoFileAction = new QAction(tr("Undo Changes"), this);
     command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U")));
+#endif
     command->setAttribute(Core::Command::CA_UpdateText);
     connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges()));
     gitContainer->addAction(command);
 
     m_stageAction = new QAction(tr("Stage File for Commit"), this);
     command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A")));
+#endif
     command->setAttribute(Core::Command::CA_UpdateText);
     connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile()));
     gitContainer->addAction(command);
@@ -332,7 +344,9 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
 
     m_diffProjectAction = new QAction(tr("Diff Current Project"), this);
     command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D"));
+#endif
     command->setAttribute(Core::Command::CA_UpdateText);
     connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
     gitContainer->addAction(command);
@@ -345,7 +359,9 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
 
     m_logProjectAction = new QAction(tr("Log Project"), this);
     command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K")));
+#endif
     command->setAttribute(Core::Command::CA_UpdateText);
     connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
     gitContainer->addAction(command);
@@ -380,7 +396,9 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
 
     m_commitAction = new QAction(tr("Commit..."), this);
     command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C")));
+#endif
     command->setAttribute(Core::Command::CA_UpdateText);
     connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit()));
     gitContainer->addAction(command);
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index d640315a1a9..5645031eb48 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -321,7 +321,9 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
     command = ami->registerAction(m_addAction, SubversionPlugin::ADD,
         globalcontext);
     command->setAttribute(Core::Command::CA_UpdateText);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A")));
+#endif
     connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
     subversionMenu->addAction(command);
 
@@ -351,7 +353,9 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
     command = ami->registerAction(m_diffCurrentAction,
         SubversionPlugin::DIFF_CURRENT, globalcontext);
     command->setAttribute(Core::Command::CA_UpdateText);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D")));
+#endif
     connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
     subversionMenu->addAction(command);
 
@@ -367,7 +371,9 @@ bool SubversionPlugin::initialize(const QStringList &arguments, QString *errorMe
     command = ami->registerAction(m_commitCurrentAction,
         SubversionPlugin::COMMIT_CURRENT, globalcontext);
     command->setAttribute(Core::Command::CA_UpdateText);
+#ifndef Q_OS_MAC
     command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C")));
+#endif
     connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
     subversionMenu->addAction(command);
 
-- 
GitLab