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: hjk <hjk@theqtcompany.com>
This commit is contained in:
hjk
2016-01-27 14:07:23 +01:00
parent 06a99af0f6
commit f2012bca8f
6 changed files with 1 additions and 31 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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();

View File

@@ -85,7 +85,6 @@ bool ValgrindRunControl::startEngine()
StandardRunnable debuggee = runnable();
// FIXME: Consolidate:
debuggee.workingDirectory = workingDirectory();
debuggee.environment = m_environment;
debuggee.runMode = m_localRunMode;

View File

@@ -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);
});

View File

@@ -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;
}