diff options
author | hjk <hjk121@nokiamail.com> | 2013-08-08 11:55:54 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-08-12 14:51:24 +0200 |
commit | 4ed17ade89d06c9af4ab261d0189d0ce20c7910f (patch) | |
tree | 792032d6cd4fbb3e4e7b8739fa23a27f1e62661b /src/plugins/valgrind/callgrindtool.cpp | |
parent | d15fb5a75c830089dc0173a9ec0a160be3a2aaf5 (diff) | |
download | qt-creator-4ed17ade89d06c9af4ab261d0189d0ce20c7910f.tar.gz |
Analyzer: Move extensionInitialized() out of IAnalyzerTool
Change-Id: Idd0913ba798a04f65711591dee14cbb714440cbf
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Diffstat (limited to 'src/plugins/valgrind/callgrindtool.cpp')
-rw-r--r-- | src/plugins/valgrind/callgrindtool.cpp | 36 |
1 files changed, 5 insertions, 31 deletions
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 <analyzerbase/analyzerutils.h> #include <analyzerbase/analyzerconstants.h> -#include <coreplugin/actionmanager/actioncontainer.h> -#include <coreplugin/actionmanager/actionmanager.h> -#include <coreplugin/actionmanager/command.h> #include <coreplugin/coreconstants.h> -#include <coreplugin/icontext.h> #include <coreplugin/icore.h> #include <cplusplus/LookupContext.h> #include <cplusplus/Overview.h> -#include <cppeditor/cppeditorconstants.h> #include <extensionsystem/iplugin.h> #include <texteditor/itexteditor.h> @@ -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(); |