diff options
author | hjk <hjk@qt.io> | 2019-06-11 14:39:39 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-06-12 12:30:23 +0000 |
commit | 7ebe005206327d458e8b414b8ccdee1f02a51da6 (patch) | |
tree | 3e3a29365529fdd5184678fdf879f081fcd50f74 /src/plugins/qmlprojectmanager | |
parent | a51b8a061e91ed615bd48b348dcc133e01f49dbf (diff) |
ProjectExplorer: Replace RunConfiguration::executable
... by a RunConfiguration::commandLine().
That's what is typically consumed, and removes the need for some
custom runnable() implementations.
Change-Id: I7700b12cdd0965802a0add977b432314734a5a72
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmlprojectmanager')
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index f2e54f6444..cd7d04ce84 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -298,17 +298,21 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) return envModifier(Environment()); }); - setExecutableGetter([this] { return FilePath::fromString(theExecutable()); }); - m_qmlViewerAspect = addAspect<BaseStringAspect>(); m_qmlViewerAspect->setLabelText(tr("QML Viewer:")); - m_qmlViewerAspect->setPlaceHolderText(executable().toString()); + m_qmlViewerAspect->setPlaceHolderText(commandLine().executable().toString()); m_qmlViewerAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay); m_qmlViewerAspect->setHistoryCompleter("QmlProjectManager.viewer.history"); auto argumentAspect = addAspect<ArgumentsAspect>(); argumentAspect->setSettingsKey(Constants::QML_VIEWER_ARGUMENTS_KEY); + setCommandLineGetter([this] { + return CommandLine(FilePath::fromString(theExecutable()), + commandLineArguments(), + CommandLine::Raw); + }); + auto qmlProject = qobject_cast<QmlProject *>(target->project()); QTC_ASSERT(qmlProject, return); m_mainQmlFileAspect = addAspect<MainQmlFileAspect>(qmlProject); @@ -326,8 +330,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) Runnable QmlProjectRunConfiguration::runnable() const { Runnable r; - r.executable = executable().toString(); - r.commandLineArguments = commandLineArguments(); + r.setCommandLine(commandLine()); r.environment = aspect<EnvironmentAspect>()->environment(); r.workingDirectory = static_cast<QmlProject *>(project())->targetDirectory(target()).toString(); return r; @@ -339,10 +342,10 @@ QString QmlProjectRunConfiguration::disabledReason() const return tr("No script file to execute."); if (DeviceTypeKitAspect::deviceTypeId(target()->kit()) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE - && !executable().exists()) { + && !commandLine().executable().exists()) { return tr("No qmlscene found."); } - if (executable().isEmpty()) + if (commandLine().executable().isEmpty()) return tr("No qmlscene binary specified for target device."); return RunConfiguration::disabledReason(); } @@ -405,7 +408,7 @@ QString QmlProjectRunConfiguration::commandLineArguments() const void QmlProjectRunConfiguration::updateEnabledState() { bool enabled = false; - if (m_mainQmlFileAspect->isQmlFilePresent() && !executable().isEmpty()) { + if (m_mainQmlFileAspect->isQmlFilePresent() && !commandLine().executable().isEmpty()) { Project *p = target()->project(); enabled = !p->isParsing() && p->hasParsingData(); } |