diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-10-22 01:59:33 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-10-22 01:59:33 (GMT) |
commit | 6c9ac788a60fcd2f946787a5297d7c2f71ad1968 (patch) | |
tree | af53424d7d2adfcbb324624ab93d31845d3db80d /tools/qmlviewer/qmlviewer.cpp | |
parent | 2391cf5d127882ce8811e058115d5c2605328079 (diff) | |
parent | fa85d539decf7bdcb16fa8f52858b13479cea659 (diff) | |
download | Qt-6c9ac788a60fcd2f946787a5297d7c2f71ad1968.zip Qt-6c9ac788a60fcd2f946787a5297d7c2f71ad1968.tar.gz Qt-6c9ac788a60fcd2f946787a5297d7c2f71ad1968.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tools/qmlviewer/qmlviewer.cpp')
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 95dfd16..60fa13a 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -628,6 +628,11 @@ void QmlViewer::openQml(const QString& fileName) QUrl url(fileName); QFileInfo fi(fileName); if (fi.exists()) { + if (fi.suffix().toLower() != QLatin1String("qml")) { + qWarning() << "qmlviewer cannot open non-QML file" << fileName; + return; + } + url = QUrl::fromLocalFile(fi.absoluteFilePath()); QmlContext *ctxt = canvas->rootContext(); QDir dir(fi.path()+"/dummydata", "*.qml"); @@ -656,6 +661,9 @@ void QmlViewer::openQml(const QString& fileName) dummyData->setParent(this); } } + } else { + qWarning() << "qmlviewer cannot find file:" << fileName; + return; } canvas->setUrl(url); |