diff options
author | BogDan Vatra <bogdan@kde.org> | 2015-06-29 10:36:29 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kde.org> | 2015-06-30 06:20:54 +0000 |
commit | 2182ded57be0bd91ab4459e622c2ac8fbef90e65 (patch) | |
tree | 1b3941c056e883b5eaa8578b26f7bc26cbf2abe9 /src/plugins/valgrind/valgrindruncontrolfactory.cpp | |
parent | 7743664957f3a9e857d72530e475d13844bd4037 (diff) | |
download | qt-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/valgrindruncontrolfactory.cpp')
-rw-r--r-- | src/plugins/valgrind/valgrindruncontrolfactory.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/valgrind/valgrindruncontrolfactory.cpp b/src/plugins/valgrind/valgrindruncontrolfactory.cpp index 23b393d2bb..32f214b2ec 100644 --- a/src/plugins/valgrind/valgrindruncontrolfactory.cpp +++ b/src/plugins/valgrind/valgrindruncontrolfactory.cpp @@ -31,6 +31,8 @@ #include "valgrindruncontrolfactory.h" #include "valgrindsettings.h" #include "valgrindplugin.h" +#include "callgrindtool.h" +#include "memchecktool.h" #include <analyzerbase/ianalyzertool.h> #include <analyzerbase/analyzermanager.h> @@ -62,13 +64,13 @@ ValgrindRunControlFactory::ValgrindRunControlFactory(QObject *parent) : { } -bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const +bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id mode) const { Q_UNUSED(runConfiguration); - return mode == CallgrindRunMode || mode == MemcheckRunMode || mode == MemcheckWithGdbRunMode; + return mode == CALLGRIND_RUN_MODE || mode == MEMCHECK_RUN_MODE || mode == MEMCHECK_WITH_GDB_RUN_MODE; } -RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage) +RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id mode, QString *errorMessage) { Q_UNUSED(errorMessage); |