diff options
author | David Boddie <dboddie@trolltech.com> | 2010-08-24 17:45:21 +0200 |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2010-08-24 17:45:21 +0200 |
commit | 8e6569663ecbf7389b3df5d86f4ce2d1102b16c0 (patch) | |
tree | 290fe9c4af570126949093affc25c7a9fb84e8ed /src/plugins/qmljseditor/qmljspreviewrunner.cpp | |
parent | 1cbc4116d3c6fa1320ee4523e45a5f0df004cd3a (diff) | |
parent | e5076cc5e50be46b2f2a2307660e5e8603b780ad (diff) | |
download | qt-creator-8e6569663ecbf7389b3df5d86f4ce2d1102b16c0.tar.gz |
Merge branch '2.0' of scm.dev.nokia.troll.no:creator/mainline into 2.0
Diffstat (limited to 'src/plugins/qmljseditor/qmljspreviewrunner.cpp')
-rw-r--r-- | src/plugins/qmljseditor/qmljspreviewrunner.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/plugins/qmljseditor/qmljspreviewrunner.cpp b/src/plugins/qmljseditor/qmljspreviewrunner.cpp deleted file mode 100644 index edae36100f..0000000000 --- a/src/plugins/qmljseditor/qmljspreviewrunner.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "qmljspreviewrunner.h" - -#include <projectexplorer/environment.h> -#include <utils/synchronousprocess.h> - -#include <QtGui/QMessageBox> -#include <QtGui/QApplication> - -#include <QDebug> - -namespace QmlJSEditor { -namespace Internal { - -QmlJSPreviewRunner::QmlJSPreviewRunner(QObject *parent) : - QObject(parent) -{ - // prepend creator/bin dir to search path (only useful for special creator-qml package) - const QString searchPath = QCoreApplication::applicationDirPath() - + Utils::SynchronousProcess::pathSeparator() - + QString(qgetenv("PATH")); - m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, QLatin1String("qml")); - - ProjectExplorer::Environment environment = ProjectExplorer::Environment::systemEnvironment(); - m_applicationLauncher.setEnvironment(environment.toStringList()); -} - - -void QmlJSPreviewRunner::run(const QString &filename) -{ - QString errorMessage; - if (!filename.isEmpty()) { - m_applicationLauncher.start(ProjectExplorer::ApplicationLauncher::Gui, m_qmlViewerDefaultPath, - QStringList() << filename); - - } else { - errorMessage = "No file specified."; - } - - if (!errorMessage.isEmpty()) - QMessageBox::warning(0, tr("Failed to preview Qt Quick file"), - tr("Could not preview Qt Quick (QML) file. Reason: \n%1").arg(errorMessage)); -} - - -} // namespace Internal -} // namespace QmlJSEditor |