ProjectExplorer: Use StandardRunnable in ApplicationLauncher

Change-Id: I7092d748207762d3dbd6c69c01cc06c88cbf63d8
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-01-27 16:56:36 +01:00
parent 9ffae7f4ba
commit d5ecd4cf8b
8 changed files with 53 additions and 68 deletions

View File

@@ -27,6 +27,8 @@
#include <coreplugin/icore.h>
#include <projectexplorer/runnables.h>
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <utils/qtcprocess.h>
@@ -46,8 +48,6 @@ QmlJSPreviewRunner::QmlJSPreviewRunner(QObject *parent) :
+ Utils::HostOsInfo::pathListSeparator()
+ QString::fromLocal8Bit(qgetenv("PATH"));
m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, QLatin1String("qmlviewer"));
m_applicationLauncher.setEnvironment(Utils::Environment::systemEnvironment());
}
bool QmlJSPreviewRunner::isReady() const
@@ -59,9 +59,12 @@ void QmlJSPreviewRunner::run(const QString &filename)
{
QString errorMessage;
if (!filename.isEmpty()) {
m_applicationLauncher.start(ProjectExplorer::ApplicationLauncher::Gui, m_qmlViewerDefaultPath,
Utils::QtcProcess::quoteArg(filename));
ProjectExplorer::StandardRunnable r;
r.environment = Utils::Environment::systemEnvironment();
r.runMode = ProjectExplorer::ApplicationLauncher::Gui;
r.executable = m_qmlViewerDefaultPath;
r.commandLineArguments = Utils::QtcProcess::quoteArg(filename);
m_applicationLauncher.start(r);
} else {
errorMessage = tr("No file specified.");
}