From 4ed17ade89d06c9af4ab261d0189d0ce20c7910f Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 8 Aug 2013 11:55:54 +0200 Subject: Analyzer: Move extensionInitialized() out of IAnalyzerTool Change-Id: Idd0913ba798a04f65711591dee14cbb714440cbf Reviewed-by: Aurindam Jana --- src/plugins/valgrind/callgrindtool.cpp | 36 +++++----------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'src/plugins/valgrind/callgrindtool.cpp') diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 48f77fed32..2359da6307 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -51,16 +51,11 @@ #include #include -#include -#include -#include #include -#include #include #include #include -#include #include #include @@ -207,7 +202,6 @@ public: QAction *m_dumpAction; QAction *m_resetAction; QAction *m_pauseAction; - QAction *m_showCostsOfFunctionAction; QString m_toggleCollectFunction; }; @@ -236,7 +230,6 @@ CallgrindToolPrivate::CallgrindToolPrivate(CallgrindTool *parent) , m_dumpAction(0) , m_resetAction(0) , m_pauseAction(0) - , m_showCostsOfFunctionAction(0) { m_updateTimer->setInterval(200); m_updateTimer->setSingleShot(true); @@ -520,30 +513,6 @@ IAnalyzerTool::ToolMode CallgrindTool::toolMode() const return ReleaseMode; } -void CallgrindTool::extensionsInitialized() -{ - Core::Context analyzerContext = Core::Context(Analyzer::Constants::C_ANALYZEMODE); - - // check if there is a CppEditor context menu, if true, add our own context menu actions - if (Core::ActionContainer *editorContextMenu = - Core::ActionManager::actionContainer(CppEditor::Constants::M_CONTEXT)) { - QAction *action = 0; - Core::Command *cmd = 0; - - editorContextMenu->addSeparator(analyzerContext); - - action = new QAction(tr("Profile Costs of this Function and its Callees"), this); - action->setIcon(QIcon(QLatin1String(Analyzer::Constants::ANALYZER_CONTROL_START_ICON))); - connect(action, SIGNAL(triggered()), d, SLOT(handleShowCostsOfFunction())); - cmd = Core::ActionManager::registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction", - analyzerContext); - editorContextMenu->addAction(cmd); - cmd->setAttribute(Core::Command::CA_Hide); - cmd->setAttribute(Core::Command::CA_NonConfigurable); - d->m_showCostsOfFunctionAction = action; - } -} - AnalyzerRunControl *CallgrindTool::createRunControl(const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration) { @@ -595,6 +564,11 @@ void CallgrindTool::startTool(StartMode mode) d->setBusyCursor(true); } +void CallgrindTool::handleShowCostsOfFunction() +{ + d->handleShowCostsOfFunction(); +} + QWidget *CallgrindTool::createWidgets() { return d->createWidgets(); -- cgit v1.2.1