forked from qt-creator/qt-creator
ProjectExplorer: Rename 'extraAspect' to 'aspect'
Using aspects is the standard pattern nowadays, there's nothing 'extra' to them anymore. Change-Id: I446f9d7b1db58a4899e5e44df33ce51f655e7be4 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -162,7 +162,7 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa
|
||||
|
||||
{
|
||||
auto runConfig = runner->runControl()->runConfiguration();
|
||||
auto aspect = runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
|
||||
auto aspect = runConfig->aspect<Debugger::DebuggerRunConfigurationAspect>();
|
||||
Core::Id runMode = runner->runMode();
|
||||
const bool debuggingMode = runMode == ProjectExplorer::Constants::DEBUG_RUN_MODE;
|
||||
m_useCppDebugger = debuggingMode && aspect->useCppDebugger();
|
||||
@@ -194,23 +194,23 @@ AndroidRunnerWorker::AndroidRunnerWorker(RunWorker *runner, const QString &packa
|
||||
m_deviceSerialNumber = AndroidManager::deviceSerialNumber(target);
|
||||
m_apiLevel = AndroidManager::deviceApiLevel(target);
|
||||
|
||||
m_extraEnvVars = runConfig->extraAspect<EnvironmentAspect>()->environment();
|
||||
m_extraEnvVars = runConfig->aspect<EnvironmentAspect>()->environment();
|
||||
qCDebug(androidRunWorkerLog) << "Environment variables for the app"
|
||||
<< m_extraEnvVars.toStringList();
|
||||
|
||||
m_extraAppParams = runConfig->runnable().commandLineArguments;
|
||||
|
||||
if (auto aspect = runConfig->extraAspect(Constants::ANDROID_AMSTARTARGS))
|
||||
if (auto aspect = runConfig->aspect(Constants::ANDROID_AMSTARTARGS))
|
||||
m_amStartExtraArgs = static_cast<BaseStringAspect *>(aspect)->value().split(' ');
|
||||
|
||||
if (auto aspect = runConfig->extraAspect(Constants::ANDROID_PRESTARTSHELLCMDLIST)) {
|
||||
if (auto aspect = runConfig->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->extraAspect(Constants::ANDROID_POSTFINISHSHELLCMDLIST)) {
|
||||
if (auto aspect = runConfig->aspect(Constants::ANDROID_POSTFINISHSHELLCMDLIST)) {
|
||||
for (const QString &shellCmd : static_cast<BaseStringListAspect *>(aspect)->value())
|
||||
m_afterFinishAdbCommands.append(QString("shell %1").arg(shellCmd));
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ public:
|
||||
if (auto debuggable = dynamic_cast<DebuggableTestConfiguration *>(config))
|
||||
enableQuick = debuggable->mixedDebugging();
|
||||
|
||||
if (auto debugAspect = extraAspect<Debugger::DebuggerRunConfigurationAspect>()) {
|
||||
if (auto debugAspect = aspect<Debugger::DebuggerRunConfigurationAspect>()) {
|
||||
debugAspect->setUseQmlDebugger(enableQuick);
|
||||
ProjectExplorer::ProjectExplorerPlugin::instance()->updateRunActions();
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ const char *BareMetalCustomRunConfiguration::Id = "BareMetal";
|
||||
|
||||
bool BareMetalCustomRunConfiguration::isConfigured() const
|
||||
{
|
||||
return !extraAspect<ExecutableAspect>()->executable().isEmpty();
|
||||
return !aspect<ExecutableAspect>()->executable().isEmpty();
|
||||
}
|
||||
|
||||
RunConfiguration::ConfigurationState
|
||||
|
@@ -85,7 +85,7 @@ void BareMetalDebugSupport::start()
|
||||
{
|
||||
const auto rc = runControl()->runConfiguration();
|
||||
QTC_ASSERT(rc, reportFailure(); return);
|
||||
const auto exeAspect = rc->extraAspect<ExecutableAspect>();
|
||||
const auto exeAspect = rc->aspect<ExecutableAspect>();
|
||||
QTC_ASSERT(exeAspect, reportFailure(); return);
|
||||
|
||||
const QString bin = exeAspect->executable().toString();
|
||||
@@ -124,7 +124,7 @@ void BareMetalDebugSupport::start()
|
||||
|
||||
Runnable inferior;
|
||||
inferior.executable = bin;
|
||||
if (auto aspect = rc->extraAspect<ArgumentsAspect>())
|
||||
if (auto aspect = rc->aspect<ArgumentsAspect>())
|
||||
inferior.commandLineArguments = aspect->arguments(rc->macroExpander());
|
||||
setInferior(inferior);
|
||||
setSymbolFile(bin);
|
||||
|
@@ -63,7 +63,7 @@ BareMetalRunConfiguration::BareMetalRunConfiguration(Target *target, Core::Id id
|
||||
void BareMetalRunConfiguration::updateTargetInformation()
|
||||
{
|
||||
const BuildTargetInfo bti = target()->applicationTargets().buildTargetInfo(buildKey());
|
||||
extraAspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
||||
aspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
||||
emit enabledChanged();
|
||||
}
|
||||
|
||||
|
@@ -98,11 +98,11 @@ QString CMakeRunConfiguration::disabledReason() const
|
||||
void CMakeRunConfiguration::updateTargetInformation()
|
||||
{
|
||||
BuildTargetInfo bti = target()->applicationTargets().buildTargetInfo(buildKey());
|
||||
extraAspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
||||
extraAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.workingDirectory);
|
||||
extraAspect<LocalEnvironmentAspect>()->buildEnvironmentHasChanged();
|
||||
aspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
||||
aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.workingDirectory);
|
||||
aspect<LocalEnvironmentAspect>()->buildEnvironmentHasChanged();
|
||||
|
||||
auto terminalAspect = extraAspect<TerminalAspect>();
|
||||
auto terminalAspect = aspect<TerminalAspect>();
|
||||
if (!terminalAspect->isUserSet())
|
||||
terminalAspect->setUseTerminal(bti.usesTerminal);
|
||||
}
|
||||
|
@@ -906,9 +906,9 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, Kit *kit, bool allowTer
|
||||
|
||||
if (runConfig) {
|
||||
m_runParameters.displayName = runConfig->displayName();
|
||||
if (auto symbolsAspect = runConfig->extraAspect<SymbolFileAspect>())
|
||||
if (auto symbolsAspect = runConfig->aspect<SymbolFileAspect>())
|
||||
m_runParameters.symbolFile = symbolsAspect->value();
|
||||
if (auto terminalAspect = runConfig->extraAspect<TerminalAspect>())
|
||||
if (auto terminalAspect = runConfig->aspect<TerminalAspect>())
|
||||
m_runParameters.useTerminal = terminalAspect->useTerminal();
|
||||
}
|
||||
|
||||
@@ -924,7 +924,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, Kit *kit, bool allowTer
|
||||
if (QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(kit))
|
||||
m_runParameters.qtPackageSourceLocation = qtVersion->qtPackageSourcePath().toString();
|
||||
|
||||
if (auto aspect = runConfig ? runConfig->extraAspect<DebuggerRunConfigurationAspect>() : nullptr) {
|
||||
if (auto aspect = runConfig ? runConfig->aspect<DebuggerRunConfigurationAspect>() : nullptr) {
|
||||
if (!aspect->useCppDebugger())
|
||||
m_runParameters.cppEngineType = NoEngineType;
|
||||
m_runParameters.isQmlDebugging = aspect->useQmlDebugger();
|
||||
|
@@ -139,7 +139,7 @@ void IosRunConfiguration::updateDisplayNames()
|
||||
setDefaultDisplayName(tr("Run on %1").arg(devName));
|
||||
setDisplayName(tr("Run %1 on %2").arg(applicationName()).arg(devName));
|
||||
|
||||
extraAspect<ExecutableAspect>()->setExecutable(localExecutable());
|
||||
aspect<ExecutableAspect>()->setExecutable(localExecutable());
|
||||
}
|
||||
|
||||
void IosRunConfiguration::updateEnabledState()
|
||||
|
@@ -100,7 +100,7 @@ IosRunner::IosRunner(RunControl *runControl)
|
||||
stopRunningRunControl(runControl);
|
||||
auto runConfig = qobject_cast<IosRunConfiguration *>(runControl->runConfiguration());
|
||||
m_bundleDir = runConfig->bundleDirectory().toString();
|
||||
m_arguments = runConfig->extraAspect<ArgumentsAspect>()->arguments(runConfig->macroExpander());
|
||||
m_arguments = runConfig->aspect<ArgumentsAspect>()->arguments(runConfig->macroExpander());
|
||||
m_device = DeviceKitInformation::device(runConfig->target()->kit());
|
||||
m_deviceType = runConfig->deviceType();
|
||||
}
|
||||
@@ -387,7 +387,7 @@ IosQmlProfilerSupport::IosQmlProfilerSupport(RunControl *runControl)
|
||||
Runnable runnable;
|
||||
runnable.executable = iosRunConfig->localExecutable().toUserOutput();
|
||||
runnable.commandLineArguments =
|
||||
iosRunConfig->extraAspect<ArgumentsAspect>()->arguments(iosRunConfig->macroExpander());
|
||||
iosRunConfig->aspect<ArgumentsAspect>()->arguments(iosRunConfig->macroExpander());
|
||||
runControl->setDisplayName(iosRunConfig->applicationName());
|
||||
runControl->setRunnable(runnable);
|
||||
|
||||
|
@@ -67,9 +67,9 @@ void NimRunConfiguration::updateConfiguration()
|
||||
QTC_ASSERT(buildConfiguration, return);
|
||||
setActiveBuildConfiguration(buildConfiguration);
|
||||
const QFileInfo outFileInfo = buildConfiguration->outFilePath().toFileInfo();
|
||||
extraAspect<ExecutableAspect>()->setExecutable(FileName::fromString(outFileInfo.absoluteFilePath()));
|
||||
aspect<ExecutableAspect>()->setExecutable(FileName::fromString(outFileInfo.absoluteFilePath()));
|
||||
const QString workingDirectory = outFileInfo.absoluteDir().absolutePath();
|
||||
extraAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(FileName::fromString(workingDirectory));
|
||||
aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(FileName::fromString(workingDirectory));
|
||||
}
|
||||
|
||||
void NimRunConfiguration::setActiveBuildConfiguration(NimBuildConfiguration *activeBuildConfiguration)
|
||||
|
@@ -94,7 +94,7 @@ private:
|
||||
CustomExecutableDialog::CustomExecutableDialog(RunConfiguration *rc)
|
||||
: QDialog(Core::ICore::dialogParent()),
|
||||
m_rc(rc),
|
||||
m_workingDirectory(rc->extraAspect<EnvironmentAspect>())
|
||||
m_workingDirectory(rc->aspect<EnvironmentAspect>())
|
||||
{
|
||||
auto vbox = new QVBoxLayout(this);
|
||||
vbox->addWidget(new QLabel(tr("Could not find the executable, please specify one.")));
|
||||
@@ -121,21 +121,21 @@ CustomExecutableDialog::CustomExecutableDialog(RunConfiguration *rc)
|
||||
m_executableChooser = new PathChooser(this);
|
||||
m_executableChooser->setHistoryCompleter("Qt.CustomExecutable.History");
|
||||
m_executableChooser->setExpectedKind(PathChooser::ExistingCommand);
|
||||
m_executableChooser->setPath(rc->extraAspect<ExecutableAspect>()->executable().toString());
|
||||
m_executableChooser->setPath(rc->aspect<ExecutableAspect>()->executable().toString());
|
||||
layout->addRow(tr("Executable:"), m_executableChooser);
|
||||
connect(m_executableChooser, &PathChooser::rawPathChanged,
|
||||
this, &CustomExecutableDialog::changed);
|
||||
|
||||
copyAspect(rc->extraAspect<ArgumentsAspect>(), &m_arguments);
|
||||
copyAspect(rc->aspect<ArgumentsAspect>(), &m_arguments);
|
||||
m_arguments.addToConfigurationLayout(layout);
|
||||
|
||||
copyAspect(rc->extraAspect<WorkingDirectoryAspect>(), &m_workingDirectory);
|
||||
copyAspect(rc->aspect<WorkingDirectoryAspect>(), &m_workingDirectory);
|
||||
m_workingDirectory.addToConfigurationLayout(layout);
|
||||
|
||||
copyAspect(rc->extraAspect<TerminalAspect>(), &m_terminal);
|
||||
copyAspect(rc->aspect<TerminalAspect>(), &m_terminal);
|
||||
m_terminal.addToConfigurationLayout(layout);
|
||||
|
||||
auto enviromentAspect = rc->extraAspect<EnvironmentAspect>();
|
||||
auto enviromentAspect = rc->aspect<EnvironmentAspect>();
|
||||
connect(enviromentAspect, &EnvironmentAspect::environmentChanged,
|
||||
this, &CustomExecutableDialog::environmentWasChanged);
|
||||
environmentWasChanged();
|
||||
@@ -146,10 +146,10 @@ CustomExecutableDialog::CustomExecutableDialog(RunConfiguration *rc)
|
||||
void CustomExecutableDialog::accept()
|
||||
{
|
||||
auto executable = FileName::fromString(m_executableChooser->path());
|
||||
m_rc->extraAspect<ExecutableAspect>()->setExecutable(executable);
|
||||
copyAspect(&m_arguments, m_rc->extraAspect<ArgumentsAspect>());
|
||||
copyAspect(&m_workingDirectory, m_rc->extraAspect<WorkingDirectoryAspect>());
|
||||
copyAspect(&m_terminal, m_rc->extraAspect<TerminalAspect>());
|
||||
m_rc->aspect<ExecutableAspect>()->setExecutable(executable);
|
||||
copyAspect(&m_arguments, m_rc->aspect<ArgumentsAspect>());
|
||||
copyAspect(&m_workingDirectory, m_rc->aspect<WorkingDirectoryAspect>());
|
||||
copyAspect(&m_terminal, m_rc->aspect<TerminalAspect>());
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
@@ -168,7 +168,7 @@ bool CustomExecutableDialog::event(QEvent *event)
|
||||
|
||||
void CustomExecutableDialog::environmentWasChanged()
|
||||
{
|
||||
auto aspect = m_rc->extraAspect<EnvironmentAspect>();
|
||||
auto aspect = m_rc->aspect<EnvironmentAspect>();
|
||||
QTC_ASSERT(aspect, return);
|
||||
m_executableChooser->setEnvironment(aspect->environment());
|
||||
}
|
||||
@@ -242,7 +242,7 @@ void CustomExecutableRunConfiguration::configurationDialogFinished()
|
||||
|
||||
QString CustomExecutableRunConfiguration::rawExecutable() const
|
||||
{
|
||||
return extraAspect<ExecutableAspect>()->executable().toString();
|
||||
return aspect<ExecutableAspect>()->executable().toString();
|
||||
}
|
||||
|
||||
bool CustomExecutableRunConfiguration::isConfigured() const
|
||||
@@ -253,12 +253,12 @@ bool CustomExecutableRunConfiguration::isConfigured() const
|
||||
Runnable CustomExecutableRunConfiguration::runnable() const
|
||||
{
|
||||
FileName workingDirectory =
|
||||
extraAspect<WorkingDirectoryAspect>()->workingDirectory(macroExpander());
|
||||
aspect<WorkingDirectoryAspect>()->workingDirectory(macroExpander());
|
||||
|
||||
Runnable r;
|
||||
r.executable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
r.commandLineArguments = extraAspect<ArgumentsAspect>()->arguments(macroExpander());
|
||||
r.environment = extraAspect<EnvironmentAspect>()->environment();
|
||||
r.executable = aspect<ExecutableAspect>()->executable().toString();
|
||||
r.commandLineArguments = aspect<ArgumentsAspect>()->arguments(macroExpander());
|
||||
r.environment = aspect<EnvironmentAspect>()->environment();
|
||||
r.workingDirectory = workingDirectory.toString();
|
||||
r.device = DeviceManager::instance()->defaultDevice(Constants::DESKTOP_DEVICE_TYPE);
|
||||
|
||||
|
@@ -154,7 +154,7 @@ bool ProjectConfiguration::fromMap(const QVariantMap &map)
|
||||
return true;
|
||||
}
|
||||
|
||||
ProjectConfigurationAspect *ProjectConfiguration::extraAspect(Core::Id id) const
|
||||
ProjectConfigurationAspect *ProjectConfiguration::aspect(Core::Id id) const
|
||||
{
|
||||
return Utils::findOrDefault(m_aspects, Utils::equal(&ProjectConfigurationAspect::id, id));
|
||||
}
|
||||
|
@@ -126,9 +126,9 @@ public:
|
||||
|
||||
const QList<ProjectConfigurationAspect *> aspects() const { return m_aspects; }
|
||||
|
||||
ProjectConfigurationAspect *extraAspect(Core::Id id) const;
|
||||
ProjectConfigurationAspect *aspect(Core::Id id) const;
|
||||
|
||||
template <typename T> T *extraAspect() const
|
||||
template <typename T> T *aspect() const
|
||||
{
|
||||
for (ProjectConfigurationAspect *aspect : m_aspects)
|
||||
if (T *result = qobject_cast<T *>(aspect))
|
||||
|
@@ -193,7 +193,7 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id)
|
||||
});
|
||||
expander->registerPrefix("CurrentRun:Env", tr("Variables in the current run environment"),
|
||||
[this](const QString &var) {
|
||||
const auto envAspect = extraAspect<EnvironmentAspect>();
|
||||
const auto envAspect = aspect<EnvironmentAspect>();
|
||||
return envAspect ? envAspect->environment().value(var) : QString();
|
||||
});
|
||||
expander->registerVariable(Constants::VAR_CURRENTRUN_NAME,
|
||||
@@ -376,14 +376,14 @@ bool RunConfiguration::fromMap(const QVariantMap &map)
|
||||
Runnable RunConfiguration::runnable() const
|
||||
{
|
||||
Runnable r;
|
||||
if (auto aspect = extraAspect<ExecutableAspect>())
|
||||
r.executable = aspect->executable().toString();
|
||||
if (auto aspect = extraAspect<ArgumentsAspect>())
|
||||
r.commandLineArguments = aspect->arguments(macroExpander());
|
||||
if (auto aspect = extraAspect<WorkingDirectoryAspect>())
|
||||
r.workingDirectory = aspect->workingDirectory(macroExpander()).toString();
|
||||
if (auto aspect = extraAspect<EnvironmentAspect>())
|
||||
r.environment = aspect->environment();
|
||||
if (auto executableAspect = aspect<ExecutableAspect>())
|
||||
r.executable = executableAspect->executable().toString();
|
||||
if (auto argumentsAspect = aspect<ArgumentsAspect>())
|
||||
r.commandLineArguments = argumentsAspect->arguments(macroExpander());
|
||||
if (auto workingDirectoryAspect = aspect<WorkingDirectoryAspect>())
|
||||
r.workingDirectory = workingDirectoryAspect->workingDirectory(macroExpander()).toString();
|
||||
if (auto environmentAspect = aspect<EnvironmentAspect>())
|
||||
r.environment = environmentAspect->environment();
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -1556,7 +1556,7 @@ SimpleTargetRunner::SimpleTargetRunner(RunControl *runControl)
|
||||
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->extraAspect<TerminalAspect>())
|
||||
if (auto terminalAspect = runConfig->aspect<TerminalAspect>())
|
||||
m_useTerminal = terminalAspect->useTerminal();
|
||||
}
|
||||
}
|
||||
|
@@ -185,8 +185,8 @@ public:
|
||||
|
||||
template <class T = ISettingsAspect> T *currentSettings(Core::Id id) const
|
||||
{
|
||||
if (auto aspect = qobject_cast<GlobalOrProjectAspect *>(extraAspect(id)))
|
||||
return qobject_cast<T *>(aspect->currentSettings());
|
||||
if (auto a = qobject_cast<GlobalOrProjectAspect *>(aspect(id)))
|
||||
return qobject_cast<T *>(a->currentSettings());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@@ -241,9 +241,9 @@ private:
|
||||
Runnable runnable() const final;
|
||||
|
||||
bool supportsDebugger() const { return true; }
|
||||
QString mainScript() const { return extraAspect<MainScriptAspect>()->value(); }
|
||||
QString arguments() const { return extraAspect<ArgumentsAspect>()->arguments(macroExpander()); }
|
||||
QString interpreter() const { return extraAspect<InterpreterAspect>()->value(); }
|
||||
QString mainScript() const { return aspect<MainScriptAspect>()->value(); }
|
||||
QString arguments() const { return aspect<ArgumentsAspect>()->arguments(macroExpander()); }
|
||||
QString interpreter() const { return aspect<InterpreterAspect>()->value(); }
|
||||
|
||||
void updateTargetInformation();
|
||||
};
|
||||
@@ -283,7 +283,7 @@ void PythonRunConfiguration::updateTargetInformation()
|
||||
const BuildTargetInfo bti = buildTargetInfo();
|
||||
const QString script = bti.targetFilePath.toString();
|
||||
setDefaultDisplayName(tr("Run %1").arg(script));
|
||||
extraAspect<MainScriptAspect>()->setValue(script);
|
||||
aspect<MainScriptAspect>()->setValue(script);
|
||||
}
|
||||
|
||||
Runnable PythonRunConfiguration::runnable() const
|
||||
@@ -291,9 +291,9 @@ Runnable PythonRunConfiguration::runnable() const
|
||||
Runnable r;
|
||||
QtcProcess::addArg(&r.commandLineArguments, mainScript());
|
||||
QtcProcess::addArgs(&r.commandLineArguments,
|
||||
extraAspect<ArgumentsAspect>()->arguments(macroExpander()));
|
||||
r.executable = extraAspect<InterpreterAspect>()->value();
|
||||
r.environment = extraAspect<EnvironmentAspect>()->environment();
|
||||
aspect<ArgumentsAspect>()->arguments(macroExpander()));
|
||||
r.executable = aspect<InterpreterAspect>()->value();
|
||||
r.environment = aspect<EnvironmentAspect>()->environment();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@@ -110,11 +110,11 @@ void QbsRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &
|
||||
|
||||
void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env) const
|
||||
{
|
||||
if (auto dyldAspect = extraAspect<UseDyldSuffixAspect>()) {
|
||||
if (auto dyldAspect = aspect<UseDyldSuffixAspect>()) {
|
||||
if (dyldAspect->value())
|
||||
env.set("DYLD_IMAGE_SUFFIX", "_debug");
|
||||
}
|
||||
bool usingLibraryPaths = extraAspect<UseLibraryPathsAspect>()->value();
|
||||
bool usingLibraryPaths = aspect<UseLibraryPathsAspect>()->value();
|
||||
|
||||
const auto key = qMakePair(env.toStringList(), usingLibraryPaths);
|
||||
const auto it = m_envCache.constFind(key);
|
||||
@@ -146,16 +146,16 @@ void QbsRunConfiguration::updateTargetInformation()
|
||||
{
|
||||
BuildTargetInfo bti = buildTargetInfo();
|
||||
const FileName executable = executableToRun(bti);
|
||||
auto terminalAspect = extraAspect<TerminalAspect>();
|
||||
auto terminalAspect = aspect<TerminalAspect>();
|
||||
if (!terminalAspect->isUserSet())
|
||||
terminalAspect->setUseTerminal(bti.usesTerminal);
|
||||
|
||||
extraAspect<ExecutableAspect>()->setExecutable(executable);
|
||||
aspect<ExecutableAspect>()->setExecutable(executable);
|
||||
|
||||
if (!executable.isEmpty()) {
|
||||
QString defaultWorkingDir = QFileInfo(executable.toString()).absolutePath();
|
||||
if (!defaultWorkingDir.isEmpty()) {
|
||||
auto wdAspect = extraAspect<WorkingDirectoryAspect>();
|
||||
auto wdAspect = aspect<WorkingDirectoryAspect>();
|
||||
wdAspect->setDefaultWorkingDirectory(FileName::fromString(defaultWorkingDir));
|
||||
}
|
||||
}
|
||||
|
@@ -91,20 +91,20 @@ DesktopQmakeRunConfiguration::DesktopQmakeRunConfiguration(Target *target, Core:
|
||||
void DesktopQmakeRunConfiguration::updateTargetInformation()
|
||||
{
|
||||
setDefaultDisplayName(defaultDisplayName());
|
||||
extraAspect<LocalEnvironmentAspect>()->buildEnvironmentHasChanged();
|
||||
aspect<LocalEnvironmentAspect>()->buildEnvironmentHasChanged();
|
||||
|
||||
BuildTargetInfo bti = buildTargetInfo();
|
||||
|
||||
auto wda = extraAspect<WorkingDirectoryAspect>();
|
||||
auto wda = aspect<WorkingDirectoryAspect>();
|
||||
wda->setDefaultWorkingDirectory(bti.workingDirectory);
|
||||
if (wda->pathChooser())
|
||||
wda->pathChooser()->setBaseFileName(target()->project()->projectDirectory());
|
||||
|
||||
auto terminalAspect = extraAspect<TerminalAspect>();
|
||||
auto terminalAspect = aspect<TerminalAspect>();
|
||||
if (!terminalAspect->isUserSet())
|
||||
terminalAspect->setUseTerminal(bti.usesTerminal);
|
||||
|
||||
extraAspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
||||
aspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
||||
}
|
||||
|
||||
QVariantMap DesktopQmakeRunConfiguration::toMap() const
|
||||
@@ -135,9 +135,9 @@ void DesktopQmakeRunConfiguration::addToBaseEnvironment(Environment &env) const
|
||||
{
|
||||
BuildTargetInfo bti = buildTargetInfo();
|
||||
if (bti.runEnvModifier)
|
||||
bti.runEnvModifier(env, extraAspect<UseLibraryPathsAspect>()->value());
|
||||
bti.runEnvModifier(env, aspect<UseLibraryPathsAspect>()->value());
|
||||
|
||||
if (auto dyldAspect = extraAspect<UseDyldSuffixAspect>()) {
|
||||
if (auto dyldAspect = aspect<UseDyldSuffixAspect>()) {
|
||||
if (dyldAspect->value())
|
||||
env.set(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug"));
|
||||
}
|
||||
|
@@ -302,7 +302,7 @@ void QmlProfilerTool::finalizeRunControl(QmlProfilerRunner *runWorker)
|
||||
auto runConfiguration = runControl->runConfiguration();
|
||||
if (runConfiguration) {
|
||||
auto aspect = static_cast<QmlProfilerRunConfigurationAspect *>(
|
||||
runConfiguration->extraAspect(Constants::SETTINGS));
|
||||
runConfiguration->aspect(Constants::SETTINGS));
|
||||
if (aspect) {
|
||||
if (QmlProfilerSettings *settings = static_cast<QmlProfilerSettings *>(aspect->currentSettings())) {
|
||||
d->m_profilerConnections->setFlushInterval(settings->flushEnabled() ?
|
||||
|
@@ -305,7 +305,7 @@ Runnable QmlProjectRunConfiguration::runnable() const
|
||||
Runnable r;
|
||||
r.executable = executable();
|
||||
r.commandLineArguments = commandLineArguments();
|
||||
r.environment = extraAspect<QmlProjectEnvironmentAspect>()->environment();
|
||||
r.environment = aspect<QmlProjectEnvironmentAspect>()->environment();
|
||||
r.workingDirectory = static_cast<QmlProject *>(project())->targetDirectory(target()).toString();
|
||||
return r;
|
||||
}
|
||||
@@ -354,7 +354,7 @@ QString QmlProjectRunConfiguration::executable() const
|
||||
QString QmlProjectRunConfiguration::commandLineArguments() const
|
||||
{
|
||||
// arguments in .user file
|
||||
QString args = extraAspect<ArgumentsAspect>()->arguments(macroExpander());
|
||||
QString args = aspect<ArgumentsAspect>()->arguments(macroExpander());
|
||||
const Target *currentTarget = target();
|
||||
const IDevice::ConstPtr device = DeviceKitInformation::device(currentTarget->kit());
|
||||
const Utils::OsType osType = device ? device->osType() : Utils::HostOsInfo::hostOs();
|
||||
|
@@ -265,7 +265,7 @@ void QnxAttachDebugSupport::showProcessesDialog()
|
||||
// QString projectSourceDirectory = dlg.projectSource();
|
||||
QString localExecutable = dlg.localExecutable();
|
||||
if (localExecutable.isEmpty()) {
|
||||
if (auto aspect = runConfig->extraAspect<SymbolFileAspect>())
|
||||
if (auto aspect = runConfig->aspect<SymbolFileAspect>())
|
||||
localExecutable = aspect->fileName().toString();
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,7 @@ QnxRunConfiguration::QnxRunConfiguration(Target *target, Core::Id id)
|
||||
Runnable QnxRunConfiguration::runnable() const
|
||||
{
|
||||
Runnable r = RemoteLinuxRunConfiguration::runnable();
|
||||
QString libPath = extraAspect<QtLibPathAspect>()->value();
|
||||
QString libPath = aspect<QtLibPathAspect>()->value();
|
||||
if (!libPath.isEmpty()) {
|
||||
r.environment.appendOrSet("LD_LIBRARY_PATH", libPath + "/lib:$LD_LIBRARY_PATH");
|
||||
r.environment.appendOrSet("QML_IMPORT_PATH", libPath + "/imports:$QML_IMPORT_PATH");
|
||||
|
@@ -45,7 +45,7 @@ Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl)
|
||||
: RunWorker(runControl)
|
||||
{
|
||||
setId("Slog2InfoRunner");
|
||||
m_applicationId = runControl->runConfiguration()->extraAspect<ExecutableAspect>()->executable().fileName();
|
||||
m_applicationId = runControl->runConfiguration()->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.
|
||||
|
@@ -65,7 +65,7 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar
|
||||
|
||||
bool RemoteLinuxCustomRunConfiguration::isConfigured() const
|
||||
{
|
||||
return !extraAspect<ExecutableAspect>()->executable().isEmpty();
|
||||
return !aspect<ExecutableAspect>()->executable().isEmpty();
|
||||
}
|
||||
|
||||
RunConfiguration::ConfigurationState
|
||||
@@ -88,7 +88,7 @@ Core::Id RemoteLinuxCustomRunConfiguration::runConfigId()
|
||||
|
||||
QString RemoteLinuxCustomRunConfiguration::runConfigDefaultDisplayName()
|
||||
{
|
||||
QString remoteExecutable = extraAspect<ExecutableAspect>()->executable().toString();
|
||||
QString remoteExecutable = aspect<ExecutableAspect>()->executable().toString();
|
||||
QString display = remoteExecutable.isEmpty()
|
||||
? tr("Custom Executable") : tr("Run \"%1\"").arg(remoteExecutable);
|
||||
return RunConfigurationFactory::decoratedTargetName(display, target());
|
||||
|
@@ -89,8 +89,8 @@ void RemoteLinuxRunConfiguration::updateTargetInformation()
|
||||
QString localExecutable = bti.targetFilePath.toString();
|
||||
DeployableFile depFile = target()->deploymentData().deployableForLocalFile(localExecutable);
|
||||
|
||||
extraAspect<ExecutableAspect>()->setExecutable(FileName::fromString(depFile.remoteFilePath()));
|
||||
extraAspect<SymbolFileAspect>()->setValue(localExecutable);
|
||||
aspect<ExecutableAspect>()->setExecutable(FileName::fromString(depFile.remoteFilePath()));
|
||||
aspect<SymbolFileAspect>()->setValue(localExecutable);
|
||||
|
||||
emit enabledChanged();
|
||||
}
|
||||
|
@@ -86,7 +86,7 @@ void ValgrindToolRunner::start()
|
||||
m_runner.setDevice(device());
|
||||
m_runner.setDebuggee(runnable());
|
||||
|
||||
if (auto aspect = runControl()->runConfiguration()->extraAspect<TerminalAspect>())
|
||||
if (auto aspect = runControl()->runConfiguration()->aspect<TerminalAspect>())
|
||||
m_runner.setUseTerminal(aspect->useTerminal());
|
||||
|
||||
connect(&m_runner, &ValgrindRunner::processOutputReceived,
|
||||
|
@@ -84,13 +84,13 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr
|
||||
|
||||
bool loopbackExemptClient = false;
|
||||
bool loopbackExemptServer = false;
|
||||
if (auto aspect = runConfiguration->extraAspect<ArgumentsAspect>())
|
||||
if (auto aspect = runConfiguration->aspect<ArgumentsAspect>())
|
||||
m_arguments = aspect->arguments(runConfiguration->macroExpander());
|
||||
if (auto aspect = runConfiguration->extraAspect<UninstallAfterStopAspect>())
|
||||
if (auto aspect = runConfiguration->aspect<UninstallAfterStopAspect>())
|
||||
m_uninstallAfterStop = aspect->value();
|
||||
if (auto aspect = runConfiguration->extraAspect<LoopbackExemptClientAspect>())
|
||||
if (auto aspect = runConfiguration->aspect<LoopbackExemptClientAspect>())
|
||||
loopbackExemptClient = aspect->value();
|
||||
if (auto aspect = runConfiguration->extraAspect<LoopbackExemptServerAspect>())
|
||||
if (auto aspect = runConfiguration->aspect<LoopbackExemptServerAspect>())
|
||||
loopbackExemptServer = aspect->value();
|
||||
if (loopbackExemptClient && loopbackExemptServer)
|
||||
m_loopbackArguments = "--loopbackexempt clientserver";
|
||||
|
Reference in New Issue
Block a user