aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlscene
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qmlscene')
-rw-r--r--tools/qmlscene/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index af50acaa5a..d3b8b9ba99 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -29,7 +29,7 @@
#include <QtCore/qabstractanimation.h>
#include <QtCore/qdir.h>
#include <QtCore/qmath.h>
-#include <QtCore/qdatetime.h>
+#include <QtCore/qelapsedtimer.h>
#include <QtCore/qpointer.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qtextstream.h>
@@ -76,7 +76,7 @@ QVector<int> RenderStatistics::timesPerFrames;
void RenderStatistics::updateStats()
{
- static QTime time;
+ static QElapsedTimer time;
static int frames;
static int lastTime;
@@ -271,6 +271,10 @@ static bool checkVersion(const QUrl &url)
QTextStream stream(&f);
bool codeFound= false;
while (!codeFound) {
+ if (stream.atEnd()) {
+ fprintf(stderr, "qmlscene: no code found in file '%s'.\n", qPrintable(fileName));
+ return false;
+ }
QString line = stream.readLine();
if (line.contains(QLatin1Char('{'))) {
codeFound = true;
@@ -692,6 +696,8 @@ int main(int argc, char ** argv)
// QQuickView if one was created. That case is tracked by
// QPointer, so it is safe to delete the component here.
delete component;
+ } else {
+ exitCode = 1;
}
}