Adapt to changes to run mode

Change-Id: I9e299d6fa49920ffa98ececb5b96e9512055ba34
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Eike Ziller
2015-06-30 10:56:56 +02:00
parent 33ee3ffcca
commit 39613b3b08
5 changed files with 13 additions and 8 deletions

View File

@@ -24,6 +24,7 @@ namespace Constants {
const char CLANG_EXECUTABLE_BASE_NAME[] = "clang"; const char CLANG_EXECUTABLE_BASE_NAME[] = "clang";
const char SETTINGS_ID[] = "ClangStaticAnalyzer"; const char SETTINGS_ID[] = "ClangStaticAnalyzer";
const char CLANGSTATICANALYZER_RUN_MODE[] = "ClangStaticAnalyzer.RunMode";
} // Constants } // Constants
} // ClangStaticAnalyzer } // ClangStaticAnalyzer

View File

@@ -19,6 +19,7 @@
#include "clangstaticanalyzerplugin.h" #include "clangstaticanalyzerplugin.h"
#include "clangstaticanalyzerconfigwidget.h" #include "clangstaticanalyzerconfigwidget.h"
#include "clangstaticanalyzerconstants.h"
#include "clangstaticanalyzerprojectsettingswidget.h" #include "clangstaticanalyzerprojectsettingswidget.h"
#include "clangstaticanalyzerruncontrolfactory.h" #include "clangstaticanalyzerruncontrolfactory.h"
#include "clangstaticanalyzertool.h" #include "clangstaticanalyzertool.h"
@@ -153,7 +154,7 @@ bool ClangStaticAnalyzerPlugin::initializeEnterpriseFeatures(const QStringList &
"to find bugs."); "to find bugs.");
AnalyzerAction *action = new AnalyzerAction(this); AnalyzerAction *action = new AnalyzerAction(this);
action->setRunMode(ProjectExplorer::ClangStaticAnalyzerMode); action->setRunMode(Constants::CLANGSTATICANALYZER_RUN_MODE);
action->setToolId(ClangStaticAnalyzerToolId); action->setToolId(ClangStaticAnalyzerToolId);
action->setActionId("ClangStaticAnalyzer"); action->setActionId("ClangStaticAnalyzer");
action->setWidgetCreator(widgetCreator); action->setWidgetCreator(widgetCreator);
@@ -161,7 +162,7 @@ bool ClangStaticAnalyzerPlugin::initializeEnterpriseFeatures(const QStringList &
action->setCustomToolStarter([tool] { tool->startTool(); }); action->setCustomToolStarter([tool] { tool->startTool(); });
action->setText(tr("Clang Static Analyzer")); action->setText(tr("Clang Static Analyzer"));
action->setToolTip(toolTip); action->setToolTip(toolTip);
action->setMenuGroup(Constants::G_ANALYZER_TOOLS); action->setMenuGroup(Analyzer::Constants::G_ANALYZER_TOOLS);
action->setEnabled(false); action->setEnabled(false);
AnalyzerManager::addAction(action); AnalyzerManager::addAction(action);

View File

@@ -18,6 +18,8 @@
#include "clangstaticanalyzerruncontrolfactory.h" #include "clangstaticanalyzerruncontrolfactory.h"
#include "clangstaticanalyzerconstants.h"
#include <analyzerbase/analyzermanager.h> #include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h> #include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h> #include <analyzerbase/analyzerstartparameters.h>
@@ -51,9 +53,9 @@ ClangStaticAnalyzerRunControlFactory::ClangStaticAnalyzerRunControlFactory(
} }
bool ClangStaticAnalyzerRunControlFactory::canRun(RunConfiguration *runConfiguration, bool ClangStaticAnalyzerRunControlFactory::canRun(RunConfiguration *runConfiguration,
RunMode runMode) const Core::Id runMode) const
{ {
if (runMode != ClangStaticAnalyzerMode) if (runMode != Constants::CLANGSTATICANALYZER_RUN_MODE)
return false; return false;
Target *target = runConfiguration->target(); Target *target = runConfiguration->target();
@@ -68,7 +70,7 @@ bool ClangStaticAnalyzerRunControlFactory::canRun(RunConfiguration *runConfigura
} }
RunControl *ClangStaticAnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, RunControl *ClangStaticAnalyzerRunControlFactory::create(RunConfiguration *runConfiguration,
RunMode runMode, Core::Id runMode,
QString *errorMessage) QString *errorMessage)
{ {
using namespace CppTools; using namespace CppTools;

View File

@@ -35,10 +35,10 @@ public:
QObject *parent = 0); QObject *parent = 0);
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode runMode) const; Core::Id runMode) const;
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode runMode, Core::Id runMode,
QString *errorMessage); QString *errorMessage);
private: private:

View File

@@ -18,6 +18,7 @@
#include "clangstaticanalyzertool.h" #include "clangstaticanalyzertool.h"
#include "clangstaticanalyzerconstants.h"
#include "clangstaticanalyzerdiagnosticmodel.h" #include "clangstaticanalyzerdiagnosticmodel.h"
#include "clangstaticanalyzerdiagnosticview.h" #include "clangstaticanalyzerdiagnosticview.h"
#include "clangstaticanalyzerruncontrol.h" #include "clangstaticanalyzerruncontrol.h"
@@ -249,7 +250,7 @@ void ClangStaticAnalyzerTool::startTool()
connect(SessionManager::instance(), &SessionManager::aboutToRemoveProject, this, connect(SessionManager::instance(), &SessionManager::aboutToRemoveProject, this,
onProjectRemoved, Qt::UniqueConnection); onProjectRemoved, Qt::UniqueConnection);
} }
ProjectExplorerPlugin::runRunConfiguration(rc, ProjectExplorer::ClangStaticAnalyzerMode); ProjectExplorerPlugin::runRunConfiguration(rc, Constants::CLANGSTATICANALYZER_RUN_MODE);
} }
CppTools::ProjectInfo ClangStaticAnalyzerTool::projectInfoBeforeBuild() const CppTools::ProjectInfo ClangStaticAnalyzerTool::projectInfoBeforeBuild() const