summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Jenssen <tim.jenssen@theqtcompany.com>2014-12-19 11:25:05 +0100
committerChristian Stenger <christian.stenger@theqtcompany.com>2015-01-06 15:35:55 +0200
commit1cc239ef41d1e7d356979d3dca59c3489b1dfba7 (patch)
treed03eac3e6d908dc7771e70e332bfdc241503fca5
parent2cc47c2039c4b78c2f14b268ef156afd90255843 (diff)
downloadqt-creator-1cc239ef41d1e7d356979d3dca59c3489b1dfba7.tar.gz
move create menu entries to extra function
Change-Id: Ia504e453b6cacc254ea598c629c3762c03cfa783 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r--plugins/autotest/autotestplugin.cpp25
-rw-r--r--plugins/autotest/autotestplugin.h1
2 files changed, 16 insertions, 10 deletions
diff --git a/plugins/autotest/autotestplugin.cpp b/plugins/autotest/autotestplugin.cpp
index 7823fdef2c..a4b3108cdd 100644
--- a/plugins/autotest/autotestplugin.cpp
+++ b/plugins/autotest/autotestplugin.cpp
@@ -83,6 +83,20 @@ bool AutotestPlugin::checkLicense()
return true;
}
+void AutotestPlugin::initializeMenuEntries()
+{
+ QAction *action = new QAction(tr("Autotest action"), this);
+ Core::Command *command = Core::ActionManager::registerAction(action, Constants::ACTION_ID,
+ Core::Context(Core::Constants::C_GLOBAL));
+ command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A")));
+ connect(action, SIGNAL(triggered()), this, SLOT(triggerAction()));
+
+ Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID);
+ menu->menu()->setTitle(tr("Tests"));
+ menu->addAction(command);
+ Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
+}
+
bool AutotestPlugin::initialize(const QStringList &arguments, QString *errorString)
{
// Register objects in the plugin manager's object pool
@@ -98,16 +112,7 @@ bool AutotestPlugin::initialize(const QStringList &arguments, QString *errorStri
if (!checkLicense())
return true;
- QAction *action = new QAction(tr("Autotest action"), this);
- Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID,
- Core::Context(Core::Constants::C_GLOBAL));
- cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A")));
- connect(action, SIGNAL(triggered()), this, SLOT(triggerAction()));
-
- Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID);
- menu->menu()->setTitle(tr("Tests"));
- menu->addAction(cmd);
- Core::ActionManager::actionContainer(Core::Constants::M_TOOLS)->addMenu(menu);
+ initializeMenuEntries();
m_settings->fromSettings(Core::ICore::settings());
TestSettingsPage *settingsPage = new TestSettingsPage(m_settings);
diff --git a/plugins/autotest/autotestplugin.h b/plugins/autotest/autotestplugin.h
index 5f761264a2..71f887791d 100644
--- a/plugins/autotest/autotestplugin.h
+++ b/plugins/autotest/autotestplugin.h
@@ -50,6 +50,7 @@ private slots:
private:
bool checkLicense();
+ void initializeMenuEntries();
const QSharedPointer<TestSettings> m_settings;
};