Analyzer: Move common startTool implementations to IAnalyzerTool base

Change-Id: I963cb2d025a10cee75b9a9648531c4daeb1b70aa
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
This commit is contained in:
hjk
2013-08-02 11:41:02 +02:00
parent 92e8f8e59b
commit 1ec636cbd6
9 changed files with 139 additions and 157 deletions

View File

@@ -612,7 +612,7 @@ AnalyzerRunControl *CallgrindToolPrivate::createRunControl(const AnalyzerStartPa
void CallgrindTool::startTool(StartMode mode)
{
ValgrindPlugin::startValgrindTool(this, mode);
IAnalyzerTool::startTool(mode);
d->setBusyCursor(true);
}

View File

@@ -464,11 +464,6 @@ AnalyzerRunControl *MemcheckTool::createRunControl(const AnalyzerStartParameters
return engine;
}
void MemcheckTool::startTool(StartMode mode)
{
ValgrindPlugin::startValgrindTool(this, mode);
}
void MemcheckTool::engineStarting(const AnalyzerRunControl *engine)
{
setBusyCursor(true);

View File

@@ -113,7 +113,6 @@ private:
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration = 0);
void startTool(Analyzer::StartMode mode);
void clearErrorView();

View File

@@ -34,62 +34,16 @@
#include "memchecktool.h"
#include "valgrindruncontrolfactory.h"
#include <analyzerbase/analyzerconstants.h>
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerrunconfigwidget.h>
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerstartparameters.h>
#include <analyzerbase/startremotedialog.h>
#include <projectexplorer/localapplicationrunconfiguration.h>
#include <projectexplorer/projectexplorer.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QDebug>
#include <QStringList>
#include <QtPlugin>
#include <QAction>
using namespace Analyzer;
using namespace ProjectExplorer;
namespace Valgrind {
namespace Internal {
static void startRemoteTool(IAnalyzerTool *tool)
{
Q_UNUSED(tool);
StartRemoteDialog dlg;
if (dlg.exec() != QDialog::Accepted)
return;
AnalyzerStartParameters sp;
sp.startMode = StartRemote;
sp.connParams = dlg.sshParams();
sp.debuggee = dlg.executable();
sp.debuggeeArgs = dlg.arguments();
sp.displayName = dlg.executable();
sp.workingDirectory = dlg.workingDirectory();
//AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, 0);
AnalyzerRunControl *rc = tool->createRunControl(sp, 0);
//m_currentRunControl = rc;
QObject::connect(AnalyzerManager::stopAction(), SIGNAL(triggered()), rc, SLOT(stopIt()));
ProjectExplorerPlugin::instance()->startRunControl(rc, tool->runMode());
}
void ValgrindPlugin::startValgrindTool(IAnalyzerTool *tool, StartMode mode)
{
if (mode == StartLocal)
AnalyzerManager::startLocalTool(tool);
if (mode == StartRemote)
startRemoteTool(tool);
}
bool ValgrindPlugin::initialize(const QStringList &, QString *)
{
StartModes modes;

View File

@@ -47,8 +47,6 @@ public:
virtual bool initialize(const QStringList &arguments, QString *errorString);
virtual void extensionsInitialized() {}
static void startValgrindTool(Analyzer::IAnalyzerTool *tool, Analyzer::StartMode mode);
};
} // namespace Internal