summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-09-15 02:39:18 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-09-15 02:39:18 (GMT)
commita2ca8c305e6ebe145b82588d088f5dc16a4db861 (patch)
treecb1dec3d72943e304931f4bc84270ca5daa61efa
parent8ab760b70e13318749bcc83e33b9a9b9a849a892 (diff)
downloadQt-a2ca8c305e6ebe145b82588d088f5dc16a4db861.zip
Qt-a2ca8c305e6ebe145b82588d088f5dc16a4db861.tar.gz
Qt-a2ca8c305e6ebe145b82588d088f5dc16a4db861.tar.bz2
Give file and line error information for errors in dummydata.
This also has the side effect of allowing types to be defined within the dummydata folder than can be used by other files in dummydata.
-rw-r--r--tools/qml/qmlruntime.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index b38e80d..1eb7ee8 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -1067,11 +1067,7 @@ void QDeclarativeViewer::loadDummyDataFiles(const QString& directory)
QStringList list = dir.entryList();
for (int i = 0; i < list.size(); ++i) {
QString qml = list.at(i);
- QFile f(dir.filePath(qml));
- f.open(QIODevice::ReadOnly);
- QByteArray data = f.readAll();
- QDeclarativeComponent comp(canvas->engine());
- comp.setData(data, QUrl());
+ QDeclarativeComponent comp(canvas->engine(), dir.filePath(qml));
QObject *dummyData = comp.create();
if(comp.isError()) {