summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2016-01-28 18:24:08 +0100
committerhjk <hjk@theqtcompany.com>2016-01-29 09:39:47 +0000
commit249a36b573558de7c5c8bfb9f7b151bb7fb72015 (patch)
tree3343244aaeabe561d57dba3f287ecd850826616b
parentb2c6ea47b124273fa6e104608009af5bff574a71 (diff)
downloadqt-creator-249a36b573558de7c5c8bfb9f7b151bb7fb72015.tar.gz
Analyzer: Remove AnalyzerRunControl::runnable() and .connection()
These re-implementations are conceptually "too specific". Rather let the indiviual tools handle there expectations themselves. Change-Id: I0bbea407b2241816a40d19eb1dbb0a7589cbda7b Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r--src/plugins/analyzerbase/analyzerruncontrol.cpp11
-rw-r--r--src/plugins/analyzerbase/analyzerruncontrol.h6
-rw-r--r--src/plugins/android/androidanalyzesupport.cpp1
-rw-r--r--src/plugins/ios/iosrunfactories.cpp2
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp13
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp1
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.cpp3
-rw-r--r--src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp1
-rw-r--r--src/plugins/valgrind/memcheckengine.cpp2
-rw-r--r--src/plugins/valgrind/valgrindengine.cpp10
10 files changed, 24 insertions, 26 deletions
diff --git a/src/plugins/analyzerbase/analyzerruncontrol.cpp b/src/plugins/analyzerbase/analyzerruncontrol.cpp
index b7769e8db9..61e71a335e 100644
--- a/src/plugins/analyzerbase/analyzerruncontrol.cpp
+++ b/src/plugins/analyzerbase/analyzerruncontrol.cpp
@@ -28,7 +28,6 @@
#include "analyzerruncontrol.h"
#include "ianalyzertool.h"
#include "analyzermanager.h"
-#include "analyzerstartparameters.h"
#include <projectexplorer/project.h>
#include <projectexplorer/runconfigurationaspects.h>
@@ -58,16 +57,6 @@ AnalyzerRunControl::AnalyzerRunControl(RunConfiguration *runConfiguration, Core:
this, &AnalyzerRunControl::stopIt);
}
-const StandardRunnable &AnalyzerRunControl::runnable() const
-{
- return RunControl::runnable().as<StandardRunnable>();
-}
-
-const AnalyzerConnection &AnalyzerRunControl::connection() const
-{
- return RunControl::connection().as<AnalyzerConnection>();
-}
-
void AnalyzerRunControl::stopIt()
{
if (stop() == RunControl::StoppedSynchronously)
diff --git a/src/plugins/analyzerbase/analyzerruncontrol.h b/src/plugins/analyzerbase/analyzerruncontrol.h
index 51cfe99e71..f070df31b2 100644
--- a/src/plugins/analyzerbase/analyzerruncontrol.h
+++ b/src/plugins/analyzerbase/analyzerruncontrol.h
@@ -27,10 +27,9 @@
#ifndef ANALYZERRUNCONTROL_H
#define ANALYZERRUNCONTROL_H
-#include "analyzerstartparameters.h"
+#include "analyzerbase_global.h"
#include <projectexplorer/runconfiguration.h>
-#include <projectexplorer/runnables.h>
#include <utils/outputformat.h>
@@ -59,9 +58,6 @@ public:
virtual void pause() {}
virtual void unpause() {}
- const ProjectExplorer::StandardRunnable &runnable() const;
- const AnalyzerConnection &connection() const;
-
virtual void notifyRemoteSetupDone(quint16) {}
virtual void notifyRemoteFinished() {}
diff --git a/src/plugins/android/androidanalyzesupport.cpp b/src/plugins/android/androidanalyzesupport.cpp
index e84358cf8f..cbdda00e21 100644
--- a/src/plugins/android/androidanalyzesupport.cpp
+++ b/src/plugins/android/androidanalyzesupport.cpp
@@ -31,6 +31,7 @@
#include <analyzerbase/ianalyzertool.h>
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
+#include <analyzerbase/analyzerstartparameters.h>
#include <projectexplorer/target.h>
#include <projectexplorer/project.h>
diff --git a/src/plugins/ios/iosrunfactories.cpp b/src/plugins/ios/iosrunfactories.cpp
index 5d16aa3fe5..17b8393174 100644
--- a/src/plugins/ios/iosrunfactories.cpp
+++ b/src/plugins/ios/iosrunfactories.cpp
@@ -34,6 +34,8 @@
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
+#include <analyzerbase/analyzerstartparameters.h>
+
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectexplorer.h>
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
index 5baac87289..6112c6df5b 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
@@ -29,6 +29,8 @@
#include "qmlprofilertool.h"
#include <analyzerbase/analyzermanager.h>
+#include <analyzerbase/analyzerstartparameters.h>
+
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <coreplugin/helpmanager.h>
@@ -109,9 +111,12 @@ bool QmlProfilerRunControl::startEngine()
d->m_tool->finalizeRunControl(this);
QTC_ASSERT(d->m_profilerState, return false);
- if (connection().analyzerPort != 0)
- emit processRunning(connection().analyzerPort);
- else if (connection().analyzerSocket.isEmpty())
+ QTC_ASSERT(connection().is<AnalyzerConnection>(), return false);
+ auto conn = connection().as<AnalyzerConnection>();
+
+ if (conn.analyzerPort != 0)
+ emit processRunning(conn.analyzerPort);
+ else if (conn.analyzerSocket.isEmpty())
d->m_noDebugOutputTimer.start();
d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppRunning);
@@ -233,7 +238,7 @@ void QmlProfilerRunControl::processIsRunning(quint16 port)
d->m_noDebugOutputTimer.stop();
if (port == 0)
- port = connection().analyzerPort;
+ port = connection().as<AnalyzerConnection>().analyzerPort;
if (port != 0)
emit processRunning(port);
}
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp
index 847f9a5a13..c19e23df02 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp
@@ -30,6 +30,7 @@
#include <analyzerbase/ianalyzertool.h>
#include <analyzerbase/analyzerruncontrol.h>
+#include <analyzerbase/analyzerstartparameters.h>
#include <analyzerbase/analyzermanager.h>
#include <debugger/debuggerrunconfigurationaspect.h>
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index 863f42c4d6..e8520a80e4 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -39,6 +39,7 @@
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
+#include <analyzerbase/analyzerstartparameters.h>
#include <utils/fancymainwindow.h>
#include <utils/fileinprojectfinder.h>
@@ -222,7 +223,7 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunControl *runControl)
runControl->registerProfilerStateManager(d->m_profilerState);
// FIXME: Check that there's something sensible in sp.connParams
- auto &connection = runControl->connection();
+ auto connection = runControl->connection().as<AnalyzerConnection>();
if (!connection.analyzerSocket.isEmpty())
d->m_profilerConnections->setLocalSocket(connection.analyzerSocket);
else
diff --git a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
index ecb87e5750..fcbe442e72 100644
--- a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
+++ b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
@@ -33,6 +33,7 @@
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerruncontrol.h>
+#include <analyzerbase/analyzerstartparameters.h>
#include <analyzerbase/ianalyzertool.h>
#include <debugger/debuggerruncontrol.h>
diff --git a/src/plugins/valgrind/memcheckengine.cpp b/src/plugins/valgrind/memcheckengine.cpp
index 05d1567d43..a40ffe9db2 100644
--- a/src/plugins/valgrind/memcheckengine.cpp
+++ b/src/plugins/valgrind/memcheckengine.cpp
@@ -151,7 +151,7 @@ void MemcheckWithGdbRunControl::startDebugger()
const qint64 valgrindPid = runner()->valgrindProcess()->pid();
Debugger::DebuggerStartParameters sp;
- sp.inferior.executable = runnable().executable;
+ sp.inferior = runnable().as<StandardRunnable>();
sp.startMode = Debugger::AttachToRemoteServer;
sp.displayName = QString::fromLatin1("VGdb %1").arg(valgrindPid);
sp.remoteChannel = QString::fromLatin1("| vgdb --pid=%1").arg(valgrindPid);
diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp
index cfdd812e9a..6ea8545448 100644
--- a/src/plugins/valgrind/valgrindengine.cpp
+++ b/src/plugins/valgrind/valgrindengine.cpp
@@ -28,13 +28,15 @@
#include "valgrindsettings.h"
#include "valgrindplugin.h"
+#include <analyzerbase/analyzermanager.h>
+#include <analyzerbase/analyzerstartparameters.h>
+
#include <coreplugin/icore.h>
#include <coreplugin/ioutputpane.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/runconfiguration.h>
-#include <analyzerbase/analyzermanager.h>
#include <QApplication>
#include <QMainWindow>
@@ -85,9 +87,9 @@ bool ValgrindRunControl::startEngine()
ValgrindRunner *run = runner();
run->setValgrindExecutable(m_settings->valgrindExecutable());
run->setValgrindArguments(genericToolArguments() + toolArguments());
- run->setConnectionParameters(connection().connParams);
+ run->setConnectionParameters(connection().as<AnalyzerConnection>().connParams);
run->setUseStartupProject(!m_isCustomStart);
- run->setDebuggee(runnable());
+ run->setDebuggee(runnable().as<StandardRunnable>());
connect(run, &ValgrindRunner::processOutputReceived,
this, &ValgrindRunControl::receiveProcessOutput);
@@ -111,7 +113,7 @@ void ValgrindRunControl::stopEngine()
QString ValgrindRunControl::executable() const
{
- return runnable().executable;
+ return runnable().as<StandardRunnable>().executable;
}
QStringList ValgrindRunControl::genericToolArguments() const