added custom qmlviewer to creator

This qmlviewer will be also the default one when opening qmlproject files
as the runconfiguration was changed too.
This commit is contained in:
Lasse Holmstedt
2010-07-08 14:00:33 +02:00
parent aa4f9725eb
commit bb08fb6528
90 changed files with 12147 additions and 7 deletions

View File

@@ -96,18 +96,28 @@ void QmlProjectRunConfiguration::ctor()
setDisplayName(tr("QML Viewer", "QMLRunConfiguration display name."));
// 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"));
#ifdef Q_OS_MAC
const QString qmlViewerName = QLatin1String("QMLViewer");
#else
const QString qmlViewerName = QLatin1String("qmlviewer");
#endif
m_qmlViewerDefaultPath = Utils::SynchronousProcess::locateBinary(searchPath, qmlViewerName);
if (m_qmlViewerDefaultPath.isEmpty()) {
QDir qmlviewerExecutable(QCoreApplication::applicationDirPath());
#ifndef Q_OS_WIN
m_qmlViewerDefaultPath = qmlviewerExecutable.absoluteFilePath(qmlViewerName);
#else
m_qmlViewerDefaultPath = qmlviewerExecutable.absoluteFilePath(QString("%1.exe").arg(qmlViewerName));
#endif
QFileInfo qmlviewerFileInfo(m_qmlViewerDefaultPath);
if (!qmlviewerFileInfo.exists()) {
qWarning() << "QmlProjectRunConfiguration::ctor(): qmlviewer executable does not exist at" << m_qmlViewerDefaultPath;
m_qmlViewerDefaultPath.clear();
} else if (!qmlviewerFileInfo.isFile()) {
qWarning() << "QmlProjectRunConfiguration::ctor(): " << m_qmlViewerDefaultPath << " is not a file";
m_qmlViewerDefaultPath.clear();
}
}
}
QmlProjectRunConfiguration::~QmlProjectRunConfiguration()