diff --git a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp index 14f7de97dd5..db7022f4e99 100644 --- a/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp +++ b/src/plugins/qmlprofiler/localqmlprofilerrunner.cpp @@ -58,8 +58,8 @@ LocalQmlProfilerRunner *LocalQmlProfilerRunner::createLocalRunner( Configuration conf; if (rc1) { // This is a "plain" .qmlproject. - conf.executable = rc1->observerPath(); - conf.executableArguments = rc1->viewerArguments(); + conf.executable = rc1->executable(); + conf.executableArguments = rc1->commandLineArguments(); conf.workingDirectory = rc1->workingDirectory(); conf.environment = environment->environment(); } else { diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 6282c5c0e6d..2b7e5421faf 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -113,7 +113,7 @@ bool QmlProfilerRunControl::startEngine() if (QmlProjectManager::QmlProjectRunConfiguration *rc = qobject_cast(runConfiguration())) { - if (rc->observerPath().isEmpty()) { + if (rc->executable().isEmpty()) { QmlProjectManager::QmlProjectPlugin::showQmlObserverToolWarning(); d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle); AnalyzerManager::stopTool(); diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp index 6c139e87466..c4cd238e856 100644 --- a/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerruncontrolfactory.cpp @@ -82,8 +82,8 @@ static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration if (environment) sp.environment = environment->environment(); sp.workingDirectory = rc1->workingDirectory(); - sp.debuggee = rc1->observerPath(); - sp.debuggeeArgs = rc1->viewerArguments(); + sp.debuggee = rc1->executable(); + sp.debuggeeArgs = rc1->commandLineArguments(); sp.displayName = rc1->displayName(); } else if (LocalApplicationRunConfiguration *rc2 = qobject_cast(runConfiguration)) { diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 803c67bcb00..f133d802b9d 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -54,7 +54,7 @@ namespace QmlProjectManager { const char M_CURRENT_FILE[] = "CurrentFile"; QmlProjectRunConfiguration::QmlProjectRunConfiguration(ProjectExplorer::Target *parent, Id id) : - ProjectExplorer::RunConfiguration(parent, id), + ProjectExplorer::LocalApplicationRunConfiguration(parent, id), m_scriptFile(QLatin1String(M_CURRENT_FILE)), m_isEnabled(false) { @@ -63,7 +63,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(ProjectExplorer::Target * QmlProjectRunConfiguration::QmlProjectRunConfiguration(ProjectExplorer::Target *parent, QmlProjectRunConfiguration *source) : - ProjectExplorer::RunConfiguration(parent, source), + ProjectExplorer::LocalApplicationRunConfiguration(parent, source), m_scriptFile(source->m_scriptFile), m_qmlViewerArgs(source->m_qmlViewerArgs), m_isEnabled(source->m_isEnabled) @@ -100,7 +100,7 @@ void QmlProjectRunConfiguration::ctor() addExtraAspect(new QmlProjectEnvironmentAspect(this)); } -QString QmlProjectRunConfiguration::viewerPath() const +QString QmlProjectRunConfiguration::executable() const { QtSupport::BaseQtVersion *version = qtVersion(); if (!version) @@ -108,25 +108,18 @@ QString QmlProjectRunConfiguration::viewerPath() const if (id() == Constants::QML_SCENE_RC_ID) return version->qmlsceneCommand(); - else + if (!version->needsQmlDebuggingLibrary()) return version->qmlviewerCommand(); + return version->qmlObserverTool(); + } -QString QmlProjectRunConfiguration::observerPath() const +ProjectExplorer::LocalApplicationRunConfiguration::RunMode QmlProjectRunConfiguration::runMode() const { - QtSupport::BaseQtVersion *version = qtVersion(); - if (!version) { - return QString(); - } else { - if (id() == Constants::QML_SCENE_RC_ID) - return version->qmlsceneCommand(); - if (!version->needsQmlDebuggingLibrary()) - return version->qmlviewerCommand(); - return version->qmlObserverTool(); - } + return Gui; } -QString QmlProjectRunConfiguration::viewerArguments() const +QString QmlProjectRunConfiguration::commandLineArguments() const { // arguments in .user file QString args = m_qmlViewerArgs; @@ -146,6 +139,16 @@ QString QmlProjectRunConfiguration::viewerArguments() const return args; } +QString QmlProjectRunConfiguration::dumperLibrary() const +{ + return QString(); +} + +QStringList QmlProjectRunConfiguration::dumperLibraryLocations() const +{ + return QStringList(); +} + QString QmlProjectRunConfiguration::workingDirectory() const { QFileInfo projectFile(target()->project()->projectFilePath()); @@ -303,8 +306,7 @@ void QmlProjectRunConfiguration::updateEnabled() qmlFileFound = !mainScript().isEmpty(); } - bool newValue = (QFileInfo(viewerPath()).exists() - || QFileInfo(observerPath()).exists()) && qmlFileFound; + bool newValue = QFileInfo(executable()).exists() && qmlFileFound; // Always emit change signal to force reevaluation of run/debug buttons diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h index c94ead417ea..beaaa899bff 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h @@ -32,7 +32,7 @@ #include "qmlprojectmanager_global.h" -#include +#include #include @@ -52,7 +52,7 @@ namespace Internal { class QmlProjectRunConfigurationWidget; } -class QMLPROJECTMANAGER_EXPORT QmlProjectRunConfiguration : public ProjectExplorer::RunConfiguration +class QMLPROJECTMANAGER_EXPORT QmlProjectRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration { Q_OBJECT friend class Internal::QmlProjectRunConfigurationFactory; @@ -62,9 +62,12 @@ class QMLPROJECTMANAGER_EXPORT QmlProjectRunConfiguration : public ProjectExplor public: QmlProjectRunConfiguration(ProjectExplorer::Target *parent, Core::Id id); - QString viewerPath() const; - QString observerPath() const; - QString viewerArguments() const; + QString executable() const; + RunMode runMode() const; + QString commandLineArguments() const; + QString dumperLibrary() const; + QStringList dumperLibraryLocations() const; + QString workingDirectory() const; QtSupport::BaseQtVersion *qtVersion() const; diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index 27fb2a59527..6ef208f3f07 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -62,11 +62,8 @@ QmlProjectRunControl::QmlProjectRunControl(QmlProjectRunConfiguration *runConfig m_applicationLauncher.setEnvironment(environment->environment()); m_applicationLauncher.setWorkingDirectory(runConfiguration->workingDirectory()); - if (mode == NormalRunMode) - m_executable = runConfiguration->viewerPath(); - else - m_executable = runConfiguration->observerPath(); - m_commandLineArguments = runConfiguration->viewerArguments(); + m_executable = runConfiguration->executable(); + m_commandLineArguments = runConfiguration->commandLineArguments(); m_mainQmlFile = runConfiguration->mainScript(); connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,Utils::OutputFormat)), @@ -154,11 +151,11 @@ bool QmlProjectRunControlFactory::canRun(RunConfiguration *runConfiguration, if (!config) return false; if (mode == NormalRunMode) - return !config->viewerPath().isEmpty(); + return !config->executable().isEmpty(); if (mode != DebugRunMode) return false; - if (!config->observerPath().isEmpty()) + if (!config->executable().isEmpty()) return true; if (!config->qtVersion()) return false; @@ -204,8 +201,8 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf EnvironmentAspect *environment = runConfig->extraAspect(); params.startMode = Debugger::StartInternal; - params.executable = runConfig->observerPath(); - params.processArgs = runConfig->viewerArguments(); + params.executable = runConfig->executable(); + params.processArgs = runConfig->commandLineArguments(); params.workingDirectory = runConfig->workingDirectory(); if (environment) params.environment = environment->environment();