From a59291393cc70a1f922e4796efbb72b29920da27 Mon Sep 17 00:00:00 2001
From: Yann Bodson <yann.bodson@nokia.com>
Date: Wed, 4 Nov 2009 15:32:26 +1000
Subject: less compile warnings

---
 src/declarative/qml/qmlcontextscriptclass.cpp |  1 +
 src/declarative/qml/qmlglobalscriptclass.cpp  | 19 ++++++++++---------
 src/declarative/qml/qmllistscriptclass.cpp    | 15 ++++++++++-----
 3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/src/declarative/qml/qmlcontextscriptclass.cpp b/src/declarative/qml/qmlcontextscriptclass.cpp
index 4615764..fda284a 100644
--- a/src/declarative/qml/qmlcontextscriptclass.cpp
+++ b/src/declarative/qml/qmlcontextscriptclass.cpp
@@ -219,6 +219,7 @@ QScriptValue QmlContextScriptClass::property(Object *object, const Identifier &n
 void QmlContextScriptClass::setProperty(Object *object, const Identifier &name, 
                                         const QScriptValue &value)
 {
+    Q_UNUSED(object);
     Q_ASSERT(lastScopeObject || lastDefaultObject != -1);
 
     QmlContext *bindContext = lastContext;
diff --git a/src/declarative/qml/qmlglobalscriptclass.cpp b/src/declarative/qml/qmlglobalscriptclass.cpp
index a9c5d3d..fd270e3 100644
--- a/src/declarative/qml/qmlglobalscriptclass.cpp
+++ b/src/declarative/qml/qmlglobalscriptclass.cpp
@@ -70,10 +70,10 @@ QmlGlobalScriptClass::queryProperty(const QScriptValue &object,
                                     const QScriptString &name,
                                     QueryFlags flags, uint *id)
 {
-    Q_UNUSED(object)
-    Q_UNUSED(name)
-    Q_UNUSED(flags)
-    Q_UNUSED(id)
+    Q_UNUSED(object);
+    Q_UNUSED(name);
+    Q_UNUSED(flags);
+    Q_UNUSED(id);
     return HandlesReadAccess | HandlesWriteAccess;
 }
 
@@ -82,9 +82,9 @@ QmlGlobalScriptClass::property(const QScriptValue &object,
                                const QScriptString &name, 
                                uint id)
 {
-    Q_UNUSED(object)
-    Q_UNUSED(name)
-    Q_UNUSED(id)
+    Q_UNUSED(object);
+    Q_UNUSED(name);
+    Q_UNUSED(id);
     return engine()->undefinedValue();
 }
 
@@ -92,8 +92,9 @@ void QmlGlobalScriptClass::setProperty(QScriptValue &object,
                                        const QScriptString &name,
                                        uint id, const QScriptValue &value)
 {
-    Q_UNUSED(object)
-    Q_UNUSED(value)
+    Q_UNUSED(object);
+    Q_UNUSED(id);
+    Q_UNUSED(value);
     QString error = QLatin1String("Invalid write to global property \"") + 
                     name.toString() + QLatin1String("\"");
     engine()->currentContext()->throwError(error);
diff --git a/src/declarative/qml/qmllistscriptclass.cpp b/src/declarative/qml/qmllistscriptclass.cpp
index f067db6..a180e49 100644
--- a/src/declarative/qml/qmllistscriptclass.cpp
+++ b/src/declarative/qml/qmllistscriptclass.cpp
@@ -54,6 +54,7 @@ QmlListScriptClass::QmlListScriptClass(QmlEngine *e)
 : QScriptDeclarativeClass(QmlEnginePrivate::getScriptEngine(e)), engine(e)
 {
     QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
+    Q_UNUSED(scriptEngine);
 
     m_lengthId = createPersistentIdentifier(QLatin1String("length"));
 }
@@ -81,6 +82,8 @@ QScriptClass::QueryFlags
 QmlListScriptClass::queryProperty(Object *object, const Identifier &name, 
                                   QScriptClass::QueryFlags flags)
 {
+    Q_UNUSED(object);
+    Q_UNUSED(flags);
     if (name == m_lengthId.identifier)
         return QScriptClass::HandlesReadAccess;
 
@@ -115,9 +118,11 @@ QScriptValue QmlListScriptClass::property(Object *obj, const Identifier &name)
     if (data->type == QListPtr) {
         const QList<QObject *> &qlist = *((QList<QObject *>*)list);
 
-        if (name == m_lengthId.identifier) 
-            return qlist.count();
-        else if (lastIndex < qlist.count())
+        quint32 count = qlist.count();
+
+        if (name == m_lengthId.identifier)
+            return count;
+        else if (lastIndex < count)
             return enginePriv->objectClass->newQObject(qlist.at(lastIndex));
         else
             return scriptEngine->undefinedValue();
@@ -126,9 +131,9 @@ QScriptValue QmlListScriptClass::property(Object *obj, const Identifier &name)
         Q_ASSERT(data->type == QmlListPtr);
         const QmlList<QObject *> &qmllist = *((QmlList<QObject *>*)list);
 
-        int count = qmllist.count();
+        quint32 count = qmllist.count();
 
-        if (name == m_lengthId.identifier) 
+        if (name == m_lengthId.identifier)
             return count;
         else if (lastIndex < count) 
             return enginePriv->objectClass->newQObject(qmllist.at(lastIndex));
-- 
cgit v0.12


From cc06fb21f890613c396936561501737a23d1cd9f Mon Sep 17 00:00:00 2001
From: Warwick Allison <warwick.allison@nokia.com>
Date: Wed, 4 Nov 2009 15:38:35 +1000
Subject: Ensure root object is at least created. Tweak for QTBUG-5296 (lots of
 other examples hang too though)

---
 tests/auto/declarative/examples/data/dummytest.qml             | 1 +
 tests/auto/declarative/examples/data/webbrowser/webbrowser.qml | 2 +-
 tests/auto/declarative/examples/tst_examples.cpp               | 5 +++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/auto/declarative/examples/data/dummytest.qml b/tests/auto/declarative/examples/data/dummytest.qml
index cd9d8fb..b20e907 100644
--- a/tests/auto/declarative/examples/data/dummytest.qml
+++ b/tests/auto/declarative/examples/data/dummytest.qml
@@ -2,4 +2,5 @@ import Qt.VisualTest 4.6
 
 VisualTest {
     Frame { msec: 0 }
+    Frame { msec: 10 }
 }
diff --git a/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml b/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml
index bdf3290..d31787b 100644
--- a/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml
+++ b/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml
@@ -2,5 +2,5 @@ import Qt.VisualTest 4.6
 
 VisualTest {
     Frame { msec: 0 }
-    Frame { msec: 1000 }
+    Frame { msec: 2000 }
 }
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index d758101..2cbb916 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -182,9 +182,10 @@ void tst_examples::examples()
 
     QFileInfo fi(file);
     QFileInfo dir(fi.path());
-    QFileInfo testdata("data/"+dir.baseName()+"/"+fi.baseName());
+    QString script = "data/"+dir.baseName()+"/"+fi.baseName();
+    QFileInfo testdata(script+".qml");
     QStringList arguments;
-    arguments << "-script" << (testdata.exists() ? testdata.filePath() : QLatin1String("data/dummytest"))
+    arguments << "-script" << (testdata.exists() ? script : QLatin1String("data/dummytest"))
               << "-scriptopts" << "play,testerror,exitoncomplete,exitonfailure" 
               << file;
     QProcess p;
-- 
cgit v0.12


From 9c817b7a6959a7c8bade12de71d3629fae9b5859 Mon Sep 17 00:00:00 2001
From: Warwick Allison <warwick.allison@nokia.com>
Date: Wed, 4 Nov 2009 16:15:58 +1000
Subject: Fix test.

---
 tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp
index 3e86cab..fc47d41 100644
--- a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp
+++ b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp
@@ -198,6 +198,8 @@ void tst_qmlgraphicstext::width()
 
     for (int i = 0; i < standard.size(); i++)
     {
+        QVERIFY(!Qt::mightBeRichText(standard.at(i))); // self-test
+
         QFont f;
         QFontMetrics fm(f);
         int metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width();
@@ -208,11 +210,13 @@ void tst_qmlgraphicstext::width()
 
         QVERIFY(textObject != 0);
         QCOMPARE(textObject->width(), qreal(metricWidth));
-        QVERIFY(textObject->textFormat() == QmlGraphicsText::PlainText);
+        QVERIFY(textObject->textFormat() == QmlGraphicsText::AutoText); // setting text doesn't change format
     }
 
     for (int i = 0; i < richText.size(); i++)
     {
+        QVERIFY(Qt::mightBeRichText(richText.at(i))); // self-test
+
         QTextDocument document;
         document.setHtml(richText.at(i));
         document.setDocumentMargin(0);
@@ -225,7 +229,7 @@ void tst_qmlgraphicstext::width()
 
         QVERIFY(textObject != 0);
         QCOMPARE(textObject->width(), qreal(documentWidth));
-        QVERIFY(textObject->textFormat() == QmlGraphicsText::RichText);
+        QVERIFY(textObject->textFormat() == QmlGraphicsText::AutoText); // setting text doesn't change format
     }
 }
 
-- 
cgit v0.12


From 69d16760470d2ae7e84e4612996714a0ba874017 Mon Sep 17 00:00:00 2001
From: Warwick Allison <warwick.allison@nokia.com>
Date: Wed, 4 Nov 2009 16:33:16 +1000
Subject: Fix "initial" size for remote content. See also
 91be655a7e893d34fdbdb71aa5a329b641c80992

---
 tools/qmlviewer/qmlviewer.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp
index b9f3e67..b6a3627 100644
--- a/tools/qmlviewer/qmlviewer.cpp
+++ b/tools/qmlviewer/qmlviewer.cpp
@@ -366,7 +366,7 @@ QmlViewer::QmlViewer(QWidget *parent, Qt::WindowFlags flags)
 
 void QmlViewer::adjustSizeSlot()
 {
-    adjustSize();
+    resize(sizeHint());
 }
 
 QMenuBar *QmlViewer::menuBar() const
@@ -722,7 +722,7 @@ void QmlViewer::openQml(const QString& file_or_url)
         canvas->updateGeometry();
         if (mb)
             mb->updateGeometry();
-        adjustSize();
+        resize(sizeHint());
     } else {
         if (scaleSkin)
             canvas->resize(canvas->sizeHint());
-- 
cgit v0.12


From 86faae02ffa0067b46b22043cb138230451387ac Mon Sep 17 00:00:00 2001
From: Warwick Allison <warwick.allison@nokia.com>
Date: Wed, 4 Nov 2009 16:42:38 +1000
Subject: Fix 5f19daab6baba7d09853058355a66090a3781430

---
 tools/qmlviewer/qfxtester.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/qmlviewer/qfxtester.cpp b/tools/qmlviewer/qfxtester.cpp
index 287771b..dfa628d 100644
--- a/tools/qmlviewer/qfxtester.cpp
+++ b/tools/qmlviewer/qfxtester.cpp
@@ -306,17 +306,15 @@ void QmlGraphicsTester::updateCurrentTime(int msec)
         QObject *event = testscript->event(testscriptidx);
 
         if (QmlGraphicsVisualTestFrame *frame = qobject_cast<QmlGraphicsVisualTestFrame *>(event)) {
-            if ((options & QmlViewer::TestImages) && (options & QmlViewer::Record))
-                break; // recording and playing, no point "testing" results
             if (frame->msec() < msec) {
-                if (options & QmlViewer::TestImages) {
+                if (options & QmlViewer::TestImages && !(options & QmlViewer::Record)) {
                     qWarning() << "QmlGraphicsTester: Extra frame.  Seen:" 
                                << msec << "Expected:" << frame->msec();
                     imagefailure();
                 }
             } else if (frame->msec() == msec) {
                 if (!frame->hash().isEmpty() && frame->hash().toUtf8() != fe.hash.toHex()) {
-                    if (options & QmlViewer::TestImages) {
+                    if (options & QmlViewer::TestImages && !(options & QmlViewer::Record)) {
                         qWarning() << "QmlGraphicsTester: Mismatched frame hash.  Seen:" 
                                    << fe.hash.toHex() << "Expected:" 
                                    << frame->hash().toUtf8();
@@ -327,7 +325,7 @@ void QmlGraphicsTester::updateCurrentTime(int msec)
                 break;
             }
 
-            if (options & QmlViewer::TestImages && !frame->image().isEmpty()) {
+            if (options & QmlViewer::TestImages && !(options & QmlViewer::Record) && !frame->image().isEmpty()) {
                 QImage goodImage(frame->image().toLocalFile());
                 if (goodImage != img) {
                     QString reject(frame->image().toLocalFile() + ".reject.png");
-- 
cgit v0.12