summaryrefslogtreecommitdiff
path: root/src/plugins/valgrind/valgrindplugin.cpp
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2015-06-29 10:36:29 +0300
committerBogDan Vatra <bogdan@kde.org>2015-06-30 06:20:54 +0000
commit2182ded57be0bd91ab4459e622c2ac8fbef90e65 (patch)
tree1b3941c056e883b5eaa8578b26f7bc26cbf2abe9 /src/plugins/valgrind/valgrindplugin.cpp
parent7743664957f3a9e857d72530e475d13844bd4037 (diff)
downloadqt-creator-2182ded57be0bd91ab4459e622c2ac8fbef90e65.tar.gz
ProjectExplorer: Use Core::Id as RunMode "enum values"
This provides a way for third-party plugins to implement run modes without the need to add a value to the central enum or using manual workarounds like RunMode(*(int*)&someUniqueObject). Instead of centrally defined enum values this uses Core::Id that could be defined anywhere. Change-Id: Ic350e3d8dbb8042c61b2d4ffec993ca151f53099 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/valgrind/valgrindplugin.cpp')
-rw-r--r--src/plugins/valgrind/valgrindplugin.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/valgrind/valgrindplugin.cpp b/src/plugins/valgrind/valgrindplugin.cpp
index f8efdf3352..f92b648230 100644
--- a/src/plugins/valgrind/valgrindplugin.cpp
+++ b/src/plugins/valgrind/valgrindplugin.cpp
@@ -54,7 +54,6 @@
#include <cppeditor/cppeditorconstants.h>
#include <projectexplorer/projectexplorer.h>
-#include <projectexplorer/projectexplorerconstants.h>
#include <utils/hostosinfo.h>
@@ -166,7 +165,7 @@ void ValgrindPlugin::extensionsInitialized()
action->setWidgetCreator(mcWidgetCreator);
action->setRunControlCreator(mcRunControlCreator);
action->setToolMode(DebugMode);
- action->setRunMode(ProjectExplorer::MemcheckRunMode);
+ action->setRunMode(MEMCHECK_RUN_MODE);
action->setText(tr("Valgrind Memory Analyzer"));
action->setToolTip(memcheckToolTip);
action->setMenuGroup(Analyzer::Constants::G_ANALYZER_TOOLS);
@@ -182,7 +181,7 @@ void ValgrindPlugin::extensionsInitialized()
action->setRunControlCreator(std::bind(&MemcheckWithGdbTool::createRunControl,
mcgTool, _1, _2));
action->setToolMode(DebugMode);
- action->setRunMode(ProjectExplorer::MemcheckWithGdbRunMode);
+ action->setRunMode(MEMCHECK_WITH_GDB_RUN_MODE);
action->setText(tr("Valgrind Memory Analyzer with GDB"));
action->setToolTip(tr("Valgrind Analyze Memory with GDB uses the "
"Memcheck tool to find memory leaks.\nWhen a problem is detected, "
@@ -197,7 +196,7 @@ void ValgrindPlugin::extensionsInitialized()
action->setWidgetCreator(cgWidgetCreator);
action->setRunControlCreator(cgRunControlCreator);
action->setToolMode(ReleaseMode);
- action->setRunMode(CallgrindRunMode);
+ action->setRunMode(CALLGRIND_RUN_MODE);
action->setText(tr("Valgrind Function Profiler"));
action->setToolTip(callgrindToolTip);
action->setMenuGroup(Analyzer::Constants::G_ANALYZER_TOOLS);
@@ -216,7 +215,7 @@ void ValgrindPlugin::extensionsInitialized()
ValgrindRunControl *rc = mcTool->createRunControl(sp, 0);
QTC_ASSERT(rc, return);
rc->setCustomStart();
- ProjectExplorerPlugin::startRunControl(rc, MemcheckRunMode);
+ ProjectExplorerPlugin::startRunControl(rc, MEMCHECK_RUN_MODE);
});
action->setText(tr("Valgrind Memory Analyzer (External Remote Application)"));
action->setToolTip(memcheckToolTip);
@@ -234,7 +233,7 @@ void ValgrindPlugin::extensionsInitialized()
ValgrindRunControl *rc = cgTool->createRunControl(sp, 0);
QTC_ASSERT(rc, return);
rc->setCustomStart();
- ProjectExplorerPlugin::startRunControl(rc, CallgrindRunMode);
+ ProjectExplorerPlugin::startRunControl(rc, CALLGRIND_RUN_MODE);
});
action->setText(tr("Valgrind Function Profiler (External Remote Application)"));