Commit f2012bca authored by hjk's avatar hjk

Analyzer: Remove explicit working directory storage in run control

Instead, use the one in its (Standard)Runnable.

The change is mechanical except to the fallback to the project directory
which was introduced in 8150209f to keep some compatibility with the previous
setup of the Android runner which created and copied the fallback value around
and ignored it in the end. Not producing the fallback value is less effort.

Change-Id: Ie04da570f0f9fbc1d048f2eacaed522f7253afa3
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 06a99af0
...@@ -52,14 +52,6 @@ AnalyzerRunControl::AnalyzerRunControl(RunConfiguration *runConfiguration, Core: ...@@ -52,14 +52,6 @@ AnalyzerRunControl::AnalyzerRunControl(RunConfiguration *runConfiguration, Core:
{ {
setIcon(Icons::ANALYZER_CONTROL_START); setIcon(Icons::ANALYZER_CONTROL_START);
if (runConfiguration) {
setDisplayName(runConfiguration->displayName());
if (auto aspect = runConfiguration->extraAspect<WorkingDirectoryAspect>())
m_workingDirectory = aspect->workingDirectory().toString();
if (m_workingDirectory.isEmpty())
m_workingDirectory = runConfiguration->target()->project()->projectDirectory().toString();
}
connect(this, &AnalyzerRunControl::finished, connect(this, &AnalyzerRunControl::finished,
this, &AnalyzerRunControl::runControlFinished); this, &AnalyzerRunControl::runControlFinished);
connect(AnalyzerManager::stopAction(), &QAction::triggered, connect(AnalyzerManager::stopAction(), &QAction::triggered,
...@@ -88,11 +80,6 @@ void AnalyzerRunControl::runControlFinished() ...@@ -88,11 +80,6 @@ void AnalyzerRunControl::runControlFinished()
AnalyzerManager::handleToolFinished(); AnalyzerManager::handleToolFinished();
} }
QString AnalyzerRunControl::workingDirectory() const
{
return m_workingDirectory;
}
void AnalyzerRunControl::start() void AnalyzerRunControl::start()
{ {
AnalyzerManager::handleToolStarted(); AnalyzerManager::handleToolStarted();
...@@ -118,9 +105,4 @@ bool AnalyzerRunControl::isRunning() const ...@@ -118,9 +105,4 @@ bool AnalyzerRunControl::isRunning() const
return m_isRunning; return m_isRunning;
} }
void AnalyzerRunControl::setWorkingDirectory(const QString &workingDirectory)
{
m_workingDirectory = workingDirectory;
}
} // namespace Analyzer } // namespace Analyzer
...@@ -70,9 +70,6 @@ public: ...@@ -70,9 +70,6 @@ public:
StopResult stop(); StopResult stop();
bool isRunning() const; bool isRunning() const;
QString workingDirectory() const;
void setWorkingDirectory(const QString &workingDirectory);
public slots: public slots:
virtual void logApplicationMessage(const QString &, Utils::OutputFormat) {} virtual void logApplicationMessage(const QString &, Utils::OutputFormat) {}
...@@ -89,9 +86,6 @@ private: ...@@ -89,9 +86,6 @@ private:
protected: protected:
bool m_isRunning; bool m_isRunning;
private:
QString m_workingDirectory;
}; };
} // namespace Analyzer } // namespace Analyzer
......
...@@ -103,7 +103,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat ...@@ -103,7 +103,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
LocalQmlProfilerRunner::Configuration conf; LocalQmlProfilerRunner::Configuration conf;
conf.executable = runnable.executable; conf.executable = runnable.executable;
conf.executableArguments = runnable.commandLineArguments; conf.executableArguments = runnable.commandLineArguments;
conf.workingDirectory = runControl->workingDirectory(); conf.workingDirectory = runnable.workingDirectory;
conf.socket = connection.analyzerSocket; conf.socket = connection.analyzerSocket;
if (EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>()) if (EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>())
conf.environment = environment->environment(); conf.environment = environment->environment();
......
...@@ -85,7 +85,6 @@ bool ValgrindRunControl::startEngine() ...@@ -85,7 +85,6 @@ bool ValgrindRunControl::startEngine()
StandardRunnable debuggee = runnable(); StandardRunnable debuggee = runnable();
// FIXME: Consolidate: // FIXME: Consolidate:
debuggee.workingDirectory = workingDirectory();
debuggee.environment = m_environment; debuggee.environment = m_environment;
debuggee.runMode = m_localRunMode; debuggee.runMode = m_localRunMode;
......
...@@ -199,7 +199,6 @@ void ValgrindPlugin::extensionsInitialized() ...@@ -199,7 +199,6 @@ void ValgrindPlugin::extensionsInitialized()
connection.connParams = dlg.sshParams(); connection.connParams = dlg.sshParams();
rc->setConnection(connection); rc->setConnection(connection);
rc->setDisplayName(runnable.executable); rc->setDisplayName(runnable.executable);
rc->setWorkingDirectory(runnable.workingDirectory);
rc->setCustomStart(); rc->setCustomStart();
ProjectExplorerPlugin::startRunControl(rc, MEMCHECK_RUN_MODE); ProjectExplorerPlugin::startRunControl(rc, MEMCHECK_RUN_MODE);
}); });
...@@ -224,7 +223,6 @@ void ValgrindPlugin::extensionsInitialized() ...@@ -224,7 +223,6 @@ void ValgrindPlugin::extensionsInitialized()
connection.connParams = dlg.sshParams(); connection.connParams = dlg.sshParams();
rc->setConnection(connection); rc->setConnection(connection);
rc->setDisplayName(runnable.executable); rc->setDisplayName(runnable.executable);
rc->setWorkingDirectory(runnable.workingDirectory);
rc->setCustomStart(); rc->setCustomStart();
ProjectExplorerPlugin::startRunControl(rc, CALLGRIND_RUN_MODE); ProjectExplorerPlugin::startRunControl(rc, CALLGRIND_RUN_MODE);
}); });
......
...@@ -78,13 +78,11 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration ...@@ -78,13 +78,11 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
Utils::Environment environment; Utils::Environment environment;
StandardRunnable runnable; StandardRunnable runnable;
AnalyzerConnection connection; AnalyzerConnection connection;
QString workingDirectory;
Runnable rcRunnable = runConfiguration->runnable(); Runnable rcRunnable = runConfiguration->runnable();
QTC_ASSERT(rcRunnable.is<StandardRunnable>(), return 0); QTC_ASSERT(rcRunnable.is<StandardRunnable>(), return 0);
auto stdRunnable = runConfiguration->runnable().as<StandardRunnable>(); auto stdRunnable = runConfiguration->runnable().as<StandardRunnable>();
if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) { if (device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
environment = stdRunnable.environment; environment = stdRunnable.environment;
workingDirectory = stdRunnable.workingDirectory;
runnable.executable = stdRunnable.executable; runnable.executable = stdRunnable.executable;
runnable.commandLineArguments = stdRunnable.commandLineArguments; runnable.commandLineArguments = stdRunnable.commandLineArguments;
QTcpServer server; QTcpServer server;
...@@ -105,7 +103,6 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration ...@@ -105,7 +103,6 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
runControl->setConnection(connection); runControl->setConnection(connection);
runControl->setLocalRunMode(localRunMode); runControl->setLocalRunMode(localRunMode);
runControl->setEnvironment(environment); runControl->setEnvironment(environment);
runControl->setWorkingDirectory(workingDirectory);
return runControl; return runControl;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment