diff options
author | hjk <hjk@qt.io> | 2019-03-11 15:42:43 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-03-12 12:27:35 +0000 |
commit | 9ef0b97716e4ed73187470bc574a9c2a550d8901 (patch) | |
tree | ad89a72d5947f14ac3342aed65961f31d7736169 | |
parent | 582f72f433c0b68ada35d0d2912f4c21146f17d7 (diff) |
Avoid some visible uses of RunControl::runConfiguration()
For a long time, probably from the very beginning, a RunControl
was meant to hold (a copy of) data needed for its operation, that was
valid at the time of its construction, to be resilient in cases
where RunConfiguration setting were changed while the RunControl
was running, or to properly re-run with the original settings.
Unfortunately, the task was repetitive, as RunConfiguration
classes had no generic access to properties / "aspects"
and there was was the runConfiguration() accessor (probably
for mostly unrelated reasons in the output pane handling) which
made the idea of just casting that to the original runConfiguration
and access the data directly there appealing, with all the
expected consequences.
This patch here partially addresses the issue by copying some
more of the related data at RunControl construction time and
adjust the using code, avoiding most uses of the runConfiguration()
accessor in a mostly mechanical matter.
Complete removal appears possible, but will be less mechanical
in "difficult" plugins like ios, so this is left for later.
The new accessors in RunControl are very much ad-hoc, leaving
room for improvement, e.g. by consolidating the access to the
run config settings aspects with the other runconfig aspects
or similar. For now the goal is to remove the runConfiguration()
accessor, and to as much as possible fixed data after RunControl
setup is finished.
Next step would be to officially allow construction of RunControls
without a specific RunConfiguration by setting the necessary
data independently, removing the need for the various workarounds
that are currently used for the purpose of faking (parts of) the
effect of the non-existing RunConfiguration or refusing to operate
at all, even if it would be possible.
Change-Id: If8e5596da8422c70e90f97270389adbe6d0b46f2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/plugins/android/androiddebugsupport.cpp | 6 | ||||
-rw-r--r-- | src/plugins/android/androidrunner.cpp | 2 | ||||
-rw-r--r-- | src/plugins/android/androidrunnerworker.cpp | 16 | ||||
-rw-r--r-- | src/plugins/baremetal/baremetaldebugsupport.cpp | 10 | ||||
-rw-r--r-- | src/plugins/ios/iosrunner.cpp | 13 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfdatareader.cpp | 9 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfdatareader.h | 9 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilerruncontrol.cpp | 5 | ||||
-rw-r--r-- | src/plugins/projectexplorer/runconfiguration.cpp | 34 | ||||
-rw-r--r-- | src/plugins/projectexplorer/runconfiguration.h | 9 | ||||
-rw-r--r-- | src/plugins/qmlpreview/qmlpreviewruncontrol.cpp | 5 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp | 3 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilertool.cpp | 2 | ||||
-rw-r--r-- | src/plugins/qnx/qnxdebugsupport.cpp | 5 | ||||
-rw-r--r-- | src/plugins/qnx/slog2inforunner.cpp | 2 | ||||
-rw-r--r-- | src/plugins/valgrind/valgrindengine.cpp | 2 | ||||
-rw-r--r-- | src/plugins/winrt/winrtdebugsupport.cpp | 2 | ||||
-rw-r--r-- | src/plugins/winrt/winrtrunnerhelper.cpp | 19 |
18 files changed, 86 insertions, 67 deletions
diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 045e9d3e83d..1fe3a05de1e 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -150,8 +150,7 @@ AndroidDebugSupport::AndroidDebugSupport(RunControl *runControl, const QString & void AndroidDebugSupport::start() { - auto runConfig = runControl()->runConfiguration(); - Target *target = runConfig->target(); + Target *target = runControl()->target(); Kit *kit = target->kit(); setStartMode(AttachToRemoteServer); @@ -172,6 +171,7 @@ void AndroidDebugSupport::start() if (isCppDebugging()) { qCDebug(androidDebugSupportLog) << "C++ debugging enabled"; + auto runConfig = runControl()->runConfiguration(); QStringList solibSearchPath = getSoLibSearchPath(runConfig); QStringList extraLibs = getExtraLibs(runConfig); solibSearchPath.append(qtSoPaths(qtVersion)); @@ -191,7 +191,7 @@ void AndroidDebugSupport::start() QTC_CHECK(qt); const int minimumNdk = qt ? qt->minimumNDK() : 0; - int sdkVersion = qMax(AndroidManager::minimumSDK(target->kit()), minimumNdk); + int sdkVersion = qMax(AndroidManager::minimumSDK(kit), minimumNdk); Utils::FileName sysRoot = AndroidConfigurations::currentConfig().ndkLocation() .appendPath("platforms") .appendPath(QString("android-%1").arg(sdkVersion)) diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp index f20f834c60b..24ac13a4f10 100644 --- a/src/plugins/android/androidrunner.cpp +++ b/src/plugins/android/androidrunner.cpp @@ -119,7 +119,7 @@ namespace Android { namespace Internal { AndroidRunner::AndroidRunner(RunControl *runControl, const QString &intentName) - : RunWorker(runControl), m_target(runControl->runConfiguration()->target()) + : RunWorker(runControl), m_target(runControl->target()) { setId("AndroidRunner"); static const int metaTypes[] = { diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 4b119642ec5..3a882505dac 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -163,8 +163,8 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa , m_jdbProcess(nullptr, deleter) { - auto runConfig = runner->runControl()->runConfiguration(); - auto aspect = runConfig->aspect<Debugger::DebuggerRunConfigurationAspect>(); + auto runControl = runner->runControl(); + auto aspect = runControl->aspect<Debugger::DebuggerRunConfigurationAspect>(); Core::Id runMode = runner->runMode(); const bool debuggingMode = runMode == ProjectExplorer::Constants::DEBUG_RUN_MODE; m_useCppDebugger = debuggingMode && aspect->useCppDebugger(); @@ -191,27 +191,27 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa m_localJdbServerPort = Utils::Port(5038); QTC_CHECK(m_localJdbServerPort.isValid()); - auto target = runConfig->target(); + auto target = runControl->target(); m_deviceSerialNumber = AndroidManager::deviceSerialNumber(target); m_apiLevel = AndroidManager::deviceApiLevel(target); - m_extraEnvVars = runConfig->aspect<EnvironmentAspect>()->environment(); + m_extraEnvVars = runControl->aspect<EnvironmentAspect>()->environment(); qCDebug(androidRunWorkerLog) << "Environment variables for the app" << m_extraEnvVars.toStringList(); - m_extraAppParams = runConfig->runnable().commandLineArguments; + m_extraAppParams = runControl->runnable().commandLineArguments; - if (auto aspect = runConfig->aspect(Constants::ANDROID_AMSTARTARGS)) + if (auto aspect = runControl->aspect(Constants::ANDROID_AMSTARTARGS)) m_amStartExtraArgs = static_cast<BaseStringAspect *>(aspect)->value().split(' '); - if (auto aspect = runConfig->aspect(Constants::ANDROID_PRESTARTSHELLCMDLIST)) { + if (auto aspect = runControl->aspect(Constants::ANDROID_PRESTARTSHELLCMDLIST)) { for (const QString &shellCmd : static_cast<BaseStringListAspect *>(aspect)->value()) m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd)); } for (const QString &shellCmd : runner->recordedData(Constants::ANDROID_PRESTARTSHELLCMDLIST).toStringList()) m_beforeStartAdbCommands.append(QString("shell %1").arg(shellCmd)); - if (auto aspect = runConfig->aspect(Constants::ANDROID_POSTFINISHSHELLCMDLIST)) { + if (auto aspect = runControl->aspect(Constants::ANDROID_POSTFINISHSHELLCMDLIST)) { for (const QString &shellCmd : static_cast<BaseStringListAspect *>(aspect)->value()) m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd)); } diff --git a/src/plugins/baremetal/baremetaldebugsupport.cpp b/src/plugins/baremetal/baremetaldebugsupport.cpp index ab8783a446e..2c23dba31f6 100644 --- a/src/plugins/baremetal/baremetaldebugsupport.cpp +++ b/src/plugins/baremetal/baremetaldebugsupport.cpp @@ -83,9 +83,7 @@ BareMetalDebugSupport::BareMetalDebugSupport(RunControl *runControl) void BareMetalDebugSupport::start() { - const auto rc = runControl()->runConfiguration(); - QTC_ASSERT(rc, reportFailure(); return); - const auto exeAspect = rc->aspect<ExecutableAspect>(); + const auto exeAspect = runControl()->aspect<ExecutableAspect>(); QTC_ASSERT(exeAspect, reportFailure(); return); const QString bin = exeAspect->executable().toString(); @@ -98,7 +96,7 @@ void BareMetalDebugSupport::start() return; } - const Target *target = rc->target(); + const Target *target = runControl()->target(); QTC_ASSERT(target, reportFailure(); return); auto dev = qSharedPointerCast<const BareMetalDevice>(device()); @@ -124,8 +122,10 @@ void BareMetalDebugSupport::start() Runnable inferior; inferior.executable = bin; - if (auto aspect = rc->aspect<ArgumentsAspect>()) + if (auto aspect = runControl()->aspect<ArgumentsAspect>()) { + const auto rc = runControl()->runConfiguration(); inferior.commandLineArguments = aspect->arguments(rc->macroExpander()); + } setInferior(inferior); setSymbolFile(bin); setStartMode(AttachToRemoteServer); diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 5b3a21d1367..10b5f5d073c 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -79,8 +79,7 @@ static void stopRunningRunControl(RunControl *runControl) { static QMap<Core::Id, QPointer<RunControl>> activeRunControls; - RunConfiguration *runConfig = runControl->runConfiguration(); - Target *target = runConfig->target(); + Target *target = runControl->target(); Core::Id devId = DeviceKitAspect::deviceId(target->kit()); // The device can only run an application at a time, if an app is running stop it. @@ -100,8 +99,8 @@ IosRunner::IosRunner(RunControl *runControl) stopRunningRunControl(runControl); auto runConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration()); m_bundleDir = runConfig->bundleDirectory().toString(); - m_arguments = runConfig->aspect<ArgumentsAspect>()->arguments(runConfig->macroExpander()); - m_device = DeviceKitAspect::device(runConfig->target()->kit()); + m_arguments = runControl->aspect<ArgumentsAspect>()->arguments(runConfig->macroExpander()); + m_device = DeviceKitAspect::device(runControl->target()->kit()); m_deviceType = runConfig->deviceType(); } @@ -387,7 +386,7 @@ IosQmlProfilerSupport::IosQmlProfilerSupport(RunControl *runControl) Runnable runnable; runnable.executable = iosRunConfig->localExecutable().toUserOutput(); runnable.commandLineArguments = - iosRunConfig->aspect<ArgumentsAspect>()->arguments(iosRunConfig->macroExpander()); + runControl->aspect<ArgumentsAspect>()->arguments(iosRunConfig->macroExpander()); runControl->setDisplayName(iosRunConfig->applicationName()); runControl->setRunnable(runnable); @@ -438,8 +437,6 @@ void IosDebugSupport::start() return; } - RunConfiguration *runConfig = runControl()->runConfiguration(); - if (device()->type() == Ios::Constants::IOS_DEVICE_TYPE) { IosDevice::ConstPtr dev = device().dynamicCast<const IosDevice>(); setStartMode(AttachToRemoteProcess); @@ -472,7 +469,7 @@ void IosDebugSupport::start() setIosPlatform("ios-simulator"); } - auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runConfig); + auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runControl()->runConfiguration()); setRunControlName(iosRunConfig->applicationName()); setContinueAfterAttach(true); diff --git a/src/plugins/perfprofiler/perfdatareader.cpp b/src/plugins/perfprofiler/perfdatareader.cpp index 795a6974d34..c299f4e3917 100644 --- a/src/plugins/perfprofiler/perfdatareader.cpp +++ b/src/plugins/perfprofiler/perfdatareader.cpp @@ -34,12 +34,15 @@ #include <coreplugin/messagemanager.h> #include <coreplugin/progressmanager/futureprogress.h> #include <coreplugin/progressmanager/progressmanager.h> + #include <projectexplorer/buildconfiguration.h> #include <projectexplorer/kitinformation.h> #include <projectexplorer/project.h> #include <projectexplorer/runconfiguration.h> #include <projectexplorer/session.h> +#include <projectexplorer/target.h> #include <projectexplorer/toolchain.h> + #include <qtsupport/qtkitinformation.h> #include <utils/qtcassert.h> @@ -392,11 +395,11 @@ bool PerfDataReader::feedParser(const QByteArray &input) return true; } -QStringList PerfDataReader::findTargetArguments(const ProjectExplorer::RunConfiguration *rc) const +QStringList PerfDataReader::findTargetArguments(const ProjectExplorer::RunControl *runControl) const { - ProjectExplorer::Kit *kit = rc->target()->kit(); + ProjectExplorer::Kit *kit = runControl->kit(); QTC_ASSERT(kit, return QStringList()); - ProjectExplorer::BuildConfiguration *buildConfig = rc->target()->activeBuildConfiguration(); + ProjectExplorer::BuildConfiguration *buildConfig = runControl->target()->activeBuildConfiguration(); QString buildDir = buildConfig ? buildConfig->buildDirectory().toString() : QString(); return collectArguments(buildDir, kit); } diff --git a/src/plugins/perfprofiler/perfdatareader.h b/src/plugins/perfprofiler/perfdatareader.h index 8f30fa28d78..a6fbc5fe6b4 100644 --- a/src/plugins/perfprofiler/perfdatareader.h +++ b/src/plugins/perfprofiler/perfdatareader.h @@ -28,13 +28,16 @@ #include "perfprofilertracefile.h" #include "perftimelinemodelmanager.h" -#include <projectexplorer/target.h> - #include <utils/temporaryfile.h> #include <QProcess> #include <QQueue> +namespace ProjectExplorer { +class Kit; +class RunControl; +} // ProjectExplorer + namespace PerfProfiler { namespace Internal { @@ -51,7 +54,7 @@ public: void startParser(); void stopParser(); - QStringList findTargetArguments(const ProjectExplorer::RunConfiguration *rc) const; + QStringList findTargetArguments(const ProjectExplorer::RunControl *runControl) const; void clear(); bool feedParser(const QByteArray &input); diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp index 50aa9696a11..6f521c306a5 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp @@ -84,7 +84,7 @@ public: void start() override { - QStringList args = m_reader.findTargetArguments(runControl()->runConfiguration()); + QStringList args = m_reader.findTargetArguments(runControl()); QUrl url = runControl()->property("PerfConnection").toUrl(); if (url.isValid()) { args.append(QStringList{"--host", url.host(), "--port", QString::number(url.port())}); @@ -116,8 +116,7 @@ public: { setId("LocalPerfRecordWorker"); - auto runConfig = runControl->runConfiguration(); - auto perfAspect = static_cast<PerfRunConfigurationAspect *>(runConfig->aspect(Constants::PerfSettingsId)); + auto perfAspect = static_cast<PerfRunConfigurationAspect *>(runControl->aspect(Constants::PerfSettingsId)); QTC_ASSERT(perfAspect, return); PerfSettings *settings = static_cast<PerfSettings *>(perfAspect->currentSettings()); QTC_ASSERT(settings, return); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 7922a069bec..9f0080efa47 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -808,9 +808,9 @@ public: displayName = runConfiguration->displayName(); outputFormatter = runConfiguration->createOutputFormatter(); device = runnable.device; + target = runConfiguration->target(); if (!device) - device = DeviceKitAspect::device(runConfiguration->target()->kit()); - project = runConfiguration->target()->project(); + device = DeviceKitAspect::device(target->kit()); } else { outputFormatter = new OutputFormatter(); } @@ -857,7 +857,7 @@ public: Core::Id runMode; Utils::Icon icon; const QPointer<RunConfiguration> runConfiguration; // Not owned. - QPointer<Project> project; // Not owned. + QPointer<Target> target; // Not owned. QPointer<Utils::OutputFormatter> outputFormatter = nullptr; std::function<bool(bool*)> promptToStop; std::vector<RunWorkerFactory> m_factories; @@ -1357,9 +1357,29 @@ RunConfiguration *RunControl::runConfiguration() const return d->runConfiguration.data(); } +Target *RunControl::target() const +{ + return d->target; +} + Project *RunControl::project() const { - return d->project.data(); + return d->target->project(); +} + +Kit *RunControl::kit() const +{ + return d->target->kit(); +} + +ProjectConfigurationAspect *RunControl::aspect(Core::Id id) const +{ + return d->runConfiguration->aspect(id); +} + +BuildTargetInfo RunControl::buildTargetInfo() const +{ + return d->runConfiguration->buildTargetInfo(); } /*! @@ -1556,10 +1576,8 @@ SimpleTargetRunner::SimpleTargetRunner(RunControl *runControl) setId("SimpleTargetRunner"); m_runnable = runControl->runnable(); // Default value. Can be overridden using setRunnable. m_device = runControl->device(); // Default value. Can be overridden using setDevice. - if (auto runConfig = runControl->runConfiguration()) { - if (auto terminalAspect = runConfig->aspect<TerminalAspect>()) - m_useTerminal = terminalAspect->useTerminal(); - } + if (auto terminalAspect = runControl->aspect<TerminalAspect>()) + m_useTerminal = terminalAspect->useTerminal(); } void SimpleTargetRunner::start() diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index bde49f99f4a..6abb254a997 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -442,8 +442,15 @@ public: void setApplicationProcessHandle(const Utils::ProcessHandle &handle); IDevice::ConstPtr device() const; - RunConfiguration *runConfiguration() const; + RunConfiguration *runConfiguration() const; // FIXME: Remove. + // FIXME: Try to cut down to amount of functions. + Target *target() const; Project *project() const; + Kit *kit() const; + ProjectConfigurationAspect *aspect(Core::Id id) const; + template <typename T> T *aspect() const { return runConfiguration()->aspect<T>(); } + QString buildKey() const; + BuildTargetInfo buildTargetInfo() const; Utils::OutputFormatter *outputFormatter() const; Core::Id runMode() const; diff --git a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp index c54208f2eeb..6d540c184b6 100644 --- a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp +++ b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp @@ -90,10 +90,7 @@ QmlPreviewRunner::QmlPreviewRunner(ProjectExplorer::RunControl *runControl, void QmlPreviewRunner::start() { - ProjectExplorer::Target *target = nullptr; - if (ProjectExplorer::RunConfiguration *config = runControl()->runConfiguration()) - target = config->target(); - m_connectionManager->setTarget(target); + m_connectionManager->setTarget(runControl()->target()); m_connectionManager->connectToServer(serverUrl()); reportStarted(); } diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp index 09f3945cbea..c9cc305d750 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp @@ -204,8 +204,7 @@ QUrl QmlProfilerRunner::serverUrl() const static QUrl localServerUrl(RunControl *runControl) { QUrl serverUrl; - RunConfiguration *runConfiguration = runControl->runConfiguration(); - Kit *kit = runConfiguration->target()->kit(); + Kit *kit = runControl->kit(); const QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(kit); if (version) { if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0)) diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 20798fd8c3a..3f01a55d9c4 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -303,7 +303,7 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker) auto runConfiguration = runControl->runConfiguration(); if (runConfiguration) { auto aspect = static_cast<QmlProfilerRunConfigurationAspect *>( - runConfiguration->aspect(Constants::SETTINGS)); + runControl->aspect(Constants::SETTINGS)); if (aspect) { if (auto settings = static_cast<const QmlProfilerSettings *>(aspect->currentSettings())) { d->m_profilerConnections->setFlushInterval(settings->flushEnabled() ? diff --git a/src/plugins/qnx/qnxdebugsupport.cpp b/src/plugins/qnx/qnxdebugsupport.cpp index 2eeda6db6f7..883cb01325c 100644 --- a/src/plugins/qnx/qnxdebugsupport.cpp +++ b/src/plugins/qnx/qnxdebugsupport.cpp @@ -148,10 +148,7 @@ QnxDebugSupport::QnxDebugSupport(RunControl *runControl) addStartDependency(debuggeeRunner); - auto runConfig = qobject_cast<QnxRunConfiguration *>(runControl->runConfiguration()); - QTC_ASSERT(runConfig, return); - Target *target = runConfig->target(); - Kit *k = target->kit(); + Kit *k = runControl->kit(); setStartMode(AttachToRemoteServer); setCloseMode(KillAtClose); diff --git a/src/plugins/qnx/slog2inforunner.cpp b/src/plugins/qnx/slog2inforunner.cpp index 113d589a3c9..aec6d74a6fa 100644 --- a/src/plugins/qnx/slog2inforunner.cpp +++ b/src/plugins/qnx/slog2inforunner.cpp @@ -45,7 +45,7 @@ Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl) : RunWorker(runControl) { setId("Slog2InfoRunner"); - m_applicationId = runControl->runConfiguration()->aspect<ExecutableAspect>()->executable().fileName(); + m_applicationId = runControl->aspect<ExecutableAspect>()->executable().fileName(); // See QTCREATORBUG-10712 for details. // We need to limit length of ApplicationId to 63 otherwise it would not match one in slog2info. diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp index 3aa2f78eacf..b3d991fc269 100644 --- a/src/plugins/valgrind/valgrindengine.cpp +++ b/src/plugins/valgrind/valgrindengine.cpp @@ -86,7 +86,7 @@ void ValgrindToolRunner::start() m_runner.setDevice(device()); m_runner.setDebuggee(runnable()); - if (auto aspect = runControl()->runConfiguration()->aspect<TerminalAspect>()) + if (auto aspect = runControl()->aspect<TerminalAspect>()) m_runner.setUseTerminal(aspect->useTerminal()); connect(&m_runner, &ValgrindRunner::processOutputReceived, diff --git a/src/plugins/winrt/winrtdebugsupport.cpp b/src/plugins/winrt/winrtdebugsupport.cpp index f7962c4ef05..d7f3e9a59bb 100644 --- a/src/plugins/winrt/winrtdebugsupport.cpp +++ b/src/plugins/winrt/winrtdebugsupport.cpp @@ -75,7 +75,7 @@ WinRtDebugSupport::WinRtDebugSupport(RunControl *runControl) setQmlServer(qmlServer); } - setSymbolFile(runControl->runConfiguration()->buildTargetInfo().targetFilePath.toString()); + setSymbolFile(runControl->buildTargetInfo().targetFilePath.toString()); QString errorMessage; m_runner = new WinRtRunnerHelper(this, &errorMessage); if (!errorMessage.isEmpty()) { diff --git a/src/plugins/winrt/winrtrunnerhelper.cpp b/src/plugins/winrt/winrtrunnerhelper.cpp index 491abfc57fb..b5b10b06000 100644 --- a/src/plugins/winrt/winrtrunnerhelper.cpp +++ b/src/plugins/winrt/winrtrunnerhelper.cpp @@ -50,12 +50,11 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr : QObject(runWorker) , m_worker(runWorker) { - auto runConfiguration = runWorker->runControl()->runConfiguration(); + auto runControl = runWorker->runControl(); - ProjectExplorer::Target *target = runConfiguration->target(); m_device = runWorker->device().dynamicCast<const WinRtDevice>(); - const QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit()); + const QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(runControl->kit()); if (!qt) { *errorMessage = tr("The current kit has no Qt version."); return; @@ -68,7 +67,7 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr return; } - const BuildTargetInfo bti = runConfiguration->buildTargetInfo(); + const BuildTargetInfo bti = runControl->buildTargetInfo(); m_executableFilePath = bti.targetFilePath.toString(); if (m_executableFilePath.isEmpty()) { @@ -84,13 +83,13 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr bool loopbackExemptClient = false; bool loopbackExemptServer = false; - if (auto aspect = runConfiguration->aspect<ArgumentsAspect>()) - m_arguments = aspect->arguments(runConfiguration->macroExpander()); - if (auto aspect = runConfiguration->aspect<UninstallAfterStopAspect>()) + if (auto aspect = runControl->aspect<ArgumentsAspect>()) + m_arguments = aspect->arguments(runControl->runConfiguration()->macroExpander()); + if (auto aspect = runControl->aspect<UninstallAfterStopAspect>()) m_uninstallAfterStop = aspect->value(); - if (auto aspect = runConfiguration->aspect<LoopbackExemptClientAspect>()) + if (auto aspect = runControl->aspect<LoopbackExemptClientAspect>()) loopbackExemptClient = aspect->value(); - if (auto aspect = runConfiguration->aspect<LoopbackExemptServerAspect>()) + if (auto aspect = runControl->aspect<LoopbackExemptServerAspect>()) loopbackExemptServer = aspect->value(); if (loopbackExemptClient && loopbackExemptServer) m_loopbackArguments = "--loopbackexempt clientserver"; @@ -99,7 +98,7 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr else if (loopbackExemptServer) m_loopbackArguments = "--loopbackexempt server"; - if (ProjectExplorer::BuildConfiguration *bc = target->activeBuildConfiguration()) + if (BuildConfiguration *bc = runControl->target()->activeBuildConfiguration()) m_environment = bc->environment(); } |