Skip to content
Snippets Groups Projects
Commit f2012bca authored by hjk's avatar hjk
Browse files

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