From 68073bbcde2d1b12d36f0c58aab1fc20f02ab967 Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Fri, 18 Jun 2010 13:31:50 +0200
Subject: qdoc: Added a workaround for QML/Qt class name clashes.

Reviewed-by: Trust Me
---
 tools/qdoc3/codemarker.cpp    | 12 +++++++++++-
 tools/qdoc3/cppcodeparser.cpp |  7 ++++++-
 tools/qdoc3/node.cpp          | 13 ++++++++++++-
 tools/qdoc3/node.h            |  6 +++---
 tools/qdoc3/pagegenerator.cpp |  3 ++-
 tools/qdoc3/tree.cpp          | 10 +++++++---
 6 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp
index 818a91f..33ceaf5 100644
--- a/tools/qdoc3/codemarker.cpp
+++ b/tools/qdoc3/codemarker.cpp
@@ -257,6 +257,7 @@ QString CodeMarker::typified(const QString &string)
 QString CodeMarker::taggedNode(const Node* node)
 {
     QString tag;
+    QString name = node->name();
 
     switch (node->type()) {
     case Node::Namespace:
@@ -277,11 +278,20 @@ QString CodeMarker::taggedNode(const Node* node)
     case Node::Property:
         tag = QLatin1String("@property");
         break;
+#ifdef QDOC_QML
+    case Node::Fake:
+        if (node->subType() == Node::QmlClass) {
+            if (node->name().startsWith(QLatin1String("QML:")))
+                name = name.mid(4);                 // remove the "QML:" prefix
+        }
+        tag = QLatin1String("@property");
+        break;
+#endif
     default:
         tag = QLatin1String("@unknown");
         break;
     }
-    return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name())
+    return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name)
         + QLatin1String("</") + tag + QLatin1Char('>');
 }
 
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 13678af..caee30b 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -728,7 +728,10 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
             if (n)
                 classNode = static_cast<const ClassNode*>(n);
         }
-        return new QmlClassNode(tre->root(), names[0], classNode);
+        if (names[0].startsWith("Q"))
+            return new QmlClassNode(tre->root(), QLatin1String("QML:")+names[0], classNode);
+        else
+            return new QmlClassNode(tre->root(), names[0], classNode);
     }
     else if (command == COMMAND_QMLBASICTYPE) {
 #if 0
@@ -752,6 +755,8 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc,
         QString type;
         QmlClassNode* qmlClass = 0;
         if (splitQmlMethodArg(doc,arg,type,element)) {
+            if (element.startsWith(QLatin1String("Q")))
+                element = QLatin1String("QML:") + element;
             Node* n = tre->findNode(QStringList(element),Node::Fake);
             if (n && n->subType() == Node::QmlClass) {
                 qmlClass = static_cast<QmlClassNode*>(n);
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 4664e9d..6a87639 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -871,6 +871,14 @@ FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subtype)
 }
 
 /*!
+  Returns the fake node's title. This is used for the page title.
+*/
+QString FakeNode::title() const
+{
+    return tle;
+}
+
+/*!
   Returns the fake node's full title, which is usually
   just title(), but for some SubType values is different
   from title()
@@ -1324,7 +1332,10 @@ QmlClassNode::QmlClassNode(InnerNode *parent,
                            const ClassNode* cn)
     : FakeNode(parent, name, QmlClass), cnode(cn)
 {
-    setTitle((qmlOnly ? "" : "QML ") + name + " Element");
+    if (name.startsWith(QLatin1String("QML:")))
+        setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name.mid(4) + QLatin1String(" Element"));
+    else
+        setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name + QLatin1String(" Element"));
 }
 
 /*!
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 523394d..90295ee 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -362,9 +362,9 @@ class FakeNode : public InnerNode
     void addGroupMember(Node *node) { gr.append(node); }
 
     SubType subType() const { return sub; }
-    QString title() const { return tle; }
-    QString fullTitle() const;
-    QString subTitle() const;
+    virtual QString title() const;
+    virtual QString fullTitle() const;
+    virtual QString subTitle() const;
     const NodeList &groupMembers() const { return gr; }
     virtual QString nameForLists() const { return title(); }
 
diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp
index cd364ef..a187c2e 100644
--- a/tools/qdoc3/pagegenerator.cpp
+++ b/tools/qdoc3/pagegenerator.cpp
@@ -209,7 +209,8 @@ QString PageGenerator::fileBase(const Node *node) const
          */
         if ((p->subType() == Node::QmlClass) ||
             (p->subType() == Node::QmlBasicType)) {
-            base.prepend("qml-");
+            if (!base.startsWith(QLatin1String("QML:")))
+                base.prepend("qml-");
         }
 #endif        
         if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake)
diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp
index 31bbf54..d31de4d 100644
--- a/tools/qdoc3/tree.cpp
+++ b/tools/qdoc3/tree.cpp
@@ -1952,9 +1952,13 @@ QString Tree::fullDocumentLocation(const Node *node) const
     else if (node->type() == Node::Fake) {
 #ifdef QDOC_QML
         if ((node->subType() == Node::QmlClass) ||
-            (node->subType() == Node::QmlBasicType))
-            return "qml-" + node->fileBase() + ".html";
-        else
+            (node->subType() == Node::QmlBasicType)) {
+            QString fb = node->fileBase();
+            if (fb.startsWith(QLatin1String("QML:")))
+                return node->fileBase() + ".html";
+            else
+                return "qml-" + node->fileBase() + ".html";
+        } else
 #endif
         parentName = node->fileBase() + ".html";
     }
-- 
cgit v0.12


From 5b71c12c8ddb60bdc740fe7e3034cc5189d63f7e Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Fri, 18 Jun 2010 13:36:56 +0200
Subject: Doc: Changed links to explicitly refer to QML objects.

Reviewed-by: Trust Me
---
 src/declarative/qml/qdeclarativeengine.cpp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 5c4d229..86053c4 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -183,11 +183,11 @@ data types. This is primarily useful when setting the properties of an item
 when the property has one of the following types:
 
 \list
-\o \c color - use \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()}, \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()}
-\o \c rect - use \l{Qt::rect()}{Qt.rect()}
-\o \c point - use \l{Qt::point()}{Qt.point()}
-\o \c size - use \l{Qt::size()}{Qt.size()}
-\o \c vector3d - use \l{Qt::vector3d()}{Qt.vector3d()}
+\o \c color - use \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()}, \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()}
+\o \c rect - use \l{QML:Qt::rect()}{Qt.rect()}
+\o \c point - use \l{QML:Qt::point()}{Qt.point()}
+\o \c size - use \l{QML:Qt::size()}{Qt.size()}
+\o \c vector3d - use \l{QML:Qt::vector3d()}{Qt.vector3d()}
 \endlist
 
 There are also string based constructors for these types. See \l{qdeclarativebasictypes.html}{QML Basic Types} for more information.
@@ -197,12 +197,12 @@ There are also string based constructors for these types. See \l{qdeclarativebas
 The Qt object contains several functions for formatting dates and times.
 
 \list
-    \o \l{Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
-    \o \l{Qt::formatDate}{string Qt.formatDate(datetime date, variant format)}
-    \o \l{Qt::formatTime}{string Qt.formatTime(datetime date, variant format)}
+    \o \l{QML:Qt::formatDateTime}{string Qt.formatDateTime(datetime date, variant format)}
+    \o \l{QML:Qt::formatDate}{string Qt.formatDate(datetime date, variant format)}
+    \o \l{QML:Qt::formatTime}{string Qt.formatTime(datetime date, variant format)}
 \endlist
 
-The format specification is described at \l{Qt::formatDateTime}{Qt.formatDateTime}.
+The format specification is described at \l{QML:Qt::formatDateTime}{Qt.formatDateTime}.
 
 
 \section1 Dynamic Object Creation
@@ -211,8 +211,8 @@ items from files or strings. See \l{Dynamic Object Management} for an overview
 of their use.
 
 \list
-    \o \l{Qt::createComponent()}{object Qt.createComponent(url)}
-    \o \l{Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)}
+    \o \l{QML:Qt::createComponent()}{object Qt.createComponent(url)}
+    \o \l{QML:Qt::createQmlObject()}{object Qt.createQmlObject(string qml, object parent, string filepath)}
 \endlist
 */
 
-- 
cgit v0.12


From ba76a029b9e6970ff5785ebfc65fa9e5b50ddb17 Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Fri, 18 Jun 2010 15:26:48 +0200
Subject: Doc: Fixed links in the QML documentation.

Reviewed-by: Trust Me
---
 doc/src/declarative/basictypes.qdoc     | 16 ++++++++--------
 doc/src/declarative/dynamicobjects.qdoc | 14 +++++++-------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc
index 87dab81..4beee08 100644
--- a/doc/src/declarative/basictypes.qdoc
+++ b/doc/src/declarative/basictypes.qdoc
@@ -171,8 +171,8 @@
     Rectangle { color: "#800000FF" }
     \endqml
 
-    Or with the \l{Qt::rgba()}{Qt.rgba()}, \l{Qt::hsla()}{Qt.hsla()}, \l{Qt::darker()}{Qt.darker()},
-    \l{Qt::lighter()}{Qt.lighter()} or \l{Qt::tint()}{Qt.tint()} functions:
+    Or with the \l{QML:Qt::rgba()}{Qt.rgba()}, \l{QML:Qt::hsla()}{Qt.hsla()}, \l{QML:Qt::darker()}{Qt.darker()},
+    \l{QML:Qt::lighter()}{Qt.lighter()} or \l{QML:Qt::tint()}{Qt.tint()} functions:
 
     \qml
     Rectangle { color: Qt.rgba(255, 0, 0, 1) }
@@ -195,7 +195,7 @@
     CustomObject { myPointProperty: "0,20" }
     \endqml
 
-    Or use the \l{Qt::point()}{Qt.point()} function:
+    Or use the \l{QML:Qt::point()}{Qt.point()} function:
 
     \qml
     CustomObject { myPointProperty: Qt.point(0, 20) }
@@ -227,7 +227,7 @@
     LayoutItem { preferredSize: "150x50" }
     \endqml
 
-    Or use the \l{Qt::size()}{Qt.size()} function:
+    Or use the \l{QML:Qt::size()}{Qt.size()} function:
 
     \qml
     LayoutItem { preferredSize: Qt.size(150, 50) }
@@ -260,7 +260,7 @@
     CustomObject { myRectProperty: "50,50,100x100" }
     \endqml
 
-    Or use the \l{Qt::rect()}{Qt.rect()} function:
+    Or use the \l{QML:Qt::rect()}{Qt.rect()} function:
 
     \qml
     CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
@@ -283,7 +283,7 @@
     \endqml
 
     To read a date value returned from a C++ extension class, use 
-    \l{Qt::formatDate()}{Qt.formatDate()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+    \l{QML:Qt::formatDate()}{Qt.formatDate()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
 
     \sa {QML Basic Types}
 */
@@ -302,7 +302,7 @@
     \endqml
 
     To read a time value returned from a C++ extension class, use 
-    \l{Qt::formatTime()}{Qt.formatTime()} and \l{Qt::formatDateTime()}{Qt.formatDateTime()}.
+    \l{QML:Qt::formatTime()}{Qt.formatTime()} and \l{QML:Qt::formatDateTime()}{Qt.formatDateTime()}.
 
     \sa {QML Basic Types}
  */
@@ -400,7 +400,7 @@
     Rotation { angle: 60; axis: "0,1,0" }
     \endqml
 
-    or with the \l{Qt::vector3d()}{Qt.vector3d()} function:
+    or with the \l{QML:Qt::vector3d()}{Qt.vector3d()} function:
 
     \qml
     Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }
diff --git a/doc/src/declarative/dynamicobjects.qdoc b/doc/src/declarative/dynamicobjects.qdoc
index 5e606f4..edce3f2 100644
--- a/doc/src/declarative/dynamicobjects.qdoc
+++ b/doc/src/declarative/dynamicobjects.qdoc
@@ -56,15 +56,15 @@ application, and there are no C++ components involved.
 
 \section1 Creating Objects Dynamically
 There are two ways to create objects dynamically from JavaScript. You can either call 
-\l {Qt::createComponent()}{Qt.createComponent()} to create
-a component which instantiates items, or use \l{Qt::createQmlObject()}{Qt.createQmlObject()}
+\l {QML:Qt::createComponent()}{Qt.createComponent()} to create
+a component which instantiates items, or use \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
 to create an item from a string of QML.
 Creating a component is better if you have a predefined
 item, and you want to create dynamic instances of that item; creating an item from
 a string of QML is useful when the item QML itself is generated at runtime.
 
 If you have a component specified in a QML file, you can dynamically load it with
-the \l {Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}. 
+the \l {QML:Qt::createComponent()}{Qt.createComponent()} function on the \l{QML Global Object}. 
 This function takes the URL of the QML file as its only argument and returns
 a component object which can be used to create and load that QML file.
 
@@ -98,10 +98,10 @@ in \c main.qml). After creating an item, you must set its parent to an item with
 Otherwise your dynamically created item will not appear in the scene.
 
 When using files with relative paths, the path should
-be relative to the file where \l {Qt::createComponent()}{Qt.createComponent()} is executed.
+be relative to the file where \l {QML:Qt::createComponent()}{Qt.createComponent()} is executed.
 
 If the QML component does not exist until runtime, you can create a QML item from
-a string of QML using the \l{Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
+a string of QML using the \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()} function, as in the following example:
 
 \snippet doc/src/snippets/declarative/createQmlObject.qml 0
 
@@ -121,9 +121,9 @@ the bindings in the dynamic item will no longer work.
 The actual creation context depends on how an item is created:
 
 \list
-\o If \l {Qt::createComponent()}{Qt.createComponent()} is used, the creation context
+\o If \l {QML:Qt::createComponent()}{Qt.createComponent()} is used, the creation context
    is the QDeclarativeContext in which this method is called
-\o If \l{Qt::createQmlObject()}{Qt.createQmlObject()}
+\o If \l{QML:Qt::createQmlObject()}{Qt.createQmlObject()}
    if called, it is the context of the item used as the second argument to this method
 \o If a \c {Component{}} item is defined and \l {Component::createObject()}{createObject()}
    is called on that item, it is the context in which the \c Component is defined
-- 
cgit v0.12


From 65f2273f43bfca718ee51e8d491c76ef830238f7 Mon Sep 17 00:00:00 2001
From: Aleksandar Sasha Babic <aleksandar.babic@nokia.com>
Date: Fri, 18 Jun 2010 17:24:18 +0200
Subject: Debug prints and another attempt to fix QTBUG-8687 for N8.

---
 src/network/kernel/qhostinfo_unix.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index df98d5d..79f4b9b 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -208,12 +208,19 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
 #ifdef Q_ADDRCONFIG
     hints.ai_flags = Q_ADDRCONFIG;
 #endif
+#ifdef Q_OS_SYMBIAN
+    qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+#endif
 
     int result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
 # ifdef Q_ADDRCONFIG
     if (result == EAI_BADFLAGS) {
         // if the lookup failed with AI_ADDRCONFIG set, try again without it
         hints.ai_flags = 0;
+#ifdef Q_OS_SYMBIAN
+        qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+        hints.ai_flags &= AI_V4MAPPED | AI_ALL;
+#endif
         result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
     }
 # endif
@@ -222,6 +229,8 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
         addrinfo *node = res;
         QList<QHostAddress> addresses;
         while (node) {
+            qDebug() << "getaddrinfo node: flags:" << node->ai_flags << "family:" << node->ai_family << "ai_socktype:" << node->ai_socktype << "ai_protocol:" << node->ai_protocol << "ai_addrlen:" << node->ai_addrlen;
+
             if (node->ai_family == AF_INET) {
                 QHostAddress addr;
                 addr.setAddress(ntohl(((sockaddr_in *) node->ai_addr)->sin_addr.s_addr));
-- 
cgit v0.12


From 2ee850be142dbdc47ba9611c94cd9bd47792a67a Mon Sep 17 00:00:00 2001
From: Aleksandar Sasha Babic <aleksandar.babic@nokia.com>
Date: Fri, 18 Jun 2010 17:25:56 +0200
Subject: Fix QTBUG-8687.

The fix is based on 9897aece975e0a4a77e0cc6b8590305baba1fccb.

Task-number: QTBUG-8687
Reviewed-by: TrustMe
---
 src/network/kernel/qhostinfo_unix.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 79f4b9b..9139816 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -209,7 +209,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
     hints.ai_flags = Q_ADDRCONFIG;
 #endif
 #ifdef Q_OS_SYMBIAN
-    qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+#   ifdef QHOSTINFO_DEBUG
+        qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+#   endif
 #endif
 
     int result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
@@ -218,7 +220,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
         // if the lookup failed with AI_ADDRCONFIG set, try again without it
         hints.ai_flags = 0;
 #ifdef Q_OS_SYMBIAN
+#   ifdef QHOSTINFO_DEBUG
         qDebug() << "Setting flags: 'hints.ai_flags &= AI_V4MAPPED | AI_ALL'";
+#   endif
         hints.ai_flags &= AI_V4MAPPED | AI_ALL;
 #endif
         result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
@@ -229,8 +233,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
         addrinfo *node = res;
         QList<QHostAddress> addresses;
         while (node) {
-            qDebug() << "getaddrinfo node: flags:" << node->ai_flags << "family:" << node->ai_family << "ai_socktype:" << node->ai_socktype << "ai_protocol:" << node->ai_protocol << "ai_addrlen:" << node->ai_addrlen;
-
+#ifdef QHOSTINFO_DEBUG
+                qDebug() << "getaddrinfo node: flags:" << node->ai_flags << "family:" << node->ai_family << "ai_socktype:" << node->ai_socktype << "ai_protocol:" << node->ai_protocol << "ai_addrlen:" << node->ai_addrlen;
+#endif
             if (node->ai_family == AF_INET) {
                 QHostAddress addr;
                 addr.setAddress(ntohl(((sockaddr_in *) node->ai_addr)->sin_addr.s_addr));
-- 
cgit v0.12


From 074aaf9901567c9c66eeca20514c78419e2016bb Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Sun, 20 Jun 2010 13:08:22 +0200
Subject: Updated WebKit from /home/shausman/src/webkit/trunk to
 qtwebkit/qtwebkit-4.6 ( be1a105be93d7fcbe36d93d0827dc6e98b55de0c )

Changes in WebKit/qt since the last update:

* https://bugs.webkit.org/show_bug.cgi?id=40567 -- [Qt] QtWebKit crashes while initializing flash plugin 10.1.53.64.
---
 src/3rdparty/webkit/VERSION                        |  2 +-
 src/3rdparty/webkit/WebCore/ChangeLog              | 13 ++++++++++++
 .../webkit/WebCore/plugins/qt/PluginPackageQt.cpp  | 23 ++++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 482982d..1b8e789 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
 
 and has the sha1 checksum
 
-        a13977ce2aba31808a046cddc082a84dc316d78b
+        be1a105be93d7fcbe36d93d0827dc6e98b55de0c
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 63af196..8a75d6b 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-06-16  Dawit Alemayehu  <adawit@kde.org>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] QtWebKit crashes while initializing flash plugin 10.1.53.64.
+        https://bugs.webkit.org/show_bug.cgi?id=40567
+
+        Avoid preventable crashes by ensuring gtk_init() is called in the
+        flash viewer plugins before calling NP_Initialize.
+
+        * plugins/qt/PluginPackageQt.cpp:
+        (WebCore::PluginPackage::load):
+
 2010-06-10  Raine Makelainen  <raine.makelainen@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp
index 8119924..4ff520b 100644
--- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp
@@ -35,6 +35,8 @@
 
 namespace WebCore {
 
+typedef void gtkInitFunc(int *argc, char ***argv);
+
 bool PluginPackage::fetchInfo()
 {
     if (!load())
@@ -109,6 +111,7 @@ bool PluginPackage::load()
 
     NP_InitializeFuncPtr NP_Initialize;
     NPError npErr;
+    gtkInitFunc* gtkInit;
 
     NP_Initialize = (NP_InitializeFuncPtr)m_module->resolve("NP_Initialize");
     m_NPP_Shutdown = (NPP_ShutdownProcPtr)m_module->resolve("NP_Shutdown");
@@ -127,6 +130,26 @@ bool PluginPackage::load()
         m_browserFuncs.getvalue = staticPluginQuirkRequiresGtkToolKit_NPN_GetValue;
     }
 
+    // WORKAROUND: Prevent gtk based plugin crashes such as BR# 40567 by
+    // explicitly forcing the initializing of Gtk, i.e. calling gtk_init,
+    // whenver the symbol is present in the plugin library loaded above.
+    // Note that this workaround is based on code from the NSPluginClass ctor
+    // in KDE's kdebase/apps/nsplugins/viewer/nsplugin.cpp file.
+    gtkInit = (gtkInitFunc*)m_module->resolve("gtk_init");
+    if (gtkInit) {
+        // Prevent gtk_init() from replacing the X error handlers, since the Gtk
+        // handlers abort when they receive an X error, thus killing the viewer.
+#ifdef Q_WS_X11
+        int (*old_error_handler)(Display*, XErrorEvent*) = XSetErrorHandler(0);
+        int (*old_io_error_handler)(Display*) = XSetIOErrorHandler(0);
+#endif
+        gtkInit(0, 0);
+#ifdef Q_WS_X11
+        XSetErrorHandler(old_error_handler);
+        XSetIOErrorHandler(old_io_error_handler);
+#endif
+    }
+
 #if defined(XP_UNIX)
     npErr = NP_Initialize(&m_browserFuncs, &m_pluginFuncs);
 #else
-- 
cgit v0.12


From 5c0462be41c7bad7a3e3ef08105fc1ca60d82e44 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Sun, 20 Jun 2010 22:12:43 +0200
Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to
 ab9a897b688e991a8405cf938dea9d6a2f1ac072

From Andreas Kling <andreas.kling@nokia.com>:
*   Unbreak _HB_OPEN_Get_Device() and Get_ValueRecord()
---
 src/3rdparty/harfbuzz/src/harfbuzz-gpos.c         | 25 ++++++-----------------
 src/3rdparty/harfbuzz/src/harfbuzz-open-private.h |  2 +-
 src/3rdparty/harfbuzz/src/harfbuzz-open.c         | 14 +------------
 3 files changed, 8 insertions(+), 33 deletions(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index d71a85e..31b9ae1 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -500,34 +500,24 @@ static HB_Error  Get_ValueRecord( GPOS_Instance*    gpi,
   {
     /* pixel -> fractional pixel */
 
-    if ( format & HB_GPOS_FORMAT_HAVE_DEVICE_TABLES )
-    {
-      if ( ALLOC_ARRAY( vr->DeviceTables, 4, HB_Device ) )
-        return error;
-      vr->DeviceTables[VR_X_ADVANCE_DEVICE] = 0;
-      vr->DeviceTables[VR_Y_ADVANCE_DEVICE] = 0;
-      vr->DeviceTables[VR_X_PLACEMENT_DEVICE] = 0;
-      vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] = 0;
-    }
-
     if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
     {
-      _HB_OPEN_Get_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE], x_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( vr->DeviceTables[VR_X_PLACEMENT_DEVICE], x_ppem, &pixel_value );
       gd->x_pos += pixel_value << 6;
     }
     if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
     {
-      _HB_OPEN_Get_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], y_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], y_ppem, &pixel_value );
       gd->y_pos += pixel_value << 6;
     }
     if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
     {
-      _HB_OPEN_Get_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE], x_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( vr->DeviceTables[VR_X_ADVANCE_DEVICE], x_ppem, &pixel_value );
       gd->x_advance += pixel_value << 6;
     }
     if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
     {
-      _HB_OPEN_Get_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE], y_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( vr->DeviceTables[VR_Y_ADVANCE_DEVICE], y_ppem, &pixel_value );
       gd->y_advance += pixel_value << 6;
     }
   }
@@ -779,12 +769,9 @@ static HB_Error  Get_Anchor( GPOS_Instance*   gpi,
   case 3:
     if ( !gpi->dvi )
     {
-      if ( ALLOC_ARRAY( an->af.af3.DeviceTables, 2, HB_Device ) )
-        return error;
-
-      _HB_OPEN_Get_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE], x_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE], x_ppem, &pixel_value );
       *x_value = pixel_value << 6;
-      _HB_OPEN_Get_Device( &an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE], y_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE], y_ppem, &pixel_value );
       *y_value = pixel_value << 6;
     }
     else
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h
index 1f7b353..65ca453 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h
@@ -93,7 +93,7 @@ _HB_OPEN_Get_Class( HB_ClassDefinition* cd,
 		    HB_UShort*          klass,
 		     HB_UShort*            index );
 HB_INTERNAL HB_Error
-_HB_OPEN_Get_Device( HB_Device** d,
+_HB_OPEN_Get_Device( HB_Device* d,
 		      HB_UShort    size,
 		      HB_Short*    value );
 
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.c b/src/3rdparty/harfbuzz/src/harfbuzz-open.c
index 255b7e6..adc6cec 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-open.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.c
@@ -1399,21 +1399,11 @@ _HB_OPEN_Free_Device( HB_Device** d )
      mask = 0x00FF                                    */
 
 HB_INTERNAL HB_Error
-_HB_OPEN_Get_Device( HB_Device** device,
+_HB_OPEN_Get_Device( HB_Device* d,
 		      HB_UShort    size,
 		      HB_Short*    value )
 {
-  HB_Device* d;
   HB_UShort  byte, bits, mask, f, s;
-  HB_Error   error;
-
-  if ( ALLOC( *device, sizeof(HB_Device)) )
-  {
-    *device = 0;
-    return error;
-  }
-
-  d = *device;
 
   f = d->DeltaFormat;
 
@@ -1436,8 +1426,6 @@ _HB_OPEN_Get_Device( HB_Device** device,
   else
   {
     *value = 0;
-    FREE( *device );
-    *device = 0;
     return HB_Err_Not_Covered;
   }
 }
-- 
cgit v0.12


From 3a9ca8ba50a63e564c15023f65cbac36d365d309 Mon Sep 17 00:00:00 2001
From: Aleksandar Sasha Babic <aleksandar.babic@nokia.com>
Date: Mon, 21 Jun 2010 10:41:26 +0200
Subject: Fixing race condition in qeventdispatcher_symbian.cpp code path

Fixing QT-3496. There was race condition for m_AOStatuses between
external and QSelectThread.

Task-number: QT-3496
Reviewed-by: TrustMe
---
 src/corelib/kernel/qeventdispatcher_symbian.cpp | 101 ++++++++++++++----------
 src/corelib/kernel/qeventdispatcher_symbian_p.h |   5 ++
 2 files changed, 66 insertions(+), 40 deletions(-)

diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index d00a623..75b7619 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -114,9 +114,13 @@ public:
         // is in select call
         if (m_selectCallMutex->tryLock()) {
             m_selectCallMutex->unlock();
+
+            //m_threadMutex->lock();
+            //bHasThreadLock = true;
             return;
         }
 
+
         char dummy = 0;
         qt_pipe_write(fd, &dummy, 1);
 
@@ -405,11 +409,14 @@ void QSelectThread::run()
         FD_ZERO(&exceptionfds);
 
         int maxfd = 0;
-        maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Read, &readfds));
-        maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Write, &writefds));
-        maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Exception, &exceptionfds));
-        maxfd = qMax(maxfd, m_pipeEnds[0]);
-        maxfd++;
+        {
+            QMutexLocker asoLocker(&m_AOStatusesMutex);
+            maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Read, &readfds));
+            maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Write, &writefds));
+            maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Exception, &exceptionfds));
+            maxfd = qMax(maxfd, m_pipeEnds[0]);
+            maxfd++;
+        }
 
         FD_SET(m_pipeEnds[0], &readfds);
 
@@ -454,40 +461,42 @@ void QSelectThread::run()
                 FD_ZERO(&readfds);
                 FD_ZERO(&writefds);
                 FD_ZERO(&exceptionfds);
-                for (QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
-                        i != m_AOStatuses.end(); ++i) {
+                {
+                    QMutexLocker asoLocker(&m_AOStatusesMutex);
+                    for (QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
+                            i != m_AOStatuses.end(); ++i) {
 
-                    fd_set onefds;
-                    FD_ZERO(&onefds);
-                    FD_SET(i.key()->socket(), &onefds);
+                       fd_set onefds;
+                       FD_ZERO(&onefds);
+                       FD_SET(i.key()->socket(), &onefds);
 
-                    fd_set excfds;
-                    FD_ZERO(&excfds);
-                    FD_SET(i.key()->socket(), &excfds);
+                       fd_set excfds;
+                       FD_ZERO(&excfds);
+                       FD_SET(i.key()->socket(), &excfds);
 
-                    maxfd = i.key()->socket() + 1;
+                        maxfd = i.key()->socket() + 1;
 
-                    struct timeval timeout;
-                    timeout.tv_sec = 0;
-                    timeout.tv_usec = 0;
+                        struct timeval timeout;
+                        timeout.tv_sec = 0;
+                        timeout.tv_usec = 0;
 
-                    ret = 0;
+                        ret = 0;
 
-                    if(i.key()->type() == QSocketNotifier::Read) {
-                        ret = ::select(maxfd, &onefds, 0, &excfds, &timeout);
-                        if(ret != 0) FD_SET(i.key()->socket(), &readfds);
-                    } else if(i.key()->type() == QSocketNotifier::Write) {
-                        ret = ::select(maxfd, 0, &onefds, &excfds, &timeout);
-                        if(ret != 0) FD_SET(i.key()->socket(), &writefds);
-                    }
+                        if(i.key()->type() == QSocketNotifier::Read) {
+                            ret = ::select(maxfd, &onefds, 0, &excfds, &timeout);
+                            if(ret != 0) FD_SET(i.key()->socket(), &readfds);
+                        } else if(i.key()->type() == QSocketNotifier::Write) {
+                            ret = ::select(maxfd, 0, &onefds, &excfds, &timeout);
+                            if(ret != 0) FD_SET(i.key()->socket(), &writefds);
+                        }
 
-                } // end for
-
-                // traversed all, so update
-                updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
-                updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
-                updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
+                    } // end for
 
+                    // traversed all, so update
+                    updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
+                    updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
+                    updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
+                }
                 break;
             case EINTR: // Should never occur on Symbian, but this is future proof!
             default:
@@ -496,9 +505,12 @@ void QSelectThread::run()
                 break;
             }
         } else {
-            updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
-            updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
-            updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
+            {
+                QMutexLocker asoLocker(&m_AOStatusesMutex);
+                updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
+                updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
+                updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
+            }
         }
 
         m_waitCond.wait(&m_mutex);
@@ -517,11 +529,15 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
 
     QMutexLocker locker(&m_grabberMutex);
 
-    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
-
-    Q_ASSERT(!m_AOStatuses.contains(notifier));
+    {
+        // first do the thing
+        QMutexLocker aosLocker(&m_AOStatusesMutex); 
+        Q_ASSERT(!m_AOStatuses.contains(notifier));
+        m_AOStatuses.insert(notifier, status);
+    }
 
-    m_AOStatuses.insert(notifier, status);
+    // and now tell it to the others
+    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
 
     m_waitCond.wakeAll();
 }
@@ -530,9 +546,14 @@ void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
 {
     QMutexLocker locker(&m_grabberMutex);
 
-    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+    {
+        // first do the thing
+        QMutexLocker aosLocker(&m_AOStatusesMutex);
+        m_AOStatuses.remove(notifier);
+    }
 
-    m_AOStatuses.remove(notifier);
+    // and now tell it to the others
+    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
 
     m_waitCond.wakeAll();
 }
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 7021314..68d5833 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -231,6 +231,11 @@ private:
     // causes later in locking
     // of the thread in waitcond
     QMutex m_selectCallMutex;
+
+    // Argh ... not again
+    // one more unprotected
+    // resource is m_AOStatuses
+    QMutex m_AOStatusesMutex;
 };
 
 class Q_CORE_EXPORT CQtActiveScheduler : public CActiveScheduler
-- 
cgit v0.12


From 41e284f14ff0c8f9a0e0ca55c4b547dec0d9c09a Mon Sep 17 00:00:00 2001
From: Andy Shaw <qt-info@nokia.com>
Date: Mon, 21 Jun 2010 14:18:00 +0200
Subject: Prevent warnings about EPOCROOT coming out when not on symbian

When the pro file is processed with qmake and it EPOCROOT is not set
then it will give out warnings.  This is really only an issue when
configure on X11 is ran because this runs qmake on all pro files
anyway.

So rather than confusing users about what this warning message means on
a non Symbian platform, we just ensure that the pro file specifically
only does anything useful on Symbian platforms.

Reviewed-by: Gareth Stockwell
---
 src/plugins/phonon/mmf/mmf.pro | 250 ++++++++++++++++++++---------------------
 1 file changed, 125 insertions(+), 125 deletions(-)

diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro
index da41f18..7a6fdf8 100644
--- a/src/plugins/phonon/mmf/mmf.pro
+++ b/src/plugins/phonon/mmf/mmf.pro
@@ -1,127 +1,127 @@
 # MMF Phonon backend
-
-QT += phonon
-TARGET = phonon_mmf
-PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf
-
-# Uncomment the following line in order to use the CDrmPlayerUtility client
-# API for audio playback, rather than CMdaAudioPlayerUtility.
-#CONFIG += phonon_mmf_audio_drm
-
-phonon_mmf_audio_drm {
-    LIBS += -lDrmAudioPlayUtility
-    DEFINES += QT_PHONON_MMF_AUDIO_DRM
-} else {
-    LIBS += -lmediaclientaudio
-}
-
-# This is necessary because both epoc32/include and Phonon contain videoplayer.h.
-# By making /epoc32/include the first SYSTEMINCLUDE, we ensure that
-# '#include <videoplayer.h>' picks up the Symbian header, as intended.
-PREPEND_INCLUDEPATH = /epoc32/include
-
-PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty
-
-INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
-
-HEADERS +=                                           \
-           $$PHONON_MMF_DIR/abstractaudioeffect.h    \
-           $$PHONON_MMF_DIR/abstractmediaplayer.h    \
-           $$PHONON_MMF_DIR/abstractplayer.h         \
-           $$PHONON_MMF_DIR/abstractvideooutput.h    \
-           $$PHONON_MMF_DIR/abstractvideoplayer.h    \
-           $$PHONON_MMF_DIR/audioequalizer.h         \
-           $$PHONON_MMF_DIR/audiooutput.h            \
-           $$PHONON_MMF_DIR/audioplayer.h            \
-           $$PHONON_MMF_DIR/backend.h                \
-           $$PHONON_MMF_DIR/bassboost.h              \
-           $$PHONON_MMF_DIR/defs.h                   \
-           $$PHONON_MMF_DIR/dummyplayer.h            \
-           $$PHONON_MMF_DIR/effectfactory.h          \
-           $$PHONON_MMF_DIR/effectparameter.h        \
-           $$PHONON_MMF_DIR/environmentalreverb.h    \
-           $$PHONON_MMF_DIR/loudness.h               \
-           $$PHONON_MMF_DIR/mediaobject.h            \
-           $$PHONON_MMF_DIR/mmf_medianode.h          \
-           $$PHONON_MMF_DIR/stereowidening.h         \
-           $$PHONON_MMF_DIR/objectdump.h             \
-           $$PHONON_MMF_DIR/objectdump_symbian.h     \
-           $$PHONON_MMF_DIR/objecttree.h             \
-           $$PHONON_MMF_DIR/utils.h                  \
-           $$PHONON_MMF_DIR/videowidget.h
-
-SOURCES +=                                           \
-           $$PHONON_MMF_DIR/abstractaudioeffect.cpp  \
-           $$PHONON_MMF_DIR/abstractmediaplayer.cpp  \
-           $$PHONON_MMF_DIR/abstractplayer.cpp       \
-           $$PHONON_MMF_DIR/audioequalizer.cpp       \
-           $$PHONON_MMF_DIR/audiooutput.cpp          \
-           $$PHONON_MMF_DIR/audioplayer.cpp          \
-           $$PHONON_MMF_DIR/abstractvideooutput.cpp  \
-           $$PHONON_MMF_DIR/abstractvideoplayer.cpp  \
-           $$PHONON_MMF_DIR/backend.cpp              \
-           $$PHONON_MMF_DIR/bassboost.cpp            \
-           $$PHONON_MMF_DIR/dummyplayer.cpp          \
-           $$PHONON_MMF_DIR/effectfactory.cpp        \
-           $$PHONON_MMF_DIR/effectparameter.cpp      \
-           $$PHONON_MMF_DIR/environmentalreverb.cpp  \
-           $$PHONON_MMF_DIR/loudness.cpp             \
-           $$PHONON_MMF_DIR/mediaobject.cpp          \
-           $$PHONON_MMF_DIR/mmf_medianode.cpp        \
-           $$PHONON_MMF_DIR/stereowidening.cpp       \
-           $$PHONON_MMF_DIR/objectdump.cpp           \
-           $$PHONON_MMF_DIR/objectdump_symbian.cpp   \
-           $$PHONON_MMF_DIR/objecttree.cpp           \
-           $$PHONON_MMF_DIR/utils.cpp                \
-           $$PHONON_MMF_DIR/videowidget.cpp
-
-# Test for whether the build environment supports video rendering to graphics
-# surfaces.
-exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) {
-    HEADERS +=                                       \
-           $$PHONON_MMF_DIR/videooutput_surface.h    \
-           $$PHONON_MMF_DIR/videoplayer_surface.h
-    SOURCES +=                                       \
-           $$PHONON_MMF_DIR/videooutput_surface.cpp  \
-           $$PHONON_MMF_DIR/videoplayer_surface.cpp
-    DEFINES += PHONON_MMF_VIDEO_SURFACES
-} else {
-    HEADERS +=                                       \
-           $$PHONON_MMF_DIR/ancestormovemonitor.h    \
-           $$PHONON_MMF_DIR/videooutput_dsa.h        \
-           $$PHONON_MMF_DIR/videoplayer_dsa.h
-    SOURCES +=                                       \
-           $$PHONON_MMF_DIR/ancestormovemonitor.cpp  \
-           $$PHONON_MMF_DIR/videooutput_dsa.cpp      \
-           $$PHONON_MMF_DIR/videoplayer_dsa.cpp      \
+symbian {
+	QT += phonon
+	TARGET = phonon_mmf
+	PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf
+
+	# Uncomment the following line in order to use the CDrmPlayerUtility client
+	# API for audio playback, rather than CMdaAudioPlayerUtility.
+	#CONFIG += phonon_mmf_audio_drm
+
+	phonon_mmf_audio_drm {
+		LIBS += -lDrmAudioPlayUtility
+		DEFINES += QT_PHONON_MMF_AUDIO_DRM
+	} else {
+		LIBS += -lmediaclientaudio
+	}
+
+	# This is necessary because both epoc32/include and Phonon contain videoplayer.h.
+	# By making /epoc32/include the first SYSTEMINCLUDE, we ensure that
+	# '#include <videoplayer.h>' picks up the Symbian header, as intended.
+	PREPEND_INCLUDEPATH = /epoc32/include
+
+	PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty
+
+	INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+
+	HEADERS +=                                           \
+			   $$PHONON_MMF_DIR/abstractaudioeffect.h    \
+			   $$PHONON_MMF_DIR/abstractmediaplayer.h    \
+			   $$PHONON_MMF_DIR/abstractplayer.h         \
+			   $$PHONON_MMF_DIR/abstractvideooutput.h    \
+			   $$PHONON_MMF_DIR/abstractvideoplayer.h    \
+			   $$PHONON_MMF_DIR/audioequalizer.h         \
+			   $$PHONON_MMF_DIR/audiooutput.h            \
+			   $$PHONON_MMF_DIR/audioplayer.h            \
+			   $$PHONON_MMF_DIR/backend.h                \
+			   $$PHONON_MMF_DIR/bassboost.h              \
+			   $$PHONON_MMF_DIR/defs.h                   \
+			   $$PHONON_MMF_DIR/dummyplayer.h            \
+			   $$PHONON_MMF_DIR/effectfactory.h          \
+			   $$PHONON_MMF_DIR/effectparameter.h        \
+			   $$PHONON_MMF_DIR/environmentalreverb.h    \
+			   $$PHONON_MMF_DIR/loudness.h               \
+			   $$PHONON_MMF_DIR/mediaobject.h            \
+			   $$PHONON_MMF_DIR/mmf_medianode.h          \
+			   $$PHONON_MMF_DIR/stereowidening.h         \
+			   $$PHONON_MMF_DIR/objectdump.h             \
+			   $$PHONON_MMF_DIR/objectdump_symbian.h     \
+			   $$PHONON_MMF_DIR/objecttree.h             \
+			   $$PHONON_MMF_DIR/utils.h                  \
+			   $$PHONON_MMF_DIR/videowidget.h
+
+	SOURCES +=                                           \
+			   $$PHONON_MMF_DIR/abstractaudioeffect.cpp  \
+			   $$PHONON_MMF_DIR/abstractmediaplayer.cpp  \
+			   $$PHONON_MMF_DIR/abstractplayer.cpp       \
+			   $$PHONON_MMF_DIR/audioequalizer.cpp       \
+			   $$PHONON_MMF_DIR/audiooutput.cpp          \
+			   $$PHONON_MMF_DIR/audioplayer.cpp          \
+			   $$PHONON_MMF_DIR/abstractvideooutput.cpp  \
+			   $$PHONON_MMF_DIR/abstractvideoplayer.cpp  \
+			   $$PHONON_MMF_DIR/backend.cpp              \
+			   $$PHONON_MMF_DIR/bassboost.cpp            \
+			   $$PHONON_MMF_DIR/dummyplayer.cpp          \
+			   $$PHONON_MMF_DIR/effectfactory.cpp        \
+			   $$PHONON_MMF_DIR/effectparameter.cpp      \
+			   $$PHONON_MMF_DIR/environmentalreverb.cpp  \
+			   $$PHONON_MMF_DIR/loudness.cpp             \
+			   $$PHONON_MMF_DIR/mediaobject.cpp          \
+			   $$PHONON_MMF_DIR/mmf_medianode.cpp        \
+			   $$PHONON_MMF_DIR/stereowidening.cpp       \
+			   $$PHONON_MMF_DIR/objectdump.cpp           \
+			   $$PHONON_MMF_DIR/objectdump_symbian.cpp   \
+			   $$PHONON_MMF_DIR/objecttree.cpp           \
+			   $$PHONON_MMF_DIR/utils.cpp                \
+			   $$PHONON_MMF_DIR/videowidget.cpp
+
+	# Test for whether the build environment supports video rendering to graphics
+	# surfaces.
+	symbian:exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) {
+		HEADERS +=                                       \
+			   $$PHONON_MMF_DIR/videooutput_surface.h    \
+			   $$PHONON_MMF_DIR/videoplayer_surface.h
+		SOURCES +=                                       \
+			   $$PHONON_MMF_DIR/videooutput_surface.cpp  \
+			   $$PHONON_MMF_DIR/videoplayer_surface.cpp
+		DEFINES += PHONON_MMF_VIDEO_SURFACES
+	} else {
+		HEADERS +=                                       \
+			   $$PHONON_MMF_DIR/ancestormovemonitor.h    \
+			   $$PHONON_MMF_DIR/videooutput_dsa.h        \
+			   $$PHONON_MMF_DIR/videoplayer_dsa.h
+		SOURCES +=                                       \
+			   $$PHONON_MMF_DIR/ancestormovemonitor.cpp  \
+			   $$PHONON_MMF_DIR/videooutput_dsa.cpp      \
+			   $$PHONON_MMF_DIR/videoplayer_dsa.cpp      \
+	}
+
+	LIBS += -lcone
+	LIBS += -lws32
+
+	# This is only needed for debug builds, but is always linked against.
+	LIBS += -lhal
+
+	TARGET.CAPABILITY = all -tcb
+
+	LIBS += -lmediaclientvideo        # For CVideoPlayerUtility
+	LIBS += -lcone                    # For CCoeEnv
+	LIBS += -lws32                    # For RWindow
+	LIBS += -lefsrv                   # For file server
+	LIBS += -lapgrfx -lapmime         # For recognizer
+	LIBS += -lmmfcontrollerframework  # For CMMFMetaDataEntry
+	LIBS += -lmediaclientaudiostream  # For CMdaAudioOutputStream
+
+	# These are for effects.
+	LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
+
+	# This is needed for having the .qtplugin file properly created on Symbian.
+	QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend
+
+	target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend
+	INSTALLS += target
+
+	include(../../qpluginbase.pri)
+
+	TARGET.UID3=0x2001E629
 }
-
-LIBS += -lcone
-LIBS += -lws32
-
-# This is only needed for debug builds, but is always linked against.
-LIBS += -lhal
-
-TARGET.CAPABILITY = all -tcb
-
-LIBS += -lmediaclientvideo        # For CVideoPlayerUtility
-LIBS += -lcone                    # For CCoeEnv
-LIBS += -lws32                    # For RWindow
-LIBS += -lefsrv                   # For file server
-LIBS += -lapgrfx -lapmime         # For recognizer
-LIBS += -lmmfcontrollerframework  # For CMMFMetaDataEntry
-LIBS += -lmediaclientaudiostream  # For CMdaAudioOutputStream
-
-# These are for effects.
-LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
-
-# This is needed for having the .qtplugin file properly created on Symbian.
-QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend
-
-target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend
-INSTALLS += target
-
-include(../../qpluginbase.pri)
-
-TARGET.UID3=0x2001E629
-
-- 
cgit v0.12


From 569860f721a30d5caad8ea1b55a3220f7e7f3d56 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Mon, 21 Jun 2010 18:52:45 +0200
Subject: Fix null HB_Device** dereference on exit in Harfbuzz GPOS code Fix
 incorrect usage of _HB_OPEN_Free_Device() in CaretValue cleanup

---
 src/3rdparty/harfbuzz/src/harfbuzz-gdef.c         |  2 +-
 src/3rdparty/harfbuzz/src/harfbuzz-gpos.c         | 26 +++++++++++++----------
 src/3rdparty/harfbuzz/src/harfbuzz-open-private.h |  2 +-
 src/3rdparty/harfbuzz/src/harfbuzz-open.c         |  8 +++----
 4 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gdef.c b/src/3rdparty/harfbuzz/src/harfbuzz-gdef.c
index c0c6f2c..966b167 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gdef.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gdef.c
@@ -462,7 +462,7 @@ static HB_Error  Load_CaretValue( HB_CaretValue*  cv,
 static void  Free_CaretValue( HB_CaretValue*  cv)
 {
   if ( cv->CaretValueFormat == 3 )
-    _HB_OPEN_Free_Device( &cv->cvf.cvf3.Device );
+    _HB_OPEN_Free_Device( cv->cvf.cvf3.Device );
 }
 
 
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index 31b9ae1..0236271 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -433,13 +433,16 @@ static HB_Error  Load_ValueRecord( HB_ValueRecord*  vr,
   return HB_Err_Ok;
 
 Fail1:
-  _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE] );
+  if ( vr->DeviceTables )
+    _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_ADVANCE_DEVICE] );
 
 Fail2:
-  _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE] );
+  if ( vr->DeviceTables )
+    _HB_OPEN_Free_Device( vr->DeviceTables[VR_X_ADVANCE_DEVICE] );
 
 Fail3:
-  _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
+  if ( vr->DeviceTables )
+    _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
 
   FREE( vr->DeviceTables );
   return error;
@@ -450,13 +453,13 @@ static void  Free_ValueRecord( HB_ValueRecord*  vr,
 			       HB_UShort         format )
 {
   if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
-    _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE] );
+    _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_ADVANCE_DEVICE] );
   if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
-    _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE] );
+    _HB_OPEN_Free_Device( vr->DeviceTables[VR_X_ADVANCE_DEVICE] );
   if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
-    _HB_OPEN_Free_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
+    _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
   if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
-    _HB_OPEN_Free_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE] );
+    _HB_OPEN_Free_Device( vr->DeviceTables[VR_X_PLACEMENT_DEVICE] );
   FREE( vr->DeviceTables );
 }
 
@@ -688,7 +691,8 @@ static HB_Error  Load_Anchor( HB_Anchor*  an,
   return HB_Err_Ok;
 
 Fail:
-  _HB_OPEN_Free_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] );
+  if ( an->af.af3.DeviceTables )
+    _HB_OPEN_Free_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] );
 
   FREE( an->af.af3.DeviceTables );
   return error;
@@ -697,10 +701,10 @@ Fail:
 
 static void  Free_Anchor( HB_Anchor*  an)
 {
-  if ( an->PosFormat == 3 )
+  if ( an->PosFormat == 3 && an->af.af3.DeviceTables )
   {
-    _HB_OPEN_Free_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] );
-    _HB_OPEN_Free_Device( &an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE] );
+    _HB_OPEN_Free_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] );
+    _HB_OPEN_Free_Device( an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE] );
     FREE( an->af.af3.DeviceTables );
   }
 }
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h
index 65ca453..f1ca278 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h
@@ -79,7 +79,7 @@ HB_INTERNAL void  _HB_OPEN_Free_LookupList( HB_LookupList*  ll,
 
 HB_INTERNAL void  _HB_OPEN_Free_Coverage( HB_Coverage*  c );
 HB_INTERNAL void  _HB_OPEN_Free_ClassDefinition( HB_ClassDefinition*  cd );
-HB_INTERNAL void  _HB_OPEN_Free_Device( HB_Device**  d );
+HB_INTERNAL void  _HB_OPEN_Free_Device( HB_Device*  d );
 
 
 
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.c b/src/3rdparty/harfbuzz/src/harfbuzz-open.c
index adc6cec..15cd2c1 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-open.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.c
@@ -1353,12 +1353,12 @@ _HB_OPEN_Load_Device( HB_Device** device,
 
 
 HB_INTERNAL void
-_HB_OPEN_Free_Device( HB_Device** d )
+_HB_OPEN_Free_Device( HB_Device* d )
 {
-  if ( *d )
+  if ( d )
   {
-    FREE( (*d)->DeltaValue );
-    FREE( *d );
+    FREE( d->DeltaValue );
+    FREE( d );
   }
 }
 
-- 
cgit v0.12


From b82ed43086aebb4698a8a52965eeb17349ef1d04 Mon Sep 17 00:00:00 2001
From: Justin McPherson <justin.mcpherson@nokia.com>
Date: Mon, 21 Jun 2010 15:11:59 +1000
Subject: Audio(osx); Fix audio format converters.

Reviewed-by:Dmytro Poplavskiy
---
 src/multimedia/audio/qaudio_mac.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/multimedia/audio/qaudio_mac.cpp b/src/multimedia/audio/qaudio_mac.cpp
index 14fee8b..4e17b52 100644
--- a/src/multimedia/audio/qaudio_mac.cpp
+++ b/src/multimedia/audio/qaudio_mac.cpp
@@ -68,11 +68,11 @@ QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf)
     audioFormat.setChannels(sf.mChannelsPerFrame);
     audioFormat.setSampleSize(sf.mBitsPerChannel);
     audioFormat.setCodec(QString::fromLatin1("audio/pcm"));
-    audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
+    audioFormat.setByteOrder((sf.mFormatFlags & kAudioFormatFlagIsBigEndian) != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
     QAudioFormat::SampleType type = QAudioFormat::UnSignedInt;
-    if ((sf.mFormatFlags & kLinearPCMFormatFlagIsSignedInteger) != 0)
+    if ((sf.mFormatFlags & kAudioFormatFlagIsSignedInteger) != 0)
         type = QAudioFormat::SignedInt;
-    else if ((sf.mFormatFlags & kLinearPCMFormatFlagIsFloat) != 0)
+    else if ((sf.mFormatFlags & kAudioFormatFlagIsFloat) != 0)
         type = QAudioFormat::Float;
     audioFormat.setSampleType(type);
 
@@ -99,6 +99,9 @@ AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& au
     case QAudioFormat::Unknown:  default: break;
     }
 
+    if (audioFormat.byteOrder() == QAudioFormat::BigEndian)
+        sf.mFormatFlags |= kAudioFormatFlagIsBigEndian;
+
     return sf;
 }
 
-- 
cgit v0.12


From 66d02e4bde0a628978436217032abe555ed77fad Mon Sep 17 00:00:00 2001
From: Justin McPherson <justin.mcpherson@nokia.com>
Date: Mon, 21 Jun 2010 15:18:32 +1000
Subject: Audio(osx); refactor input period conversion

Reviewed-by:Dmytro Poplavskiy
---
 src/multimedia/audio/qaudioinput_mac_p.cpp | 49 +++++++++++++++---------------
 1 file changed, 25 insertions(+), 24 deletions(-)

diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp
index b99fe11..5897e75 100644
--- a/src/multimedia/audio/qaudioinput_mac_p.cpp
+++ b/src/multimedia/audio/qaudioinput_mac_p.cpp
@@ -210,6 +210,11 @@ public:
         return true;
     }
 
+    bool empty() const
+    {
+        return position == totalPackets;
+    }
+
 private:
     UInt32 totalPackets;
     UInt32 position;
@@ -275,36 +280,32 @@ public:
         if (m_audioConverter != 0) {
             QAudioPacketFeeder  feeder(m_inputBufferList);
 
-            bool    wecan = true;
             int     copied = 0;
-
             const int available = m_buffer->free();
 
-            while (err == noErr && wecan) {
+            while (err == noErr && !feeder.empty()) {
                 QAudioRingBuffer::Region region = m_buffer->acquireWriteRegion(available);
 
-                if (region.second > 0) {
-                    AudioBufferList     output;
-                    output.mNumberBuffers = 1;
-                    output.mBuffers[0].mNumberChannels = 1;
-                    output.mBuffers[0].mDataByteSize = region.second;
-                    output.mBuffers[0].mData = region.first;
-
-                    UInt32  packetSize = region.second / m_outputFormat.mBytesPerPacket;
-                    err = AudioConverterFillComplexBuffer(m_audioConverter,
-                                                          converterCallback,
-                                                          &feeder,
-                                                          &packetSize,
-                                                          &output,
-                                                          0);
-
-                    region.second = output.mBuffers[0].mDataByteSize;
-                    copied += region.second;
+                if (region.second == 0)
+                    break;
+
+                AudioBufferList     output;
+                output.mNumberBuffers = 1;
+                output.mBuffers[0].mNumberChannels = 1;
+                output.mBuffers[0].mDataByteSize = region.second;
+                output.mBuffers[0].mData = region.first;
+
+                UInt32  packetSize = region.second / m_outputFormat.mBytesPerPacket;
+                err = AudioConverterFillComplexBuffer(m_audioConverter,
+                                                      converterCallback,
+                                                      &feeder,
+                                                      &packetSize,
+                                                      &output,
+                                                      0);
+                region.second = output.mBuffers[0].mDataByteSize;
+                copied += region.second;
 
-                    m_buffer->releaseWriteRegion(region);
-                }
-                else
-                    wecan = false;
+                m_buffer->releaseWriteRegion(region);
             }
 
             framesRendered += copied / m_outputFormat.mBytesPerFrame;
-- 
cgit v0.12


From 76c256bdabcc207a6ed70d5b5b62698495548a25 Mon Sep 17 00:00:00 2001
From: Justin McPherson <justin.mcpherson@nokia.com>
Date: Tue, 22 Jun 2010 12:01:51 +1000
Subject: Audio(osx); Fix period size calculation.

Task-number: QTBUG-8878
Reviewed-by:Dmytro Poplavskiy
---
 src/multimedia/audio/qaudiooutput_mac_p.cpp | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/multimedia/audio/qaudiooutput_mac_p.cpp b/src/multimedia/audio/qaudiooutput_mac_p.cpp
index 9689101..cc52d90 100644
--- a/src/multimedia/audio/qaudiooutput_mac_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_mac_p.cpp
@@ -358,17 +358,7 @@ bool QAudioOutputPrivate::open()
     // Set stream format
     streamFormat = toAudioStreamBasicDescription(audioFormat);
 
-    UInt32 size = sizeof(deviceFormat);
-    if (AudioUnitGetProperty(audioUnit,
-                                kAudioUnitProperty_StreamFormat,
-                                kAudioUnitScope_Input,
-                                0,
-                                &deviceFormat,
-                                &size) != noErr) {
-        qWarning() << "QAudioOutput: Unable to retrieve device format";
-        return false;
-    }
-
+    UInt32 size = sizeof(streamFormat);
     if (AudioUnitSetProperty(audioUnit,
                                 kAudioUnitProperty_StreamFormat,
                                 kAudioUnitScope_Input,
@@ -392,8 +382,7 @@ bool QAudioOutputPrivate::open()
         return false;
     }
 
-    periodSizeBytes = (numberOfFrames * streamFormat.mSampleRate / deviceFormat.mSampleRate) * 
-                        streamFormat.mBytesPerFrame;
+    periodSizeBytes = numberOfFrames * streamFormat.mBytesPerFrame;
     if (internalBufferSize < periodSizeBytes * 2)
         internalBufferSize = periodSizeBytes * 2;
     else
-- 
cgit v0.12


From f02bb3b14ab0257a11cb9cde692f87a046c0308b Mon Sep 17 00:00:00 2001
From: Justin McPherson <justin.mcpherson@nokia.com>
Date: Tue, 22 Jun 2010 16:59:08 +1000
Subject: Phonon(qt7); Don't try and display video frames when audio only.

Task-number: QTBUG-9068
---
 src/3rdparty/phonon/qt7/mediaobject.mm | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/3rdparty/phonon/qt7/mediaobject.mm b/src/3rdparty/phonon/qt7/mediaobject.mm
index 677640c..ca206bc 100644
--- a/src/3rdparty/phonon/qt7/mediaobject.mm
+++ b/src/3rdparty/phonon/qt7/mediaobject.mm
@@ -405,20 +405,22 @@ void MediaObject::restartAudioVideoTimers()
     if (m_audioTimer)
         killTimer(m_audioTimer);
 
+    if (hasVideo()) {
 #if QT_ALLOW_QUICKTIME
     // We prefer to use a display link as timer if available, since
     // it is more steady, and results in better and smoother frame drawing:
-    startDisplayLink();
-    if (!m_displayLink){
+        startDisplayLink();
+        if (!m_displayLink){
+            float fps = m_videoPlayer->staticFps();
+            long videoUpdateFrequency = fps ? long(1000.0f / fps) : 0.001;
+            m_videoTimer = startTimer(videoUpdateFrequency);
+        }
+#else
         float fps = m_videoPlayer->staticFps();
         long videoUpdateFrequency = fps ? long(1000.0f / fps) : 0.001;
         m_videoTimer = startTimer(videoUpdateFrequency);
-    }
-#else
-    float fps = m_videoPlayer->staticFps();
-    long videoUpdateFrequency = fps ? long(1000.0f / fps) : 0.001;
-    m_videoTimer = startTimer(videoUpdateFrequency);
 #endif
+    }
 
     long audioUpdateFrequency = m_audioPlayer->regularTaskFrequency();
     m_audioTimer = startTimer(audioUpdateFrequency);
-- 
cgit v0.12


From da024f96bf0969cd0de85389e621a14c3381add8 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Tue, 22 Jun 2010 09:09:32 +0200
Subject: Make sure ValueRecord's DeviceTables are cleaned up on failure

Cleanup was a missing for the case where loading an X placement
device table failed.
---
 src/3rdparty/harfbuzz/src/harfbuzz-gpos.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index 0236271..d6f9207 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -273,7 +273,7 @@ static HB_Error  Load_ValueRecord( HB_ValueRecord*  vr,
   if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
   {
     if ( ACCESS_Frame( 2L ) )
-      return error;
+      goto Fail4;
 
     new_offset = GET_UShort();
 
@@ -287,7 +287,7 @@ static HB_Error  Load_ValueRecord( HB_ValueRecord*  vr,
       if ( FILE_Seek( new_offset ) ||
 	   ( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE],
 				  stream ) ) != HB_Err_Ok )
-	return error;
+       goto Fail4;
       (void)FILE_Seek( cur_offset );
     }
   }
@@ -444,6 +444,7 @@ Fail3:
   if ( vr->DeviceTables )
     _HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
 
+Fail4:
   FREE( vr->DeviceTables );
   return error;
 }
-- 
cgit v0.12


From bae2219587a8c1a4c922d1cde51616e3ea1df370 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Tue, 22 Jun 2010 09:37:34 +0200
Subject: Clean up HB_Anchor's DeviceTables on failure when loading format 3

---
 src/3rdparty/harfbuzz/src/harfbuzz-gpos.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index d6f9207..a216005 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -637,7 +637,7 @@ static HB_Error  Load_Anchor( HB_Anchor*  an,
       if ( FILE_Seek( new_offset ) ||
 	   ( error = _HB_OPEN_Load_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE],
 				  stream ) ) != HB_Err_Ok )
-	return error;
+	goto Fail2;
       (void)FILE_Seek( cur_offset );
     }
 
@@ -695,6 +695,7 @@ Fail:
   if ( an->af.af3.DeviceTables )
     _HB_OPEN_Free_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE] );
 
+Fail2:
   FREE( an->af.af3.DeviceTables );
   return error;
 }
-- 
cgit v0.12


From b4dd04f50b2e275ef9f8e643f33143d20a436203 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Tue, 22 Jun 2010 12:18:13 +0200
Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to
 f0dcb906fe56b5dc06aa305b6cfc821d5dd25a28

* Import f0dcb906fe56b5dc06aa305b6cfc821d5dd25a28 which fixes a crash
with certain fonts.
---
 src/3rdparty/harfbuzz/src/harfbuzz-open.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.c b/src/3rdparty/harfbuzz/src/harfbuzz-open.c
index 15cd2c1..f12f5b7 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-open.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.c
@@ -1403,12 +1403,11 @@ _HB_OPEN_Get_Device( HB_Device* d,
 		      HB_UShort    size,
 		      HB_Short*    value )
 {
-  HB_UShort  byte, bits, mask, f, s;
+  HB_UShort  byte, bits, mask, s;
 
-  f = d->DeltaFormat;
-
-  if ( d->DeltaValue && size >= d->StartSize && size <= d->EndSize )
+  if ( d && d->DeltaValue && size >= d->StartSize && size <= d->EndSize )
   {
+    HB_UShort f = d->DeltaFormat;
     s    = size - d->StartSize;
     byte = d->DeltaValue[s >> ( 4 - f )];
     bits = byte >> ( 16 - ( ( s % ( 1 << ( 4 - f ) ) + 1 ) << f ) );
-- 
cgit v0.12


From 1aee8f71da584525eea569690110ca2ed471c5ae Mon Sep 17 00:00:00 2001
From: Andy Shaw <qt-info@nokia.com>
Date: Wed, 23 Jun 2010 07:44:10 +0200
Subject: Ensure that compiling with the no debug/warning output defines works

The defines that can be used are QT_NO_DEBUG_OUTPUT and
QT_NO_WARNING_OUTPUT in order to turn off qDebug and qWarning output.

Reviewed-by: cduclos
Reviewed-by: Markus Goetz
---
 src/gui/accessible/qaccessible_mac_cocoa.mm | 4 ++++
 src/network/access/qftp.cpp                 | 2 +-
 src/opengl/qgl_p.h                          | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gui/accessible/qaccessible_mac_cocoa.mm b/src/gui/accessible/qaccessible_mac_cocoa.mm
index 1688404..ada927e 100644
--- a/src/gui/accessible/qaccessible_mac_cocoa.mm
+++ b/src/gui/accessible/qaccessible_mac_cocoa.mm
@@ -58,11 +58,15 @@ QT_BEGIN_NAMESPACE
 
 //#define MAC_ACCESSIBILTY_DEVELOPER_MODE
 
+#ifndef QT_NO_DEBUG_STREAM
 #ifdef MAC_ACCESSIBILTY_DEVELOPER_MODE
 #define MAC_ACCESSIBILTY_DEBUG QT_PREPEND_NAMESPACE(qDebug)
 #else
 #define MAC_ACCESSIBILTY_DEBUG if (0) QT_PREPEND_NAMESPACE(qDebug)
 #endif
+#else
+#define MAC_ACCESSIBILTY_DEBUG if (0) QT_PREPEND_NAMESPACE(QNoDebug)
+#endif
 
 typedef QMap<QAccessible::Role, NSString *> QMacAccessibiltyRoleMap;
 Q_GLOBAL_STATIC(QMacAccessibiltyRoleMap, qMacAccessibiltyRoleMap);
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index 7f6df0a..97219f4 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -2311,7 +2311,7 @@ void QFtpPrivate::_q_piError(int errorCode, const QString &text)
     Q_Q(QFtp);
 
     if (pending.isEmpty()) {
-        qWarning() << "QFtpPrivate::_q_piError was called without pending command!";
+        qWarning("QFtpPrivate::_q_piError was called without pending command!");
         return;
     }
 
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 191131e..4facb65 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -114,7 +114,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
 QT_END_INCLUDE_NAMESPACE
 # ifdef old_qDebug
 #   undef qDebug
-#   define qDebug QT_QDEBUG_MACRO
+#   define qDebug QT_NO_QDEBUG_MACRO
 #   undef old_qDebug
 # endif
 class QMacWindowChangeEvent;
-- 
cgit v0.12


From 19ee05c994af7d0c55ec9e4a44e7e485eafc8c66 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Wed, 23 Jun 2010 09:20:54 +0100
Subject: Updated UIDs for spectrum demo

Resolving UID clash with other example apps

Reviewed-by: Miikka Heikkinen
---
 demos/spectrum/3rdparty/fftreal/fftreal.pro | 2 +-
 demos/spectrum/app/app.pro                  | 2 +-
 demos/spectrum/spectrum.pro                 | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/demos/spectrum/3rdparty/fftreal/fftreal.pro b/demos/spectrum/3rdparty/fftreal/fftreal.pro
index 8d9f46e..6801b42 100644
--- a/demos/spectrum/3rdparty/fftreal/fftreal.pro
+++ b/demos/spectrum/3rdparty/fftreal/fftreal.pro
@@ -29,7 +29,7 @@ DEFINES  += FFTREAL_LIBRARY
 
 symbian {
     # Provide unique ID for the generated binary, required by Symbian OS
-    TARGET.UID3 = 0xA000E3FB
+    TARGET.UID3 = 0xA000E403
     TARGET.CAPABILITY = UserEnvironment
 } else {
     macx {
diff --git a/demos/spectrum/app/app.pro b/demos/spectrum/app/app.pro
index db9a144..22ee3b1 100644
--- a/demos/spectrum/app/app.pro
+++ b/demos/spectrum/app/app.pro
@@ -48,7 +48,7 @@ symbian {
     TARGET.CAPABILITY = UserEnvironment
 
     # Provide unique ID for the generated binary, required by Symbian OS
-    TARGET.UID3 = 0xA000E3FA
+    TARGET.UID3 = 0xA000E402
 }
 
 
diff --git a/demos/spectrum/spectrum.pro b/demos/spectrum/spectrum.pro
index a8f09de..12bdec1 100644
--- a/demos/spectrum/spectrum.pro
+++ b/demos/spectrum/spectrum.pro
@@ -21,7 +21,7 @@ symbian {
     include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
 
     # UID for the SIS file
-    TARGET.UID3 = 0xA000E3FA
+    TARGET.UID3 = 0xA000E402
 }
 
 sources.files = README.txt spectrum.pri spectrum.pro TODO.txt
-- 
cgit v0.12


From 50846a87e82fa94753bd369d03c9ba00108a12de Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Wed, 23 Jun 2010 12:20:29 +0100
Subject: Allow TLW translucency on Symbian without Qt::FramelessWindowHint

This flag is Windows-specific, and should not be required on other platforms.

Reviewed-by: Jason Barron
---
 src/gui/kernel/qwidget_s60.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 86b858d..46f3254 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -738,9 +738,6 @@ void QWidgetPrivate::s60UpdateIsOpaque()
     if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground))
         return;
 
-    if ((data.window_flags & Qt::FramelessWindowHint) == 0)
-        return;
-
     RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
 
 #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
-- 
cgit v0.12


From 318e1b3a78bc7114bacdce8bec019228d8ecab19 Mon Sep 17 00:00:00 2001
From: David Boddie <dboddie@trolltech.com>
Date: Wed, 23 Jun 2010 14:58:01 +0200
Subject: Doc: Fixed whitespace issues and added missing files to lists.

Reviewed-by: Trust Me
---
 tools/qdoc3/test/qt-build-docs.qdocconf       | 76 +++++++++++++--------------
 tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf | 67 +++++++++++++----------
 tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf | 14 ++++-
 3 files changed, 90 insertions(+), 67 deletions(-)

diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index 09cbc45..140b81f 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -22,43 +22,43 @@ qhp.Qt.indexTitle          = Qt Reference Documentation
 # Files not referenced in any qdoc file (last four are needed by qtdemo)
 # See also extraimages.HTML
 qhp.Qt.extraFiles          = index.html \
- 									images/bg_l.png \
-                             	    images/bg_l_blank.png \
-                             	    images/bg_r.png \
-									images/box_bg.png \
-									images/breadcrumb.png \
-									images/bullet_gt.png \
-                             	    images/bullet_dn.png \
-									images/bullet_sq.png \
-                             	    images/bullet_up.png \
-                             	    images/feedbackground.png \
-                             	    images/horBar.png \
-									images/page.png \
-									images/page_bg.png \
-									images/sprites-combined.png \
-									images/arrow-down.png \
-									images/spinner.gif \
-                             	    images/stylesheet-coffee-plastique.png \
-                             	    images/taskmenuextension-example.png \
-                             	   images/coloreditorfactoryimage.png \
-                             	   images/dynamiclayouts-example.png \
-									scripts/functions.js \
-									scripts/jquery.js \
-									 scripts/shBrushCpp.js \
-									 scripts/shCore.js \
-									 scripts/shLegacy.js \
-									 scripts/narrow.js \
-									 scripts/superfish.js \
-									 style/shCore.css \
-									 style/shThemeDefault.css \
-									 style/narrow.css \
-									 style/superfish.css \
-									 style/superfish_skin.css \
-									style/OfflineStyle.css \
-								    style/style_ie6.css \
-									style/style_ie7.css \
-									style/style_ie8.css \
-                             	    style/style.css
+                             images/bg_l.png \
+                             images/bg_l_blank.png \
+                             images/bg_r.png \
+                             images/box_bg.png \
+                             images/breadcrumb.png \
+                             images/bullet_gt.png \
+                             images/bullet_dn.png \
+                             images/bullet_sq.png \
+                             images/bullet_up.png \
+                             images/feedbackground.png \
+                             images/horBar.png \
+                             images/page.png \
+                             images/page_bg.png \
+                             images/sprites-combined.png \
+                             images/arrow-down.png \
+                             images/spinner.gif \
+                             images/stylesheet-coffee-plastique.png \
+                             images/taskmenuextension-example.png \
+                             images/coloreditorfactoryimage.png \
+                             images/dynamiclayouts-example.png \
+                             scripts/functions.js \
+                             scripts/jquery.js \
+                             scripts/shBrushCpp.js \
+                             scripts/shCore.js \
+                             scripts/shLegacy.js \
+                             scripts/narrow.js \
+                             scripts/superfish.js \
+                             style/shCore.css \
+                             style/shThemeDefault.css \
+                             style/narrow.css \
+                             style/superfish.css \
+                             style/superfish_skin.css \
+                             style/OfflineStyle.css \
+                             style/style_ie6.css \
+                             style/style_ie7.css \
+                             style/style_ie8.css \
+                             style/style.css
 
 
 
@@ -141,7 +141,7 @@ exampledirs             = $QT_SOURCE_TREE/doc/src \
 imagedirs               = $QT_SOURCE_TREE/doc/src/images \
                           $QT_SOURCE_TREE/examples \
                           $QT_SOURCE_TREE/doc/src/declarative/pics \
-			  $QT_SOURCE_TREE/doc/src/template/images
+                          $QT_SOURCE_TREE/doc/src/template/images
 outputdir               = $QT_BUILD_TREE/doc/html
 tagfile                 = $QT_BUILD_TREE/doc/html/qt.tags
 base                    = file:$QT_BUILD_TREE/doc/html
diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
index e517b33..7701cae 100644
--- a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf
@@ -30,33 +30,43 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0
 # Files not referenced in any qdoc file (last four are needed by qtdemo)
 # See also extraimages.HTML
 qhp.Qt.extraFiles          = index.html \
-			    images/bg_l.png \
-			    images/bg_l_blank.png \
-			    images/bg_r.png \
-			    images/box_bg.png \
-			    images/breadcrumb.png \
-			    images/bullet_gt.png \
-			    images/bullet_dn.png \
-			    images/bullet_sq.png \
-			    images/bullet_up.png \
-			    images/feedbackground.png \
-			    images/horBar.png \
-			    images/page.png \
-			    images/page_bg.png \
-			    images/sprites-combined.png \
-			    images/arrow-down.png \
-			    images/spinner.gif \
-			    images/stylesheet-coffee-plastique.png \
-			    images/taskmenuextension-example.png \
-			    images/coloreditorfactoryimage.png \
-			    images/dynamiclayouts-example.png \
-			    scripts/functions.js \
-			    scripts/jquery.js \
-			    style/OfflineStyle.css \
-			    style/style_ie6.css \
-			    style/style_ie7.css \
-			    style/style_ie8.css \
-			    style/style.css
+                             images/bg_l.png \
+                             images/bg_l_blank.png \
+                             images/bg_r.png \
+                             images/box_bg.png \
+                             images/breadcrumb.png \
+                             images/bullet_gt.png \
+                             images/bullet_dn.png \
+                             images/bullet_sq.png \
+                             images/bullet_up.png \
+                             images/feedbackground.png \
+                             images/horBar.png \
+                             images/page.png \
+                             images/page_bg.png \
+                             images/sprites-combined.png \
+                             images/arrow-down.png \
+                             images/spinner.gif \
+                             images/stylesheet-coffee-plastique.png \
+                             images/taskmenuextension-example.png \
+                             images/coloreditorfactoryimage.png \
+                             images/dynamiclayouts-example.png \
+                             scripts/functions.js \
+                             scripts/jquery.js \
+                             scripts/shBrushCpp.js \
+                             scripts/shCore.js \
+                             scripts/shLegacy.js \
+                             scripts/narrow.js \
+                             scripts/superfish.js \
+                             style/shCore.css \
+                             style/shThemeDefault.css \
+                             style/narrow.css \
+                             style/superfish.css \
+                             style/superfish_skin.css \
+                             style/OfflineStyle.css \
+                             style/style_ie6.css \
+                             style/style_ie7.css \
+                             style/style_ie8.css \
+                             style/style.css
 
 language                = Cpp
 
@@ -102,7 +112,8 @@ exampledirs             = $QT_SOURCE_TREE/doc/src \
 imagedirs               = $QT_SOURCE_TREE/doc/src/ja_JP/images \
                           $QT_SOURCE_TREE/doc/src/images \
                           $QT_SOURCE_TREE/examples \
-			  $QT_SOURCE_TREE/doc/src/template/images
+                          $QT_SOURCE_TREE/doc/src/declarative/pics \
+                          $QT_SOURCE_TREE/doc/src/template/images
 outputdir               = $QT_BUILD_TREE/doc/html_ja_JP
 tagfile                 = $QT_BUILD_TREE/doc/html_ja_JP/qt.tags
 base                    = file:$QT_BUILD_TREE/doc/html_ja_JP
diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
index 909a2d4..be459d8 100644
--- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
@@ -52,6 +52,17 @@ qhp.Qt.extraFiles          = index.html \
                              images/dynamiclayouts-example.png \
                              scripts/functions.js \
                              scripts/jquery.js \
+                             scripts/shBrushCpp.js \
+                             scripts/shCore.js \
+                             scripts/shLegacy.js \
+                             scripts/narrow.js \
+                             scripts/superfish.js \
+                             style/shCore.css \
+                             style/shThemeDefault.css \
+                             style/narrow.css \
+                             style/superfish.css \
+                             style/superfish_skin.css \
+                             style/OfflineStyle.css \
                              style/style_ie6.css \
                              style/style_ie7.css \
                              style/style_ie8.css \
@@ -99,7 +110,8 @@ exampledirs             = $QT_SOURCE_TREE/doc/src \
                           $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs
 imagedirs               = $QT_SOURCE_TREE/doc/src/images \
                           $QT_SOURCE_TREE/examples \
-			  $QT_SOURCE_TREE/doc/src/template/images
+                          $QT_SOURCE_TREE/doc/src/declarative/pics \
+                          $QT_SOURCE_TREE/doc/src/template/images
 outputdir               = $QT_BUILD_TREE/doc/html_zh_CN
 tagfile                 = $QT_BUILD_TREE/doc/html_zh_CN/qt.tags
 base                    = file:$QT_BUILD_TREE/doc/html_zh_CN
-- 
cgit v0.12


From 3d2d0eb76e7d7a86065b74bc1c0a5346b8d7194d Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Wed, 23 Jun 2010 15:35:41 +0200
Subject: Updated WebKit to b3589e88fb8d581fb523578763831109f914dc2e

* Build fixes for package builds
* Fix build with QT_NO_COMBOBOX
* Upstream David's doc fix
---
 src/3rdparty/webkit/.tag                           |  2 +-
 src/3rdparty/webkit/VERSION                        |  2 +-
 src/3rdparty/webkit/WebCore/ChangeLog              |  9 +++++++
 src/3rdparty/webkit/WebCore/WebCore.pro            |  2 ++
 src/3rdparty/webkit/WebKit/qt/ChangeLog            | 28 ++++++++++++++++++++++
 .../WebKit/qt/WebCoreSupport/ChromeClientQt.cpp    |  2 +-
 .../webkit/WebKit/qt/declarative/declarative.pro   |  3 +++
 .../webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc     |  4 ++--
 8 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 1eb0d78..21b75f0 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-45d1c9149ef8940081fa8dd35854d2b95ebaf3cd
+b3589e88fb8d581fb523578763831109f914dc2e
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 1a343eb..57c1cf6 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
 
 and has the sha1 checksum
 
-        45d1c9149ef8940081fa8dd35854d2b95ebaf3cd
+        b3589e88fb8d581fb523578763831109f914dc2e
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index fd259e0..687b76b 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,12 @@
+2010-06-22  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Unreviewed Qt/Symbian build fix.
+
+        Fix "make clean" to not try to execute clean commands for
+        the extra targets we use to simulate "make install".
+
+        * WebCore.pro: Use no_clean in CONFIG of extra compilers.
+
 2010-06-21  Balazs Kelemen  <kb@inf.u-szeged.hu>
 
         Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index e0b4905..f0e41bc 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -2866,6 +2866,7 @@ HEADERS += $$WEBKIT_API_HEADERS
         # INSTALLS is not implemented in qmake's s60 generators, copy headers manually
         inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
         inst_headers.input = WEBKIT_INSTALL_HEADERS
+        inst_headers.CONFIG = no_clean
 
         !isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
         else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
@@ -2875,6 +2876,7 @@ HEADERS += $$WEBKIT_API_HEADERS
         inst_modfile.commands = $$inst_headers.commands
         inst_modfile.input = moduleFile
         inst_modfile.output = $$[QMAKE_MKSPECS]/modules
+        inst_modfile.CONFIG = no_clean
 
         QMAKE_EXTRA_COMPILERS += inst_modfile
 
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 0e73680..050b1c1 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,31 @@
+2010-06-23  Alessandro Portale  <alessandro.portale@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Provide the Webkit Qml plugin with a UID3 on Symbian
+
+        ...otherwise we cannot Symbian sign it.
+
+        * declarative/declarative.pro:
+
+2010-06-23  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Unreviewed Qt package build fix.
+
+        When building without build-webkit, set OUTPUT_DIR if necessary, like
+        in the other .pro files.
+
+        * declarative/declarative.pro:
+
+2010-06-22  Tasuku Suzuki  <tasuku.suzuki@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Fix compilation with QT_NO_COMBOBOX.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::createSelectPopup):
+
 2010-06-11  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         Reviewed by nobody, build fix.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 7d1c794..e253161 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -576,7 +576,7 @@ QtAbstractWebPopup* ChromeClientQt::createSelectPopup()
 #elif !defined(QT_NO_COMBOBOX)
     return new QtFallbackWebPopup;
 #else
-    return result;
+    return 0;
 #endif
 }
 
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro b/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
index 122d90a..c75bbce 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
@@ -6,6 +6,8 @@ CONFIG += qt plugin
 
 win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
 
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
+
 QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
 copy2build.input = QMLDIRFILE
 CONFIG(QTDIR_build) {
@@ -64,6 +66,7 @@ qmldir.files += $$PWD/qmldir
 qmldir.path +=  $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
 
 symbian:{
+    TARGET.UID3 = 0x20021321
     load(data_caging_paths)
     include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
 
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
index c2a38fd..fa93293 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
@@ -8,7 +8,7 @@
 
     The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native
     objects that are represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection,
-    a part of the \l{Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
+    a part of the \l{Qt Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
     for example \l{QObject} properties map directly to JavaScript properties.
 
     For example, both JavaScript and QObjects have properties: a construct that represent a getter/setter
@@ -24,7 +24,7 @@
     applications. For example, an application that contains a media-player, playlist manager, and music store.
     The playlist manager is usually best authored as a classic desktop application,
     with the native-looking robust \l{QWidget}s helping with producing that application.
-    The media-player control, which usually looks custom, can be written using the \l{Graphics View framework}
+    The media-player control, which usually looks custom, can be written using \l{The Graphics View framework}
     or with in a declarative way with \l{QtDeclarative}. The music store, which shows dynamic content
     from the internet and gets modified rapidly, is best authored in HTML and maintained on the server.
 
-- 
cgit v0.12


From fdc0d441e1c1331fb639e5d5f59daf3fb22a7e24 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Thu, 24 Jun 2010 01:49:52 +0200
Subject: Make QtFontFamily::symbol_checked a bitfield.

Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
---
 src/gui/text/qfontdatabase.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 139139f..e6c36a4 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -413,7 +413,7 @@ struct QtFontFamily
     bool fixedPitchComputed : 1;
 #endif
 #ifdef Q_WS_X11
-    bool symbol_checked;
+    bool symbol_checked : 1;
 #endif
 
     QString name;
-- 
cgit v0.12


From 793fbbbf5ae3860b5091c760b3cd0d467369cc1a Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Thu, 10 Jun 2010 13:22:32 +1000
Subject: Cherry pick fix for QTMOBILITY-240 from Qt Mobility.

c84a6d828bcb7f66d1ac06e1a7a84c5a8ba9cec4
---
 .../bearer/symbian/qnetworksession_impl.cpp        | 60 ++++++++++-----
 src/plugins/bearer/symbian/symbianengine.cpp       | 90 ++++++++++++----------
 2 files changed, 88 insertions(+), 62 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index e08d135..20e13d2 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -694,8 +694,17 @@ void QNetworkSessionPrivateImpl::PreferredCarrierAvailable(TAccessPointInfo aOld
             SymbianNetworkConfigurationPrivate *symbianConfig =
                 toSymbianConfig(privateConfiguration(configs[i]));
 
-            if (symbianConfig->numericIdentifier() == aNewAPInfo.AccessPoint())
-                emit preferredConfigurationChanged(configs[i], aIsSeamless);
+            if (symbianConfig->numericIdentifier() == aNewAPInfo.AccessPoint()) {
+                // Any slot connected to the signal might throw an std::exception,
+                // which must not propagate into Symbian code (this function is a callback
+                // from platform). We could convert exception to a symbian Leave, but since the
+                // prototype of this function bans this (no trailing 'L'), we just catch
+                // and drop.
+                QT_TRY {
+                    emit preferredConfigurationChanged(configs[i], aIsSeamless);
+                }
+                QT_CATCH (std::exception&) {}
+            }
         }
     } else {
         migrate();
@@ -705,7 +714,10 @@ void QNetworkSessionPrivateImpl::PreferredCarrierAvailable(TAccessPointInfo aOld
 void QNetworkSessionPrivateImpl::NewCarrierActive(TAccessPointInfo /*aNewAPInfo*/, TBool /*aIsSeamless*/)
 {
     if (iALREnabled > 0) {
-        emit newConfigurationActivated();
+        QT_TRY {
+            emit newConfigurationActivated();
+        }
+        QT_CATCH (std::exception&) {}
     } else {
         accept();
     }
@@ -727,18 +739,24 @@ void QNetworkSessionPrivateImpl::Error(TInt /*aError*/)
         if (ipConnectionNotifier) {
             ipConnectionNotifier->StopNotifications();
         }
-        syncStateWithInterface();
-        // In some cases IAP is still in Connected state when
-        // syncStateWithInterface(); is called
-        // => Following call makes sure that Session state
-        //    changes immediately to Disconnected.
-        newState(QNetworkSession::Disconnected);
-        emit closed();
+        QT_TRY {
+            syncStateWithInterface();
+            // In some cases IAP is still in Connected state when
+            // syncStateWithInterface(); is called
+            // => Following call makes sure that Session state
+            //    changes immediately to Disconnected.
+            newState(QNetworkSession::Disconnected);
+            emit closed();
+        }
+        QT_CATCH (std::exception&) {}
     } else if (iStoppedByUser) {
         // If the user of this session has called the stop() and
         // configuration is based on internet SNAP, this needs to be
         // done here because platform might roam.
-        newState(QNetworkSession::Disconnected);
+        QT_TRY {
+            newState(QNetworkSession::Disconnected);
+        }
+        QT_CATCH (std::exception&) {}
     }
 }
 #endif
@@ -978,12 +996,12 @@ void QNetworkSessionPrivateImpl::RunL()
             if (error != KErrNone) {
                 isOpen = false;
                 iError = QNetworkSession::UnknownSessionError;
-                emit QNetworkSessionPrivate::error(iError);
+                QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
                 Cancel();
                 if (ipConnectionNotifier) {
                     ipConnectionNotifier->StopNotifications();
                 }
-                syncStateWithInterface();
+                QT_TRYCATCH_LEAVING(syncStateWithInterface());
                 return;
             }
  
@@ -1010,8 +1028,10 @@ void QNetworkSessionPrivateImpl::RunL()
 
             startTime = QDateTime::currentDateTime();
 
-            newState(QNetworkSession::Connected);
-            emit quitPendingWaitsForOpened();
+            QT_TRYCATCH_LEAVING({
+                    newState(QNetworkSession::Connected);
+                    emit quitPendingWaitsForOpened();
+                });
             }
             break;
         case KErrNotFound: // Connection failed
@@ -1019,12 +1039,12 @@ void QNetworkSessionPrivateImpl::RunL()
             activeConfig = QNetworkConfiguration();
             serviceConfig = QNetworkConfiguration();
             iError = QNetworkSession::InvalidConfigurationError;
-            emit QNetworkSessionPrivate::error(iError);
+            QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
             Cancel();
             if (ipConnectionNotifier) {
                 ipConnectionNotifier->StopNotifications();
             }
-            syncStateWithInterface();
+            QT_TRYCATCH_LEAVING(syncStateWithInterface());
             break;
         case KErrCancel: // Connection attempt cancelled
         case KErrAlreadyExists: // Connection already exists
@@ -1038,12 +1058,12 @@ void QNetworkSessionPrivateImpl::RunL()
             } else {
                 iError = QNetworkSession::UnknownSessionError;
             }
-            emit QNetworkSessionPrivate::error(iError);
+            QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
             Cancel();
             if (ipConnectionNotifier) {
                 ipConnectionNotifier->StopNotifications();
             }
-            syncStateWithInterface();
+            QT_TRYCATCH_LEAVING(syncStateWithInterface());
             break;
     }
 }
@@ -1364,7 +1384,7 @@ void ConnectionProgressNotifier::DoCancel()
 void ConnectionProgressNotifier::RunL()
 {
     if (iStatus == KErrNone) {
-        iOwner.handleSymbianConnectionStatusChange(iProgress().iStage, iProgress().iError);
+        QT_TRYCATCH_LEAVING(iOwner.handleSymbianConnectionStatusChange(iProgress().iStage, iProgress().iError));
     
         SetActive();
         iConnection.ProgressNotification(iProgress, iStatus);
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index ab1ba28..3d462ee 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -272,7 +272,11 @@ void SymbianEngine::updateConfigurationsL()
                 accessPointConfigurations.insert(ptr->id, ptr);
 
                 mutex.unlock();
-                emit configurationAdded(ptr);
+                // Emit configuration added. Connected slots may throw execptions
+                // which propagate here --> must be converted to leaves (standard
+                // std::exception would cause any TRAP trapping this function to terminate
+                // program).
+                QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
                 mutex.lock();
             }
         }
@@ -293,10 +297,9 @@ void SymbianEngine::updateConfigurationsL()
             knownSnapConfigs.removeOne(ident);
         } else {
             SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate;
-            CleanupStack::PushL(cpPriv);
     
             HBufC *pName = destination.NameLC();
-            cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length());
+            QT_TRYCATCH_LEAVING(cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length()));
             CleanupStack::PopAndDestroy(pName);
             pName = NULL;
     
@@ -313,10 +316,8 @@ void SymbianEngine::updateConfigurationsL()
             snapConfigurations.insert(ident, ptr);
 
             mutex.unlock();
-            emit configurationAdded(ptr);
+            QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
             mutex.lock();
-            
-            CleanupStack::Pop(cpPriv);
         }
         QNetworkConfigurationPrivatePointer privSNAP = snapConfigurations.value(ident);
             
@@ -336,7 +337,7 @@ void SymbianEngine::updateConfigurationsL()
                     accessPointConfigurations.insert(ptr->id, ptr);
 
                     mutex.unlock();
-                    emit configurationAdded(ptr);
+                    QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
                     mutex.lock();
 
                     QMutexLocker configLocker(&privSNAP->mutex);
@@ -390,7 +391,7 @@ void SymbianEngine::updateConfigurationsL()
                 accessPointConfigurations.insert(ident, ptr);
 
                 mutex.unlock();
-                emit configurationAdded(ptr);
+                QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
                 mutex.lock();
             } else {
                 delete cpPriv;
@@ -400,7 +401,7 @@ void SymbianEngine::updateConfigurationsL()
     }
     CleanupStack::PopAndDestroy(pDbTView);
 #endif
-    updateActiveAccessPoints();
+    QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
     
     foreach (const QString &oldIface, knownConfigs) {
         //remove non existing IAP
@@ -408,6 +409,7 @@ void SymbianEngine::updateConfigurationsL()
 
         mutex.unlock();
         emit configurationRemoved(ptr);
+        QT_TRYCATCH_LEAVING(emit configurationRemoved(ptr));
         mutex.lock();
 
         // Remove non existing IAP from SNAPs
@@ -431,6 +433,7 @@ void SymbianEngine::updateConfigurationsL()
 
         mutex.unlock();
         emit configurationRemoved(ptr);
+        QT_TRYCATCH_LEAVING(emit configurationRemoved(ptr));
         mutex.lock();
     }
 
@@ -445,14 +448,12 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
         RCmConnectionMethod& connectionMethod)
 {
     SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate;
-    CleanupStack::PushL(cpPriv);
-    
     TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
     QString ident = QString::number(qHash(iapId));
     
     HBufC *pName = connectionMethod.GetStringAttributeL(CMManager::ECmName);
     CleanupStack::PushL(pName);
-    cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length());
+    QT_TRYCATCH_LEAVING(cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length()));
     CleanupStack::PopAndDestroy(pName);
     pName = NULL;
     
@@ -500,7 +501,7 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
 
     if (error == KErrNone && pName) {
         CleanupStack::PushL(pName);
-        cpPriv->mappingName = QString::fromUtf16(pName->Ptr(),pName->Length());
+        QT_TRYCATCH_LEAVING(cpPriv->mappingName = QString::fromUtf16(pName->Ptr(),pName->Length()));
         CleanupStack::PopAndDestroy(pName);
         pName = NULL;
     }
@@ -518,8 +519,6 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
     cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
     cpPriv->purpose = QNetworkConfiguration::UnknownPurpose;
     cpPriv->roamingSupported = false;
-    
-    CleanupStack::Pop(cpPriv);
     return cpPriv;
 }
 #else
@@ -552,7 +551,7 @@ void SymbianEngine::readNetworkConfigurationValuesFromCommsDbL(
     
     QString ident = QString::number(qHash(aApId));
     
-    apNetworkConfiguration->name = QString::fromUtf16(name.Ptr(),name.Length());
+    QT_TRYCATCH_LEAVING(apNetworkConfiguration->name = QString::fromUtf16(name.Ptr(),name.Length()));
     apNetworkConfiguration->isValid = true;
     apNetworkConfiguration->id = ident;
     apNetworkConfiguration->numericId = aApId;
@@ -902,7 +901,7 @@ void SymbianEngine::RunL()
         if (event == RDbNotifier::ECommit) {
             TRAPD(error, updateConfigurationsL());
             if (error == KErrNone) {
-                updateStatesToSnaps();
+                QT_TRYCATCH_LEAVING(updateStatesToSnaps());
             }
             locker.unlock();
             waitRandomTime();
@@ -913,7 +912,7 @@ void SymbianEngine::RunL()
             locker.relock();
             TRAPD(error, updateConfigurationsL());
             if (error == KErrNone) {
-                updateStatesToSnaps();
+                QT_TRYCATCH_LEAVING(updateStatesToSnaps());
             }
         }
         iIgnoringUpdates = false; // Wait time done, allow updating again
@@ -966,8 +965,10 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
                 ptr->mutex.lock();
                 toSymbianConfig(ptr)->connectionId = connectionId;
                 ptr->mutex.unlock();
-                emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
-                                               connectionId, QNetworkSession::Connecting);
+                QT_TRYCATCH_LEAVING(
+                    emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
+                                                   connectionId, QNetworkSession::Connecting)
+                );
             }
         } else if (connectionStatus == KLinkLayerOpen) {
             // Connection has been successfully opened
@@ -985,23 +986,27 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
                 ptr->mutex.unlock();
 
                 // Configuration is Active
-                if (changeConfigurationStateTo(ptr, QNetworkConfiguration::Active)) {
-                    updateStatesToSnaps();
-                }
-                emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
-                                               connectionId, QNetworkSession::Connected);
+                QT_TRYCATCH_LEAVING(
+                    if (changeConfigurationStateTo(ptr, QNetworkConfiguration::Active)) {
+                        updateStatesToSnaps();
+                    }
+                    emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
+                                                   connectionId, QNetworkSession::Connected);
 
-                if (!iOnline) {
-                    iOnline = true;
-                    emit this->onlineStateChanged(iOnline);
-                }
+                    if (!iOnline) {
+                        iOnline = true;
+                        emit this->onlineStateChanged(iOnline);
+                    }
+                );
             }
         } else if (connectionStatus == KConfigDaemonStartingDeregistration) {
             TUint connectionId = realEvent->ConnectionId();
             QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId);
             if (ptr) {
-                emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
-                                               connectionId, QNetworkSession::Closing);
+                QT_TRYCATCH_LEAVING(
+                    emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
+                                                   connectionId, QNetworkSession::Closing)
+                );
             }
         } else if (connectionStatus == KLinkLayerClosed ||
                    connectionStatus == KConnectionClosed) {
@@ -1011,12 +1016,13 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId);
             if (ptr) {
                 // Configuration is either Defined or Discovered
-                if (changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Discovered)) {
-                    updateStatesToSnaps();
-                }
-
-                emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
-                                               connectionId, QNetworkSession::Disconnected);
+                QT_TRYCATCH_LEAVING(
+                    if (changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Discovered)) {
+                        updateStatesToSnaps();
+                    }
+                    emit configurationStateChanged(toSymbianConfig(ptr)->numericIdentifier(),
+                                                   connectionId, QNetworkSession::Disconnected);
+                );
             }
             
             bool online = false;
@@ -1030,7 +1036,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             }
             if (iOnline != online) {
                 iOnline = online;
-                emit this->onlineStateChanged(iOnline);
+                QT_TRYCATCH_LEAVING(emit this->onlineStateChanged(iOnline));
             }
         }
         }
@@ -1048,7 +1054,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
             if (ptr) {
                 // Configuration is either Discovered or Active 
-                changeConfigurationStateAtMinTo(ptr, QNetworkConfiguration::Discovered);
+                QT_TRYCATCH_LEAVING(changeConfigurationStateAtMinTo(ptr, QNetworkConfiguration::Discovered));
                 unDiscoveredConfigs.removeOne(ident);
             }
         }
@@ -1056,7 +1062,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(iface);
             if (ptr) {
                 // Configuration is Defined
-                changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Defined);
+                QT_TRYCATCH_LEAVING(changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Defined));
             }
         }
         }
@@ -1198,9 +1204,9 @@ void AccessPointsAvailabilityScanner::RunL()
 
     if (iStatus.Int() != KErrNone) {
         iIapBuf().iCount = 0;
-        iOwner.accessPointScanningReady(false,iIapBuf());
+        QT_TRYCATCH_LEAVING(iOwner.accessPointScanningReady(false,iIapBuf()));
     } else {
-        iOwner.accessPointScanningReady(true,iIapBuf());
+        QT_TRYCATCH_LEAVING(iOwner.accessPointScanningReady(true,iIapBuf()));
     }
 }
 
-- 
cgit v0.12


From 91ff19ea3233310f5db542e880661d1efe0151e2 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Thu, 10 Jun 2010 14:31:01 +1000
Subject: Cherry pick fix for MOBILITY-938 from Qt Mobility.

216f4016d1b447d51630086afca179df11fd6997
---
 src/plugins/bearer/symbian/symbianengine.cpp |  98 ++++++++--------
 src/plugins/bearer/symbian/symbianengine.h   |   5 +-
 tests/manual/bearerex/bearerex.cpp           |  90 ++++++++------
 tests/manual/bearerex/bearerex.h             |  15 ++-
 tests/manual/bearerex/bearerex.pro           |   6 +-
 tests/manual/bearerex/sessiondialog.ui       | 168 +++++++++++++++++----------
 6 files changed, 223 insertions(+), 159 deletions(-)

diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index 3d462ee..8780218 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -46,7 +46,6 @@
 #include <cdbcols.h>
 #include <d32dbms.h>
 #include <nifvar.h>
-#include <QEventLoop>
 #include <QTimer>
 #include <QTime>  // For randgen seeding
 #include <QtCore> // For randgen seeding
@@ -115,7 +114,7 @@ QString SymbianNetworkConfigurationPrivate::bearerName() const
 
 SymbianEngine::SymbianEngine(QObject *parent)
 :   QBearerEngine(parent), CActive(CActive::EPriorityIdle), iFirstUpdate(true), iInitOk(true),
-    iIgnoringUpdates(false)
+    iUpdatePending(false)
 {
 }
 
@@ -190,6 +189,28 @@ SymbianEngine::~SymbianEngine()
     delete cleanup;
 }
 
+void SymbianEngine::delayedConfigurationUpdate()
+{
+    QMutexLocker locker(&mutex);
+
+    if (iUpdatePending) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+        qDebug("QNCM delayed configuration update (ECommit or ERecover occurred).");
+#endif
+        TRAPD(error, updateConfigurationsL());
+        if (error == KErrNone) {
+            updateStatesToSnaps();
+        }
+        iUpdatePending = false;
+        // Start monitoring again.
+        if (!IsActive()) {
+            SetActive();
+            // Start waiting for new notification
+            ipCommsDB->RequestNotification(iStatus);
+        }
+    }
+}
+
 bool SymbianEngine::hasIdentifier(const QString &id)
 {
     QMutexLocker locker(&mutex);
@@ -872,55 +893,30 @@ void SymbianEngine::RunL()
 {
     QMutexLocker locker(&mutex);
 
-    if (iIgnoringUpdates) {
-#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
-        qDebug("QNCM CommsDB event handling postponed (postpone-timer running because IAPs/SNAPs were updated very recently).");
-#endif
-        return;
-    }
-
-    RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int());
-
-    switch (event) {
-    case RDbNotifier::EUnlock:   /** All read locks have been removed.  */
-    case RDbNotifier::ECommit:   /** A transaction has been committed.  */
-    case RDbNotifier::ERollback: /** A transaction has been rolled back */
-    case RDbNotifier::ERecover:  /** The database has been recovered    */
+    if (iStatus != KErrCancel) {
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
         qDebug("QNCM CommsDB event (of type RDbNotifier::TEvent) received: %d", iStatus.Int());
 #endif
-        iIgnoringUpdates = true;
-        // Other events than ECommit get lower priority. In practice with those events,
-        // we delay_before_updating methods, whereas
-        // with ECommit we _update_before_delaying the reaction to next event.
-        // Few important notes: 1) listening to only ECommit does not seem to be adequate,
-        // but updates will be missed. Hence other events are reacted upon too.
-        // 2) RDbNotifier records the most significant event, and that will be returned once
-        // we issue new RequestNotification, and hence updates will not be missed even
-        // when we are 'not reacting to them' for few seconds.
-        if (event == RDbNotifier::ECommit) {
-            TRAPD(error, updateConfigurationsL());
-            if (error == KErrNone) {
-                QT_TRYCATCH_LEAVING(updateStatesToSnaps());
-            }
-            locker.unlock();
-            waitRandomTime();
-            locker.relock();
-        } else {
-            locker.unlock();
-            waitRandomTime();
-            locker.relock();
-            TRAPD(error, updateConfigurationsL());
-            if (error == KErrNone) {
-                QT_TRYCATCH_LEAVING(updateStatesToSnaps());
+        // By default, start relistening notifications. Stop only if interesting event occured.
+        iWaitingCommsDatabaseNotifications = true;
+        RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int());
+        switch (event) {
+        case RDbNotifier::ECommit:   /** A transaction has been committed.  */
+        case RDbNotifier::ERecover:  /** The database has been recovered    */
+            // Mark that there is update pending. No need to ask more events,
+            // as we know we will be updating anyway when the timer expires.
+            if (!iUpdatePending) {
+                iUpdatePending = true;
+                iWaitingCommsDatabaseNotifications = false;
+                // Update after random time, so that many processes won't
+                // start updating simultaneously
+                updateConfigurationsAfterRandomTime();
             }
+            break;
+        default:
+            // Do nothing
+            break;
         }
-        iIgnoringUpdates = false; // Wait time done, allow updating again
-        iWaitingCommsDatabaseNotifications = true;
-        break;
-    default:
-        // Do nothing
-        break;
     }
 
     if (iWaitingCommsDatabaseNotifications) {
@@ -1135,15 +1131,13 @@ void SymbianEngine::configurationStateChangeReport(TUint32 accessPointId, QNetwo
 }
 
 // Waits for 2..6 seconds.
-void SymbianEngine::waitRandomTime()
+void SymbianEngine::updateConfigurationsAfterRandomTime()
 {
-    int iTimeToWait = qMax(2000, (qAbs(qrand()) % 7) * 1000);
+    int iTimeToWait = qMax(1000, (qAbs(qrand()) % 68) * 100);
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
     qDebug("QNCM waiting random time: %d ms", iTimeToWait);
 #endif
-    QEventLoop loop;
-    QTimer::singleShot(iTimeToWait, &loop, SLOT(quit()));
-    loop.exec();
+    QTimer::singleShot(iTimeToWait, this, SLOT(delayedConfigurationUpdate()));
 }
 
 QNetworkConfigurationPrivatePointer SymbianEngine::dataByConnectionId(TUint aConnectionId)
@@ -1164,7 +1158,7 @@ QNetworkConfigurationPrivatePointer SymbianEngine::dataByConnectionId(TUint aCon
 
 AccessPointsAvailabilityScanner::AccessPointsAvailabilityScanner(SymbianEngine& owner,
                                                                RConnectionMonitor& connectionMonitor)
-    : CActive(CActive::EPriorityStandard), iOwner(owner), iConnectionMonitor(connectionMonitor)
+    : CActive(CActive::EPriorityHigh), iOwner(owner), iConnectionMonitor(connectionMonitor)
 {
     CActiveScheduler::Add(this);  
 }
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index 18fd249..27f3db4 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -159,6 +159,7 @@ Q_SIGNALS:
     
 public Q_SLOTS:
     void updateConfigurations();
+    void delayedConfigurationUpdate();
 
 private:
     void updateStatesToSnaps();
@@ -183,7 +184,7 @@ private:
     void accessPointScanningReady(TBool scanSuccessful, TConnMonIapInfo iapInfo);
     void startCommsDatabaseNotifications();
     void stopCommsDatabaseNotifications();
-    void waitRandomTime();
+    void updateConfigurationsAfterRandomTime();
 
     QNetworkConfigurationPrivatePointer defaultConfigurationL();
     TBool GetS60PlatformVersion(TUint& aMajor, TUint& aMinor) const;
@@ -211,7 +212,7 @@ private: // Data
     TBool              iOnline;
     TBool              iInitOk;
     TBool              iUpdateGoingOn;
-    TBool              iIgnoringUpdates;
+    TBool              iUpdatePending;
 
     AccessPointsAvailabilityScanner* ipAccessPointsAvailabilityScanner;
 
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp
index bf60dd1..00cb481 100644
--- a/tests/manual/bearerex/bearerex.cpp
+++ b/tests/manual/bearerex/bearerex.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -40,6 +40,7 @@
 ****************************************************************************/
 
 #include "bearerex.h"
+#include "datatransferer.h"
 
 #include <QtNetwork>
 
@@ -261,8 +262,8 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration,
                        QListWidget* eventListWidget,
                        int index,
                        BearerEx * parent)
-    : QWidget(parent), m_http(0), m_eventListWidget(eventListWidget),
-     m_index(index), m_httpRequestOngoing(false), m_alrEnabled (false)
+    : QWidget(parent), m_dataTransferer(0), m_eventListWidget(eventListWidget),
+     m_index(index), m_alrEnabled (false)
 {
     setupUi(this);
 
@@ -300,41 +301,46 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration,
 
 SessionTab::~SessionTab()
 {
-    // Need to be nulled, because modal dialogs may return after destruction of this object and
-    // use already released resources.
-    delete m_NetworkSession;
-    m_NetworkSession = NULL;
-    delete m_http;
-    m_http = NULL;
+    delete m_NetworkSession; m_NetworkSession = 0;
+    delete m_dataTransferer; m_dataTransferer = 0;
 }
 
-void SessionTab::on_createQHttpButton_clicked()
+void SessionTab::on_createQNetworkAccessManagerButton_clicked()
 {
-    if (m_httpRequestOngoing) {
-        return;
+    if (m_dataTransferer) {
+        disconnect(m_dataTransferer, 0, 0, 0);
+        delete m_dataTransferer;
+        m_dataTransferer = 0;
     }
-
-    if (m_http) {
-        disconnect(m_http, 0, 0, 0);
-        delete m_http;
+    // Create new object according to current selection
+    QString type(comboBox->currentText());
+    if (type == "QNAM") {
+        m_dataTransferer = new DataTransfererQNam(this);
+    } else if (type == "QTcpSocket") {
+        m_dataTransferer = new DataTransfererQTcp(this);
+    } else if (type == "QHttp") {
+        m_dataTransferer = new DataTransfererQHttp(this);
+    } else {
+        qDebug("BearerEx Warning, unknown data transfer object requested, not creating anything.");
+        return;
     }
-    m_http = new QHttp(this);
-    createQHttpButton->setText("Recreate QHttp");
-    connect(m_http, SIGNAL(done(bool)), this, SLOT(done(bool)));    
+    createQNetworkAccessManagerButton->setText("Recreate");
+    connect(m_dataTransferer, SIGNAL(finished(quint32, qint64, QString)), this, SLOT(finished(quint32, qint64, QString)));
 }
 
 void SessionTab::on_sendRequestButton_clicked()
 {
-    if (m_http) {
-        QString urlstring("http://www.google.com");
-        QUrl url(urlstring);
-        m_http->setHost(url.host(), QHttp::ConnectionModeHttp, url.port() == -1 ? 0 : url.port());
-        m_http->get(urlstring);
-        m_httpRequestOngoing = true;
+    if (m_dataTransferer) {
+        if (!m_dataTransferer->transferData()) {
+            QMessageBox msgBox;
+            msgBox.setStandardButtons(QMessageBox::Close);
+            msgBox.setText("Data transfer not started. \nVery likely data transfer ongoing.");
+            msgBox.exec();
+        }
     } else {
         QMessageBox msgBox;
         msgBox.setStandardButtons(QMessageBox::Close);
-        msgBox.setText("QHttp not created.\nCreate QHttp First.");
+        msgBox.setText("Data object not created.\nCreate data object first.");
         msgBox.exec();
     }
 }
@@ -419,7 +425,7 @@ void SessionTab::opened()
     listItem->setText(QString("S")+QString::number(m_index)+QString(" - ")+QString("Opened"));
     m_eventListWidget->addItem(listItem);
     
-    QVariant identifier = m_NetworkSession->property("ActiveConfiguration");
+    QVariant identifier = m_NetworkSession->sessionProperty("ActiveConfiguration");
     if (!identifier.isNull()) {
         QString configId = identifier.toString();
         QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId);
@@ -429,7 +435,7 @@ void SessionTab::opened()
     }
 
     if (m_NetworkSession->configuration().type() == QNetworkConfiguration::UserChoice) {
-        QVariant identifier = m_NetworkSession->property("UserChoiceConfiguration");
+        QVariant identifier = m_NetworkSession->sessionProperty("UserChoiceConfiguration");
         if (!identifier.isNull()) {
             QString configId = identifier.toString();
             QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId);
@@ -480,6 +486,18 @@ QString SessionTab::stateString(QNetworkSession::State state)
     return stateString;
 }
 
+void SessionTab::on_dataObjectChanged(const QString &newObjectType)
+{
+    qDebug() << "BearerEx SessionTab dataObjectChanged to: " << newObjectType;
+    if (m_dataTransferer) {
+        disconnect(m_dataTransferer, 0, 0, 0);
+        delete m_dataTransferer; m_dataTransferer = 0;
+        qDebug() << "BearerEx SessionTab, previous data object deleted.";
+    }
+    createQNetworkAccessManagerButton->setText("Create");
+}
+
+
 void SessionTab::stateChanged(QNetworkSession::State state)    
 {
     newState(state);
@@ -491,7 +509,7 @@ void SessionTab::stateChanged(QNetworkSession::State state)
 
 void SessionTab::newState(QNetworkSession::State state)
 {
-    QVariant identifier = m_NetworkSession->property("ActiveConfiguration");
+    QVariant identifier = m_NetworkSession->sessionProperty("ActiveConfiguration");
     if (state == QNetworkSession::Connected && !identifier.isNull()) {
         QString configId = identifier.toString();
         QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId);
@@ -542,18 +560,14 @@ void SessionTab::error(QNetworkSession::SessionError error)
     msgBox.exec();
 }
 
-void SessionTab::done(bool error)
+void SessionTab::finished(quint32 errorCode, qint64 dataReceived, QString errorType)
 {
-    m_httpRequestOngoing = false;
-
     QMessageBox msgBox;
     msgBox.setStandardButtons(QMessageBox::Close);
-    if (error) {
-        msgBox.setText("HTTP request failed.");
-    } else {
-        QString result(m_http->readAll());
-        msgBox.setText(QString("HTTP request finished successfully.\nReceived ")+QString::number(result.length())+QString(" bytes."));
-    }
+    msgBox.setText(QString("Data transfer completed. \nError code: ") + QString::number(errorCode) +
+                   "\nError type: " + errorType +
+                   "\nBytes received: " +
+                   QString::number(dataReceived));
     msgBox.exec();
     // Check if the networksession still exists - it may have gone after returning from
     // the modal dialog (in the case that app has been closed, and deleting QHttp will
diff --git a/tests/manual/bearerex/bearerex.h b/tests/manual/bearerex/bearerex.h
index 6bcb3e5..b81d486 100644
--- a/tests/manual/bearerex/bearerex.h
+++ b/tests/manual/bearerex/bearerex.h
@@ -55,13 +55,16 @@
 #endif
 #include "qnetworkconfigmanager.h"
 #include "qnetworksession.h"
+#include "datatransferer.h"
 #include "xqlistwidget.h"
 
 QT_BEGIN_NAMESPACE
-class QHttp;
+class QNetworkAccessManager;
+class QNetworkReply;
 QT_END_NAMESPACE
 
 class SessionTab;
+class DataTransferer;
 
 QT_USE_NAMESPACE
 
@@ -113,14 +116,15 @@ public:
     QString stateString(QNetworkSession::State state);    
 
 private Q_SLOTS:
-    void on_createQHttpButton_clicked();
+    void on_createQNetworkAccessManagerButton_clicked();
     void on_sendRequestButton_clicked();
     void on_openSessionButton_clicked();
     void on_closeSessionButton_clicked();
     void on_stopConnectionButton_clicked();
     void on_deleteSessionButton_clicked();
+    void on_dataObjectChanged(const QString& newObjectType);
     void on_alrButton_clicked();
-    void done(bool error);
+    void finished(quint32 errorCode, qint64 dataReceived, QString errorType);
     
     void newConfigurationActivated();
     void preferredConfigurationChanged(const QNetworkConfiguration& config, bool isSeamless);
@@ -131,13 +135,14 @@ private Q_SLOTS:
     void error(QNetworkSession::SessionError error);
 
 private: //data
-    QHttp* m_http;
+    // QNetworkAccessManager* m_networkAccessManager;
+    DataTransferer* m_dataTransferer;
     QNetworkSession* m_NetworkSession;
     QNetworkConfigurationManager* m_ConfigManager;
     QListWidget* m_eventListWidget;
     QNetworkConfiguration m_config;
     int m_index;
-    bool m_httpRequestOngoing;
+    bool m_dataTransferOngoing;
     bool m_alrEnabled;
 };
 
diff --git a/tests/manual/bearerex/bearerex.pro b/tests/manual/bearerex/bearerex.pro
index 7b21183..df39c85 100644
--- a/tests/manual/bearerex/bearerex.pro
+++ b/tests/manual/bearerex/bearerex.pro
@@ -17,10 +17,12 @@ maemo5|maemo6 {
 
 # Example headers and sources
 HEADERS += bearerex.h \
-           xqlistwidget.h
+           xqlistwidget.h \
+    datatransferer.h
     
 SOURCES += bearerex.cpp \
            main.cpp \
-           xqlistwidget.cpp
+           xqlistwidget.cpp \
+    datatransferer.cpp
 
 symbian:TARGET.CAPABILITY = NetworkServices NetworkControl ReadUserData
diff --git a/tests/manual/bearerex/sessiondialog.ui b/tests/manual/bearerex/sessiondialog.ui
index fcf2136..c50af70 100644
--- a/tests/manual/bearerex/sessiondialog.ui
+++ b/tests/manual/bearerex/sessiondialog.ui
@@ -1,78 +1,87 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>SessionTab</class>
- <widget class="QWidget" name="SessionTab" >
-  <layout class="QVBoxLayout" name="verticalLayout" >
+ <widget class="QWidget" name="SessionTab">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>192</width>
+    <height>262</height>
+   </rect>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
    <item>
-    <layout class="QFormLayout" name="formLayout" >
-     <item row="0" column="0" >
-      <widget class="QLabel" name="snapLabel" >
-       <property name="text" >
+    <layout class="QFormLayout" name="formLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="snapLabel">
+       <property name="text">
         <string>SNAP</string>
        </property>
       </widget>
      </item>
-     <item row="0" column="1" >
-      <widget class="QLineEdit" name="snapLineEdit" >
-       <property name="readOnly" >
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="snapLineEdit">
+       <property name="readOnly">
         <bool>true</bool>
        </property>
       </widget>
      </item>
-     <item row="1" column="0" >
-      <widget class="QLabel" name="iapLabel" >
-       <property name="text" >
+     <item row="1" column="0">
+      <widget class="QLabel" name="iapLabel">
+       <property name="text">
         <string>IAP</string>
        </property>
       </widget>
      </item>
-     <item row="1" column="1" >
-      <widget class="QLineEdit" name="iapLineEdit" >
-       <property name="enabled" >
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="iapLineEdit">
+       <property name="enabled">
         <bool>true</bool>
        </property>
-       <property name="readOnly" >
+       <property name="readOnly">
         <bool>true</bool>
        </property>
       </widget>
      </item>
-     <item row="2" column="0" >
-      <widget class="QLabel" name="bearerLabel" >
-       <property name="text" >
+     <item row="2" column="0">
+      <widget class="QLabel" name="bearerLabel">
+       <property name="text">
         <string>Bearer</string>
        </property>
       </widget>
      </item>
-     <item row="2" column="1" >
-      <widget class="QLineEdit" name="bearerLineEdit" >
-       <property name="readOnly" >
+     <item row="2" column="1">
+      <widget class="QLineEdit" name="bearerLineEdit">
+       <property name="readOnly">
         <bool>true</bool>
        </property>
       </widget>
      </item>
-     <item row="3" column="0" >
-      <widget class="QLabel" name="sentRecDataLabel" >
-       <property name="text" >
+     <item row="3" column="0">
+      <widget class="QLabel" name="sentRecDataLabel">
+       <property name="text">
         <string>Sent/Rec.</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="1" >
-      <widget class="QLineEdit" name="sentRecDataLineEdit" >
-       <property name="readOnly" >
+     <item row="3" column="1">
+      <widget class="QLineEdit" name="sentRecDataLineEdit">
+       <property name="readOnly">
         <bool>true</bool>
        </property>
       </widget>
      </item>
-     <item row="4" column="0" >
-      <widget class="QLabel" name="stateLabel" >
-       <property name="text" >
+     <item row="4" column="0">
+      <widget class="QLabel" name="stateLabel">
+       <property name="text">
         <string>State</string>
        </property>
       </widget>
      </item>
-     <item row="4" column="1" >
-      <widget class="QLineEdit" name="stateLineEdit" >
-       <property name="readOnly" >
+     <item row="4" column="1">
+      <widget class="QLineEdit" name="stateLineEdit">
+       <property name="readOnly">
         <bool>true</bool>
        </property>
       </widget>
@@ -80,52 +89,71 @@
     </layout>
    </item>
    <item>
-    <layout class="QGridLayout" name="gridLayout" >
-     <item row="0" column="0" >
-      <widget class="QPushButton" name="openSessionButton" >
-       <property name="text" >
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0">
+      <widget class="QPushButton" name="openSessionButton">
+       <property name="text">
         <string>Open Session</string>
        </property>
       </widget>
      </item>
-     <item row="0" column="1" >
-      <widget class="QPushButton" name="closeSessionButton" >
-       <property name="text" >
+     <item row="0" column="1">
+      <widget class="QPushButton" name="closeSessionButton">
+       <property name="text">
         <string>Close Session</string>
        </property>
       </widget>
      </item>
-     <item row="1" column="0" >
-      <widget class="QPushButton" name="stopConnectionButton" >
-       <property name="text" >
+     <item row="1" column="0">
+      <widget class="QPushButton" name="stopConnectionButton">
+       <property name="text">
         <string>Stop Conn.</string>
        </property>
       </widget>
      </item>
-     <item row="2" column="0" >
-      <widget class="QPushButton" name="createQHttpButton" >
-       <property name="text" >
-        <string>Create QHttp</string>
+     <item row="1" column="1">
+      <widget class="QPushButton" name="alrButton">
+       <property name="text">
+        <string>Enable ALR</string>
        </property>
       </widget>
      </item>
-     <item row="2" column="1" >
-      <widget class="QPushButton" name="sendRequestButton" >
-       <property name="text" >
+     <item row="3" column="0">
+      <widget class="QPushButton" name="sendRequestButton">
+       <property name="text">
         <string>Send Test Req.</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="0" >
-      <widget class="QPushButton" name="alrButton" >
-       <property name="text" >
-        <string>Enable ALR</string>
+     <item row="2" column="1">
+      <widget class="QPushButton" name="createQNetworkAccessManagerButton">
+       <property name="text">
+        <string>Create</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="1" >
-      <widget class="QPushButton" name="deleteSessionButton" >
-       <property name="text" >
+     <item row="2" column="0">
+      <widget class="QComboBox" name="comboBox">
+       <item>
+        <property name="text">
+         <string>QNAM</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>QTcpSocket</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>QHttp</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+     <item row="3" column="1">
+      <widget class="QPushButton" name="deleteSessionButton">
+       <property name="text">
         <string>Delete Session</string>
        </property>
       </widget>
@@ -135,5 +163,25 @@
   </layout>
  </widget>
  <resources/>
- <connections/>
+ <connections>
+  <connection>
+   <sender>comboBox</sender>
+   <signal>currentIndexChanged(QString)</signal>
+   <receiver>SessionTab</receiver>
+   <slot>on_dataObjectChanged(QString)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>40</x>
+     <y>211</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>10</x>
+     <y>258</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>on_dataObjectChanged(QString)</slot>
+ </slots>
 </ui>
-- 
cgit v0.12


From 8d07f723041c223d0d1346a1ce5e5ede17af32ad Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Thu, 10 Jun 2010 15:04:16 +1000
Subject: Cherry pick fix for MOBILITY-1031 from Qt Mobility.

7e8b55524bd8a00e49e11103e8c8091e1e59e612
---
 .../bearer/symbian/qnetworksession_impl.cpp        |  7 ++--
 src/plugins/bearer/symbian/symbianengine.cpp       | 41 ++++++++++++----------
 src/plugins/bearer/symbian/symbianengine.h         |  3 ++
 3 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 20e13d2..04ae396 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -910,8 +910,8 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
         //    <=> Note: It's possible that in this case reported IAP is
         //              clone of the one of the IAPs of the used SNAP
         //              => If mappingName matches, clone has been found
-        QNetworkConfiguration pt = QNetworkConfigurationManager()
-                                    .configurationFromIdentifier(QString::number(qHash(iapId)));
+        QNetworkConfiguration pt = QNetworkConfigurationManager().configurationFromIdentifier(
+                QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId)));
 
         SymbianNetworkConfigurationPrivate *symbianConfig =
             toSymbianConfig(privateConfiguration(pt));
@@ -938,7 +938,8 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
     
     if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
         if (engine) {
-            QNetworkConfiguration pt = QNetworkConfigurationManager().configurationFromIdentifier(QString::number(qHash(iapId)));
+            QNetworkConfiguration pt = QNetworkConfigurationManager().configurationFromIdentifier(
+                    QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId)));
             // Try to found User Selected IAP from known IAPs (accessPointConfigurations)
             if (pt.isValid()) {
                 return pt;
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index 8780218..cf7e7a5 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -72,9 +72,6 @@
 
 QT_BEGIN_NAMESPACE
 
-#ifdef SNAP_FUNCTIONALITY_AVAILABLE
-    static const int KValueThatWillBeAddedToSNAPId = 1000;
-#endif
 static const int KUserChoiceIAPId = 0;
 
 SymbianNetworkConfigurationPrivate::SymbianNetworkConfigurationPrivate()
@@ -113,7 +110,7 @@ QString SymbianNetworkConfigurationPrivate::bearerName() const
 }
 
 SymbianEngine::SymbianEngine(QObject *parent)
-:   QBearerEngine(parent), CActive(CActive::EPriorityIdle), iFirstUpdate(true), iInitOk(true),
+:   QBearerEngine(parent), CActive(CActive::EPriorityHigh), iFirstUpdate(true), iInitOk(true),
     iUpdatePending(false)
 {
 }
@@ -282,7 +279,7 @@ void SymbianEngine::updateConfigurationsL()
         RCmConnectionMethod connectionMethod = iCmManager.ConnectionMethodL(connectionMethods[i]);
         CleanupClosePushL(connectionMethod);
         TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
-        QString ident = QString::number(qHash(iapId));
+        QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
         if (accessPointConfigurations.contains(ident)) {
             knownConfigs.removeOne(ident);
         } else {
@@ -313,7 +310,8 @@ void SymbianEngine::updateConfigurationsL()
         RCmDestination destination;
         destination = iCmManager.DestinationL(destinations[i]);
         CleanupClosePushL(destination);
-        QString ident = QString::number(qHash(destination.Id()+KValueThatWillBeAddedToSNAPId)); //TODO: Check if it's ok to add 1000 SNAP Id to prevent SNAP ids overlapping IAP ids
+        QString ident = QT_BEARERMGMT_CONFIGURATION_SNAP_PREFIX +
+                        QString::number(qHash(destination.Id()));
         if (snapConfigurations.contains(ident)) {
             knownSnapConfigs.removeOne(ident);
         } else {
@@ -347,7 +345,7 @@ void SymbianEngine::updateConfigurationsL()
             CleanupClosePushL(connectionMethod);
             
             TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
-            QString iface = QString::number(qHash(iapId));
+            QString iface = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
             // Check that IAP can be found from accessPointConfigurations list
             QNetworkConfigurationPrivatePointer priv = accessPointConfigurations.value(iface);
             if (!priv) {
@@ -402,7 +400,7 @@ void SymbianEngine::updateConfigurationsL()
     TInt retVal = pDbTView->GotoFirstRecord();
     while (retVal == KErrNone) {
         pDbTView->ReadUintL(TPtrC(COMMDB_ID), apId);
-        QString ident = QString::number(qHash(apId));
+        QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
         if (accessPointConfigurations.contains(ident)) {
             knownConfigs.removeOne(ident);
         } else {
@@ -470,7 +468,7 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
 {
     SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate;
     TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
-    QString ident = QString::number(qHash(iapId));
+    QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
     
     HBufC *pName = connectionMethod.GetStringAttributeL(CMManager::ECmName);
     CleanupStack::PushL(pName);
@@ -570,7 +568,7 @@ void SymbianEngine::readNetworkConfigurationValuesFromCommsDbL(
         User::Leave(KErrNotFound);
     }
     
-    QString ident = QString::number(qHash(aApId));
+    QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(aApId));
     
     QT_TRYCATCH_LEAVING(apNetworkConfiguration->name = QString::fromUtf16(name.Ptr(),name.Length()));
     apNetworkConfiguration->isValid = true;
@@ -637,10 +635,12 @@ QNetworkConfigurationPrivatePointer SymbianEngine::defaultConfigurationL()
     TCmDefConnValue defaultConnectionValue;
     iCmManager.ReadDefConnL(defaultConnectionValue);
     if (defaultConnectionValue.iType == ECmDefConnDestination) {
-        QString iface = QString::number(qHash(defaultConnectionValue.iId+KValueThatWillBeAddedToSNAPId));
+        QString iface = QT_BEARERMGMT_CONFIGURATION_SNAP_PREFIX +
+                        QString::number(qHash(defaultConnectionValue.iId));
         ptr = snapConfigurations.value(iface);
     } else if (defaultConnectionValue.iType == ECmDefConnConnectionMethod) {
-        QString iface = QString::number(qHash(defaultConnectionValue.iId));
+        QString iface = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+                        QString::number(qHash(defaultConnectionValue.iId));
         ptr = accessPointConfigurations.value(iface);
     }
 #endif
@@ -678,7 +678,7 @@ void SymbianEngine::updateActiveAccessPoints()
             iConnectionMonitor.GetConnectionInfo(i, connectionId, subConnectionCount);
             iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
             User::WaitForRequest(status);
-            QString ident = QString::number(qHash(apId));
+            QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
             if (ptr) {
                 iConnectionMonitor.GetIntAttribute(connectionId, subConnectionCount, KConnectionStatus, connectionStatus, status);
@@ -735,7 +735,8 @@ void SymbianEngine::accessPointScanningReady(TBool scanSuccessful, TConnMonIapIn
         // Set state of returned IAPs to Discovered
         // if state is not already Active
         for(TUint i=0; i<iapInfo.iCount; i++) {
-            QString ident = QString::number(qHash(iapInfo.iIap[i].iIapId));
+            QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+                            QString::number(qHash(iapInfo.iIap[i].iIapId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
             if (ptr) {
                 unavailableConfigs.removeOne(ident);
@@ -955,7 +956,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             TRequestStatus status;
             iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
             User::WaitForRequest(status);
-            QString ident = QString::number(qHash(apId));
+            QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
             if (ptr) {
                 ptr->mutex.lock();
@@ -974,7 +975,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             TRequestStatus status;
             iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
             User::WaitForRequest(status);
-            QString ident = QString::number(qHash(apId));
+            QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
             if (ptr) {
                 ptr->mutex.lock();
@@ -1045,7 +1046,8 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
         TConnMonIapInfo iaps = realEvent->IapAvailability();
         QList<QString> unDiscoveredConfigs = accessPointConfigurations.keys();
         for ( TUint i = 0; i < iaps.Count(); i++ ) {
-            QString ident = QString::number(qHash(iaps.iIap[i].iIapId));
+            QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+                            QString::number(qHash(iaps.iIap[i].iIapId));
 
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
             if (ptr) {
@@ -1075,7 +1077,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
         TRequestStatus status;
         iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
         User::WaitForRequest(status);
-        QString ident = QString::number(qHash(apId));
+        QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
         QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
         if (ptr) {
             QMutexLocker configLocker(&ptr->mutex);
@@ -1109,7 +1111,8 @@ void SymbianEngine::configurationStateChangeReport(TUint32 accessPointId, QNetwo
     switch (newState) {
     case QNetworkSession::Disconnected:
         {
-            QString ident = QString::number(qHash(accessPointId));
+            QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+                            QString::number(qHash(accessPointId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
             if (ptr) {
                 // Configuration is either Defined or Discovered
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index 27f3db4..8e58994 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -55,6 +55,9 @@
 // Uncomment and compile QtBearer to gain detailed state tracing
 // #define QT_BEARERMGMT_SYMBIAN_DEBUG
 
+#define QT_BEARERMGMT_CONFIGURATION_SNAP_PREFIX QLatin1String("S_")
+#define QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX  QLatin1String("I_")
+
 class CCommsDatabase;
 class QEventLoop;
 
-- 
cgit v0.12


From 3c766b835fd565e3a85606ae2d4891e3954b447a Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Thu, 10 Jun 2010 15:43:31 +1000
Subject: Merge bearermanagement changes from Qt Mobility.

cba220f177154428d6103a93a819668be689a591
---
 config.tests/mac/corewlan/corewlantest.mm    |   2 +-
 examples/network/bearercloud/bearercloud.cpp |   2 +-
 examples/network/bearercloud/main.cpp        |   2 +-
 examples/network/bearermonitor/main.cpp      |   2 +-
 tests/auto/qbearertestcommon.h               |   2 +-
 tests/manual/bearerex/datatransferer.cpp     | 220 +++++++++++++++++++++++++++
 tests/manual/bearerex/datatransferer.h       | 130 ++++++++++++++++
 tests/manual/bearerex/main.cpp               |   2 +-
 tests/manual/bearerex/xqlistwidget.cpp       |   2 +-
 tests/manual/bearerex/xqlistwidget.h         |   2 +-
 10 files changed, 358 insertions(+), 8 deletions(-)
 create mode 100644 tests/manual/bearerex/datatransferer.cpp
 create mode 100644 tests/manual/bearerex/datatransferer.h

diff --git a/config.tests/mac/corewlan/corewlantest.mm b/config.tests/mac/corewlan/corewlantest.mm
index 3a29d84..ee6f661 100644
--- a/config.tests/mac/corewlan/corewlantest.mm
+++ b/config.tests/mac/corewlan/corewlantest.mm
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
diff --git a/examples/network/bearercloud/bearercloud.cpp b/examples/network/bearercloud/bearercloud.cpp
index 9e58c73..cc73954 100644
--- a/examples/network/bearercloud/bearercloud.cpp
+++ b/examples/network/bearercloud/bearercloud.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
diff --git a/examples/network/bearercloud/main.cpp b/examples/network/bearercloud/main.cpp
index c0c0023..6665311 100644
--- a/examples/network/bearercloud/main.cpp
+++ b/examples/network/bearercloud/main.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
diff --git a/examples/network/bearermonitor/main.cpp b/examples/network/bearermonitor/main.cpp
index 0bbbb56..1a22c13 100644
--- a/examples/network/bearermonitor/main.cpp
+++ b/examples/network/bearermonitor/main.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
diff --git a/tests/auto/qbearertestcommon.h b/tests/auto/qbearertestcommon.h
index c9df249..138c444 100644
--- a/tests/auto/qbearertestcommon.h
+++ b/tests/auto/qbearertestcommon.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
diff --git a/tests/manual/bearerex/datatransferer.cpp b/tests/manual/bearerex/datatransferer.cpp
new file mode 100644
index 0000000..c3c13a8
--- /dev/null
+++ b/tests/manual/bearerex/datatransferer.cpp
@@ -0,0 +1,220 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDebug>
+#include <QUrl>
+#include <QByteArray>
+#include <QDataStream>
+#include "datatransferer.h"
+
+DataTransferer::DataTransferer(QObject *parent) :
+    QObject(parent), m_dataTransferOngoing(false)
+{
+}
+
+bool DataTransferer::dataTransferOngoing()
+{
+    return m_dataTransferOngoing;
+}
+
+
+
+// -------- Based on QTcp
+
+DataTransfererQTcp::DataTransfererQTcp(QObject* parent)
+:   DataTransferer(parent)
+{
+    qDebug("BearerEx DataTransferer QTcp created.");
+
+    connect(&m_qsocket, SIGNAL(readyRead()), this, SLOT(readyRead()));
+    connect(&m_qsocket, SIGNAL(connected()), this, SLOT(connected()));
+    connect(&m_qsocket, SIGNAL(error(QAbstractSocket::SocketError)),
+            this, SLOT(error(QAbstractSocket::SocketError)));
+}
+
+DataTransfererQTcp::~DataTransfererQTcp()
+{
+    qDebug("BearerEx DataTransferer QTcp destroyed.");
+    m_qsocket.abort();
+}
+
+bool DataTransfererQTcp::transferData()
+{
+    if (m_dataTransferOngoing) {
+        return false;
+    }
+    qDebug("BearerEx datatransfer for QTcp requested.");
+    // Connect to host
+    QUrl url("http://www.google.com.au");
+    m_qsocket.connectToHost(url.host(), url.port(80));
+
+    // m_qsocket.connectToHost("http://www.google.com", 80);
+    // Wait for connected() signal.
+    m_dataTransferOngoing = true;
+    return true;
+}
+
+void DataTransfererQTcp::connected()
+{
+    qDebug("BearerEx DataTransfererQtcp connected, requesting data.");
+    // Establish HTTP request
+    //QByteArray request("GET / HTTP/1.1 \nHost: www.google.com\n\n");
+    QByteArray request("GET / HTTP/1.1\n\n");
+
+    // QByteArray request("GET /index.html HTTP/1.1 \n Host: www.google.com \n\n");
+    qint64 dataWritten = m_qsocket.write(request);
+    m_qsocket.flush();
+
+    qDebug() << "BearerEx DataTransferQTcp wrote " << dataWritten << " bytes";
+    // Start waiting for readyRead() of error()
+}
+
+void DataTransfererQTcp::readyRead()
+{
+    qDebug() << "BearerEx DataTransfererQTcp readyRead() with ";
+    qint64 bytesAvailable = m_qsocket.bytesAvailable();
+    qDebug() << bytesAvailable << " bytes available.";
+
+    // QDataStream in(&m_qsocket);
+    QByteArray array = m_qsocket.readAll();
+    QString data = QString::fromAscii(array);
+
+    // in >> data;
+
+    qDebug() << "BearerEx DataTransferQTcp data received: " << data;
+    m_dataTransferOngoing = false;
+    // m_qsocket.error() returns uninitialized value in case no error has occured,
+    // so emit '0'
+    emit finished(0, bytesAvailable, "QAbstractSocket::SocketError");
+}
+
+void DataTransfererQTcp::error(QAbstractSocket::SocketError socketError)
+{
+    qDebug("BearerEx DataTransfererQTcp error(), aborting socket.");
+    m_qsocket.abort();
+    m_dataTransferOngoing = false;
+    emit finished(socketError, 0, "QAbstractSocket::SocketError");
+}
+
+// -------- Based on QHttp
+
+DataTransfererQHttp::DataTransfererQHttp(QObject* parent)
+:   DataTransferer(parent)
+{
+    connect(&m_qhttp, SIGNAL(done(bool)), this, SLOT(done(bool)));
+    qDebug("BearerEx DataTransferer QHttp created.");
+}
+
+DataTransfererQHttp::~DataTransfererQHttp()
+{
+    qDebug("BearerEx DataTransferer QHttp destroyed.");
+}
+
+bool DataTransfererQHttp::transferData()
+{
+    qDebug("BearerEx datatransfer for QHttp requested.");
+    if (m_dataTransferOngoing) {
+        return false;
+    }
+    QString urlstring("http://www.google.com");
+    QUrl url(urlstring);
+    m_qhttp.setHost(url.host(), QHttp::ConnectionModeHttp, url.port() == -1 ? 0 : url.port());
+    m_qhttp.get(urlstring);
+    m_dataTransferOngoing = true;
+    return true;
+}
+
+void DataTransfererQHttp::done(bool /*error*/ )
+{
+    qDebug("BearerEx DatatransfererQHttp reply was finished (error code is type QHttp::Error).");
+    qint64 dataReceived = 0;
+    quint32 errorCode = m_qhttp.error();
+    if (m_qhttp.error() == QHttp::NoError) {
+        QString result(m_qhttp.readAll());
+        dataReceived = result.length();
+    }
+    m_dataTransferOngoing = false;
+    emit finished(errorCode, dataReceived, "QHttp::Error");
+}
+
+// -------- Based on QNetworkAccessManager
+
+DataTransfererQNam::DataTransfererQNam(QObject* parent)
+:   DataTransferer(parent)
+{
+    connect(&m_qnam, SIGNAL(finished(QNetworkReply*)),
+            this, SLOT(replyFinished(QNetworkReply*)));
+    qDebug("BearerEx DataTransferer QNam created.");
+}
+
+DataTransfererQNam::~DataTransfererQNam()
+{
+    qDebug("BearerEx DataTransferer QNam destroyed.");
+}
+
+bool DataTransfererQNam::transferData()
+{
+    qDebug("BearerEx datatransfer for QNam requested.");
+    if (m_dataTransferOngoing) {
+        return false;
+    }
+    m_qnam.get(QNetworkRequest(QUrl("http://www.google.com")));
+    m_dataTransferOngoing = true;
+    return true;
+}
+
+void DataTransfererQNam::replyFinished(QNetworkReply *reply)
+{
+    qDebug("BearerEx DatatransfererQNam reply was finished (error code is type QNetworkReply::NetworkError).");
+    qint64 dataReceived = 0;
+    quint32 errorCode = (quint32)reply->error();
+
+    if (reply->error() == QNetworkReply::NoError) {
+        QString result(reply->readAll());
+        dataReceived = result.length();
+    }
+    m_dataTransferOngoing = false;
+    emit finished(errorCode, dataReceived, "QNetworkReply::NetworkError");
+    reply->deleteLater();
+}
+
+
+
diff --git a/tests/manual/bearerex/datatransferer.h b/tests/manual/bearerex/datatransferer.h
new file mode 100644
index 0000000..f2159b7
--- /dev/null
+++ b/tests/manual/bearerex/datatransferer.h
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DATATRANSFERER_H
+#define DATATRANSFERER_H
+
+#include <QObject>
+#include <QString>
+#include <QNetworkReply>
+#include <QNetworkAccessManager>
+#include <QTcpSocket>
+#include <QHttp>
+#include <QDebug>
+
+// Interface-class for data transferring object
+
+class DataTransferer : public QObject
+{
+    Q_OBJECT
+public:
+    explicit DataTransferer(QObject *parent = 0);
+    virtual ~DataTransferer() {
+        if (m_dataTransferOngoing) {
+            qDebug("BearerEx Warning: dataobjects transfer was ongoing when destroyed.");
+        }
+    }
+    virtual bool transferData() = 0;
+    bool dataTransferOngoing();
+
+signals:
+    void finished(quint32 errorCode, qint64 dataReceived, QString errorType);
+
+public slots:
+
+protected:
+    bool m_dataTransferOngoing;
+};
+
+
+// Specializations/concrete classes
+
+class DataTransfererQTcp : public DataTransferer
+{
+    Q_OBJECT
+public:
+    DataTransfererQTcp(QObject* parent = 0);
+    ~DataTransfererQTcp();
+
+    virtual bool transferData();
+
+public slots:
+    void readyRead();
+    void error(QAbstractSocket::SocketError socketError);
+    void connected();
+
+private:
+    QTcpSocket m_qsocket;
+};
+
+class DataTransfererQNam : public DataTransferer
+{
+    Q_OBJECT
+public:
+    DataTransfererQNam(QObject* parent = 0);
+    ~DataTransfererQNam();
+
+    virtual bool transferData();
+
+public slots:
+    void replyFinished(QNetworkReply* reply);
+
+private:
+    QNetworkAccessManager m_qnam;
+};
+
+class DataTransfererQHttp : public DataTransferer
+{
+    Q_OBJECT
+public:
+    DataTransfererQHttp(QObject* parent = 0);
+    ~DataTransfererQHttp();
+
+    virtual bool transferData();
+
+public slots:
+    void done(bool error);
+
+private:
+    QHttp m_qhttp;
+};
+
+#endif // DATATRANSFERER_H
diff --git a/tests/manual/bearerex/main.cpp b/tests/manual/bearerex/main.cpp
index 20b167e..704321a 100644
--- a/tests/manual/bearerex/main.cpp
+++ b/tests/manual/bearerex/main.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
diff --git a/tests/manual/bearerex/xqlistwidget.cpp b/tests/manual/bearerex/xqlistwidget.cpp
index 8104779..e4b12f2 100644
--- a/tests/manual/bearerex/xqlistwidget.cpp
+++ b/tests/manual/bearerex/xqlistwidget.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
diff --git a/tests/manual/bearerex/xqlistwidget.h b/tests/manual/bearerex/xqlistwidget.h
index 0649c2b..7c12138 100644
--- a/tests/manual/bearerex/xqlistwidget.h
+++ b/tests/manual/bearerex/xqlistwidget.h
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
-- 
cgit v0.12


From 12c06cfb761b1c8b3575df9ad6d1aabdbd2ed402 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Thu, 10 Jun 2010 15:59:23 +1000
Subject: Cherry pick fix for MOBILITY-1047 from Qt Mobility.

4f74cd44d77349759096bed091913b188a9167e4
---
 examples/network/bearermonitor/bearermonitor.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index 4a04b4c..98869ea 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -80,7 +80,7 @@ BearerMonitor::BearerMonitor(QWidget *parent)
             break;
         }
     }
-
+    connect(&manager, SIGNAL(onlineStateChanged(bool)), this ,SLOT(onlineStateChanged(bool)));
     connect(&manager, SIGNAL(configurationAdded(const QNetworkConfiguration&)),
             this, SLOT(configurationAdded(const QNetworkConfiguration&)));
     connect(&manager, SIGNAL(configurationRemoved(const QNetworkConfiguration&)),
@@ -88,7 +88,6 @@ BearerMonitor::BearerMonitor(QWidget *parent)
     connect(&manager, SIGNAL(configurationChanged(const QNetworkConfiguration&)),
             this, SLOT(configurationChanged(const QNetworkConfiguration)));
     connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations()));
-    connect(&manager, SIGNAL(onlineStateChanged(bool)), this ,SLOT(onlineStateChanged(bool)));
 
 #ifdef Q_OS_WIN
     connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork()));
@@ -111,6 +110,10 @@ BearerMonitor::BearerMonitor(QWidget *parent)
 #endif
     connect(scanButton, SIGNAL(clicked()),
             this, SLOT(performScan()));
+
+    // Just in case update all configurations so that all
+    // configurations are up to date.
+    manager.updateConfigurations();
 }
 
 BearerMonitor::~BearerMonitor()
@@ -209,6 +212,10 @@ void BearerMonitor::updateConfigurations()
     progressBar->hide();
     scanButton->show();
 
+    // Just in case update online state, on Symbian platform
+    // WLAN scan needs to be triggered initially to have their true state.
+    onlineStateChanged(manager.isOnline());
+
     QList<QTreeWidgetItem *> items = treeWidget->findItems(QLatin1String("*"), Qt::MatchWildcard);
     QMap<QString, QTreeWidgetItem *> itemMap;
     while (!items.isEmpty()) {
-- 
cgit v0.12


From 4aeb66d9c3e22a84d3c9bd916b8277537a2c4a2f Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Thu, 10 Jun 2010 16:02:23 +1000
Subject: Cherry pick fix for MOBILITY-853 from Qt Mobility.

256e67963c4cb0fc150e6c47193e7c9b17296611
---
 src/plugins/bearer/symbian/symbianengine.cpp | 70 ++++++++++++++++++++++++++++
 src/plugins/bearer/symbian/symbianengine.h   |  1 +
 2 files changed, 71 insertions(+)

diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index cf7e7a5..bda3e56 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -131,6 +131,9 @@ void SymbianEngine::initialize()
     }
 
     TRAP_IGNORE(iConnectionMonitor.ConnectL());
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+    TRAP_IGNORE(iConnectionMonitor.SetUintAttribute(EBearerIdAll, 0, KBearerGroupThreshold, 1));
+#endif
     TRAP_IGNORE(iConnectionMonitor.NotifyEventL(*this));
 
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
@@ -804,6 +807,59 @@ void SymbianEngine::updateStatesToSnaps()
     }    
 }
 
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+void SymbianEngine::updateMobileBearerToConfigs(TConnMonBearerInfo bearerInfo)
+{
+    QHash<QString, QNetworkConfigurationPrivatePointer>::const_iterator i =
+        accessPointConfigurations.constBegin();
+    while (i != accessPointConfigurations.constEnd()) {
+        QNetworkConfigurationPrivatePointer ptr = i.value();
+
+        QMutexLocker locker(&ptr->mutex);
+
+        SymbianNetworkConfigurationPrivate *p = toSymbianConfig(ptr);
+
+        if (p->bearer >= SymbianNetworkConfigurationPrivate::Bearer2G &&
+            p->bearer <= SymbianNetworkConfigurationPrivate::BearerHSPA) {
+            switch (bearerInfo) {
+            case EBearerInfoCSD:
+                p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+                break;
+            case EBearerInfoWCDMA:
+                p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA;
+                break;
+            case EBearerInfoCDMA2000:
+                p->bearer = SymbianNetworkConfigurationPrivate::BearerCDMA2000;
+                break;
+            case EBearerInfoGPRS:
+                p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+                break;
+            case EBearerInfoHSCSD:
+                p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+                break;
+            case EBearerInfoEdgeGPRS:
+                p->bearer = SymbianNetworkConfigurationPrivate::Bearer2G;
+                break;
+            case EBearerInfoWcdmaCSD:
+                p->bearer = SymbianNetworkConfigurationPrivate::BearerWCDMA;
+                break;
+            case EBearerInfoHSDPA:
+                p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+                break;
+            case EBearerInfoHSUPA:
+                p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+                break;
+            case EBearerInfoHSxPA:
+                p->bearer = SymbianNetworkConfigurationPrivate::BearerHSPA;
+                break;
+            }
+        }
+
+        ++i;
+    }
+}
+#endif
+
 bool SymbianEngine::changeConfigurationStateTo(QNetworkConfigurationPrivatePointer ptr,
                                                QNetworkConfiguration::StateFlags newState)
 {
@@ -941,6 +997,20 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
     QMutexLocker locker(&mutex);
 
     switch (aEvent.EventType()) {
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+    case EConnMonBearerInfoChange:
+        {
+        CConnMonBearerInfoChange* realEvent;
+        realEvent = (CConnMonBearerInfoChange*) &aEvent;
+        TUint connectionId = realEvent->ConnectionId();
+        if (connectionId == EBearerIdAll) {
+            //Network level event
+            TConnMonBearerInfo bearerInfo = (TConnMonBearerInfo)realEvent->BearerInfo();
+            updateMobileBearerToConfigs(bearerInfo);
+        }
+        break;
+        }
+#endif
     case EConnMonConnectionStatusChange:
         {
         CConnMonConnectionStatusChange* realEvent;
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index 8e58994..d95d4d5 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -173,6 +173,7 @@ private:
     bool changeConfigurationStateAtMaxTo(QNetworkConfigurationPrivatePointer ptr,
                                          QNetworkConfiguration::StateFlags newState);
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
+    void updateMobileBearerToConfigs(TConnMonBearerInfo bearerInfo);
     SymbianNetworkConfigurationPrivate *configFromConnectionMethodL(RCmConnectionMethod& connectionMethod);
 #else
     bool readNetworkConfigurationValuesFromCommsDb(
-- 
cgit v0.12


From 94797fdd2e752677a5665abc9b23aa22f8a9c4db Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Thu, 10 Jun 2010 16:18:01 +1000
Subject: Cherry pick fix for MOBILITY-800 from Qt Mobility.

a05504d2a0c643c6f253527f07bcc0dba8a799b4
---
 .../bearer/symbian/qnetworksession_impl.cpp        | 30 +++++++++++++++++-----
 src/plugins/bearer/symbian/qnetworksession_impl.h  |  5 ++++
 tests/manual/bearerex/bearerex.cpp                 |  3 ++-
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 04ae396..b90d603 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -63,7 +63,12 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
     iMobility = NULL;
 #endif
-
+    // Try to load "Open C" dll dynamically and
+    // try to attach to unsetdefaultif function dynamically.
+    // This is to avoid build breaks with old OpenC versions.
+    if (iOpenCLibrary.Load(_L("libc")) == KErrNone) {
+        iDynamicUnSetdefaultif = (TOpenCUnSetdefaultifFunction)iOpenCLibrary.Lookup(597);
+    }
     TRAP_IGNORE(iConnectionMonitor.ConnectL());
 }
 
@@ -86,14 +91,15 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
         iMobility = NULL;
     }
 #endif
-
     iConnection.Close();
     iSocketServ.Close();
     
     // Close global 'Open C' RConnection
+    // Clears also possible unsetdefaultif() flags.
     setdefaultif(0);
     
     iConnectionMonitor.Close();
+    iOpenCLibrary.Close();
 }
 
 void QNetworkSessionPrivateImpl::configurationStateChanged(TUint32 accessPointId, TUint32 connMonId, QNetworkSession::State newState)
@@ -525,8 +531,15 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
     iConnection.Close();
     iSocketServ.Close();
     
-    // Close global 'Open C' RConnection
-    setdefaultif(0);
+    // Close global 'Open C' RConnection. If OpenC supports,
+    // close the defaultif for good to avoid difficult timing
+    // and bouncing issues of network going immediately back up
+    //  because of e.g. select() thread etc.
+    if (iDynamicUnSetdefaultif) {
+        iDynamicUnSetdefaultif();
+    } else {
+        setdefaultif(0);
+    }
 
     if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
         newState(QNetworkSession::Closing);
@@ -611,8 +624,13 @@ void QNetworkSessionPrivateImpl::migrate()
 {
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
     if (iMobility) {
-        // Close global 'Open C' RConnection
-        setdefaultif(0);
+        // Close global 'Open C' RConnection. If openC supports, use the 'heavy'
+        // version to block all subsequent requests.
+        if (iDynamicUnSetdefaultif) {
+            iDynamicUnSetdefaultif();
+        } else {
+            setdefaultif(0);
+        }
         // Start migrating to new IAP
         iMobility->MigrateToPreferredCarrier();
     }
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index b045ff1..4b4f28c 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -73,6 +73,8 @@ QT_BEGIN_NAMESPACE
 class ConnectionProgressNotifier;
 class SymbianEngine;
 
+typedef void (*TOpenCUnSetdefaultifFunction)();
+
 class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate, public CActive
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
                                  , public MMobilityProtocolResp
@@ -153,6 +155,9 @@ private: // data
 
     QDateTime startTime;
 
+    RLibrary iOpenCLibrary;
+    TOpenCUnSetdefaultifFunction iDynamicUnSetdefaultif;
+
     mutable RSocketServ iSocketServ;
     mutable RConnection iConnection;
     mutable RConnectionMonitor iConnectionMonitor;
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp
index 00cb481..6f280db 100644
--- a/tests/manual/bearerex/bearerex.cpp
+++ b/tests/manual/bearerex/bearerex.cpp
@@ -564,7 +564,8 @@ void SessionTab::finished(quint32 errorCode, qint64 dataReceived, QString errorT
 {
     QMessageBox msgBox;
     msgBox.setStandardButtons(QMessageBox::Close);
-    msgBox.setText(QString("Data transfer completed. \nError code: ") + QString::number(errorCode) +
+    msgBox.setText(QString("Data transfer completed. \nError code: ") +
+                   QString::number(int(errorCode)) +
                    "\nError type: " + errorType +
                    "\nBytes received: " +
                    QString::number(dataReceived));
-- 
cgit v0.12


From 94c64b9ae4d539e9578156a0df999de1605f858f Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Thu, 10 Jun 2010 16:23:34 +1000
Subject: Cherry pick fix for MOBILITY-965 from Qt Mobility.

50de830ded2dcc1c6b4d8be71428d9a2bfed6ae7
---
 .../bearer/symbian/qnetworksession_impl.cpp        | 84 ++++++++++++++++++++--
 src/plugins/bearer/symbian/symbianengine.cpp       | 70 ++++++++++++++++--
 src/plugins/bearer/symbian/symbianengine.h         |  3 +
 3 files changed, 147 insertions(+), 10 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index b90d603..940281c 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -69,6 +69,7 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
     if (iOpenCLibrary.Load(_L("libc")) == KErrNone) {
         iDynamicUnSetdefaultif = (TOpenCUnSetdefaultifFunction)iOpenCLibrary.Lookup(597);
     }
+
     TRAP_IGNORE(iConnectionMonitor.ConnectL());
 }
 
@@ -91,6 +92,7 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
         iMobility = NULL;
     }
 #endif
+
     iConnection.Close();
     iSocketServ.Close();
     
@@ -433,6 +435,10 @@ void QNetworkSessionPrivateImpl::open()
             toSymbianConfig(privateConfiguration(publicConfig));
 
 #ifdef OCC_FUNCTIONALITY_AVAILABLE
+        // On Symbian^3 if service network is not reachable, it triggers a UI (aka EasyWLAN) where
+        // user can create new IAPs. To detect this, we need to store the number of IAPs
+        // there was before connection was started.
+        iKnownConfigsBeforeConnectionStart = engine->accessPointConfigurationIdentifiers();
         TConnPrefList snapPref;
         TExtendedConnPref prefs;
         prefs.SetSnapId(symbianConfig->numericIdentifier());
@@ -511,7 +517,11 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
     iClosedByUser = true;
 
     isOpen = false;
+#ifndef OCC_FUNCTIONALITY_AVAILABLE
+    // On Symbian^3 we need to keep track of active configuration longer
+    // in case of empty-SNAP-triggered EasyWLAN.
     activeConfig = QNetworkConfiguration();
+#endif
     serviceConfig = QNetworkConfiguration();
     
     Cancel();
@@ -906,7 +916,7 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
         _LIT(KSetting, "IAP\\Id");
         iConnection.GetIntSetting(KSetting, iapId);
     }
- 
+
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
     if (publicConfig.type() == QNetworkConfiguration::ServiceNetwork) {
         // Try to search IAP from the used SNAP using IAP Id
@@ -943,17 +953,54 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
                 }
             }
         } else {
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+            // On Symbian^3 (only, not earlier or Symbian^4) if the SNAP was not reachable, it triggers
+            // user choice type of activity (EasyWLAN). As a result, a new IAP may be created, and
+            // hence if was not found yet. Therefore update configurations and see if there is something new.
+            // 1. Update knowledge from the databases.
+            engine->requestUpdate();
+            // 2. Check if new configuration was created during connection creation
+            QList<QString> knownConfigs = engine->accessPointConfigurationIdentifiers();
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+            qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+                    << "opened configuration was not known beforehand, looking for new.";
+#endif
+            if (knownConfigs.count() > iKnownConfigsBeforeConnectionStart.count()) {
+                // Configuration count increased => new configuration was created
+                // => Search new, created configuration
+                QString newIapId;
+                for (int i=0; i < iKnownConfigsBeforeConnectionStart.count(); i++) {
+                    if (knownConfigs[i] != iKnownConfigsBeforeConnectionStart[i]) {
+                        newIapId = knownConfigs[i];
+                        break;
+                    }
+                }
+                if (newIapId.isEmpty()) {
+                    newIapId = knownConfigs[knownConfigs.count()-1];
+                }
+                pt = QNetworkConfigurationManager().configurationFromIdentifier(newIapId);
+                if (pt.isValid()) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+                    qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+                            << "new configuration was found, name, IAP id: " << pt.name() << pt.identifier();
+#endif
+                    return pt;
+                }
+            }
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+            qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+                    << "configuration was not found, returning invalid.";
+#endif
+#endif // OCC_FUNCTIONALITY_AVAILABLE
             // Given IAP Id was not found from known IAPs array
             return QNetworkConfiguration();
         }
-
         // Matching IAP was not found from used SNAP
         // => IAP from another SNAP is returned
         //    (Note: Returned IAP matches to given IAP Id)
         return pt;
     }
 #endif
-    
     if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
         if (engine) {
             QNetworkConfiguration pt = QNetworkConfigurationManager().configurationFromIdentifier(
@@ -994,6 +1041,10 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
 
 void QNetworkSessionPrivateImpl::RunL()
 {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+    qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+            << "RConnection::RunL with status code: " << iStatus.Int();
+#endif
     TInt statusCode = iStatus.Int();
 
     switch (statusCode) {
@@ -1226,7 +1277,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
                         QNetworkConfiguration config = bestConfigFromSNAP(publicConfig);
                         if ((config.state() == QNetworkConfiguration::Defined) ||
                             (config.state() == QNetworkConfiguration::Discovered)) {
-
+                            activeConfig = QNetworkConfiguration();
                             state = newState;
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
                             qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed E  to: " << state;
@@ -1247,6 +1298,21 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
                     }
                 }
             }
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+            // If the retVal is not true here, it means that the status update may apply to an IAP outside of
+            // SNAP (session is based on SNAP but follows IAP outside of it), which may occur on Symbian^3 EasyWlan.
+            if (retVal == false && activeConfig.d.data() && activeConfig.d.data()->numericId == accessPointId) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+                qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed G  to: " << state;
+#endif
+                if (newState == QNetworkSession::Disconnected) {
+                    activeConfig = QNetworkConfiguration();
+                }
+                state = newState;
+                emit q->stateChanged(state);
+                retVal = true;
+            }
+#endif
         }
     }
     
@@ -1262,9 +1328,15 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
         SymbianNetworkConfigurationPrivate *symbianConfig =
             toSymbianConfig(privateConfiguration(publicConfig));
 
-        iDeprecatedConnectionId = symbianConfig->connectionIdentifier();
-    }
+        symbianConfig->mutex.lock();
+        iDeprecatedConnectionId = symbianConfig->connectionId;
+        symbianConfig->mutex.unlock();
 
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+        // Just in case clear activeConfiguration.
+        activeConfig = QNetworkConfiguration();
+#endif
+    }
     return retVal;
 }
 
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index bda3e56..ca444c1 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -683,6 +683,12 @@ void SymbianEngine::updateActiveAccessPoints()
             User::WaitForRequest(status);
             QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+            if (!ptr) {
+                // If IAP was not found, check if the update was about EasyWLAN
+                ptr = configurationFromEasyWlan(apId, connectionId);
+            }
+#endif
             if (ptr) {
                 iConnectionMonitor.GetIntAttribute(connectionId, subConnectionCount, KConnectionStatus, connectionStatus, status);
                 User::WaitForRequest(status);          
@@ -713,7 +719,7 @@ void SymbianEngine::updateActiveAccessPoints()
     if (iOnline != online) {
         iOnline = online;
         mutex.unlock();
-        emit this->onlineStateChanged(iOnline);
+        emit this->onlineStateChanged(online);
         mutex.lock();
     }
 }
@@ -951,15 +957,15 @@ void SymbianEngine::RunL()
     QMutexLocker locker(&mutex);
 
     if (iStatus != KErrCancel) {
-#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
-        qDebug("QNCM CommsDB event (of type RDbNotifier::TEvent) received: %d", iStatus.Int());
-#endif
         // By default, start relistening notifications. Stop only if interesting event occured.
         iWaitingCommsDatabaseNotifications = true;
         RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int());
         switch (event) {
         case RDbNotifier::ECommit:   /** A transaction has been committed.  */
         case RDbNotifier::ERecover:  /** The database has been recovered    */
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+            qDebug("QNCM CommsDB event (of type RDbNotifier::TEvent) received: %d", iStatus.Int());
+#endif
             // Mark that there is update pending. No need to ask more events,
             // as we know we will be updating anyway when the timer expires.
             if (!iUpdatePending) {
@@ -1026,8 +1032,15 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             TRequestStatus status;
             iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount, KIAPId, apId, status);
             User::WaitForRequest(status);
+
             QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+            if (!ptr) {
+                // Check if status was regarding EasyWLAN
+                ptr = configurationFromEasyWlan(apId, connectionId);
+            }
+#endif
             if (ptr) {
                 ptr->mutex.lock();
                 toSymbianConfig(ptr)->connectionId = connectionId;
@@ -1047,6 +1060,12 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
             User::WaitForRequest(status);
             QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
             QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+            if (!ptr) {
+                // Check for EasyWLAN
+                ptr = configurationFromEasyWlan(apId, connectionId);
+            }
+#endif
             if (ptr) {
                 ptr->mutex.lock();
                 toSymbianConfig(ptr)->connectionId = connectionId;
@@ -1149,6 +1168,12 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
         User::WaitForRequest(status);
         QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
         QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+        if (!ptr) {
+            // If IAP was not found, check if the update was about EasyWLAN
+            ptr = configurationFromEasyWlan(apId, connectionId);
+        }
+#endif
         if (ptr) {
             QMutexLocker configLocker(&ptr->mutex);
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
@@ -1164,6 +1189,43 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
     }
 }
 
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+// Tries to derive configuration from EasyWLAN.
+// First checks if the interface brought up was EasyWLAN, then derives the real SSID,
+// and looks up configuration based on that one.
+QNetworkConfigurationPrivatePointer SymbianEngine::configurationFromEasyWlan(TUint32 apId, TUint connectionId)
+{
+    if (apId == iCmManager.EasyWlanIdL()) {
+        TRequestStatus status;
+        TBuf<50> easyWlanNetworkName;
+        iConnectionMonitor.GetStringAttribute( connectionId, 0, KNetworkName,
+                                               easyWlanNetworkName, status );
+        User::WaitForRequest(status);
+        if (status.Int() == KErrNone) {
+            QString realSSID = QString::fromUtf16(easyWlanNetworkName.Ptr(), easyWlanNetworkName.Length());
+
+            // Browser through all items and check their name for match
+            QHash<QString, QExplicitlySharedDataPointer<QNetworkConfigurationPrivate> >::const_iterator i =
+                    accessPointConfigurations.constBegin();
+            while (i != accessPointConfigurations.constEnd()) {
+                QNetworkConfigurationPrivatePointer ptr = i.value();
+
+                QMutexLocker configLocker(&ptr->mutex);
+
+                if (ptr->name == realSSID) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+                    qDebug() << "QNCM EasyWlan uses real SSID: " << realSSID;
+#endif
+                    return ptr;
+                }
+                ++i;
+            }
+        }
+    }
+    return QNetworkConfigurationPrivatePointer();
+}
+#endif
+
 // Sessions may use this function to report configuration state changes,
 // because on some Symbian platforms (especially Symbian^3) all state changes are not
 // reported by the RConnectionMonitor, in particular in relation to stop() call,
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index d95d4d5..cfddc29 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -206,6 +206,9 @@ private:
     // For QNetworkSessionPrivate to indicate about state changes
     void configurationStateChangeReport(TUint32 accessPointId,
                                    QNetworkSession::State newState);
+#ifdef OCC_FUNCTIONALITY_AVAILABLE
+    QNetworkConfigurationPrivatePointer configurationFromEasyWlan(TUint32 apId, TUint connectionId);
+#endif
 
 private: // Data
     bool               iFirstUpdate; 
-- 
cgit v0.12


From 2faa2ff804a8ed4e0bb60a4d11cd424a0e160dc8 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Fri, 11 Jun 2010 13:03:19 +1000
Subject: Cherry pick fix for MOBILITY-1063 from Qt Mobility.

37ad80914f7acb8d4f3364d78e75d48cd14e8e2a
---
 .../bearer/symbian/qnetworksession_impl.cpp        | 69 +++++-------------
 .../qnetworksession/test/tst_qnetworksession.cpp   | 84 ++++++++++++++++++++--
 2 files changed, 96 insertions(+), 57 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 940281c..cce8095 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -83,9 +83,6 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
     delete ipConnectionNotifier;
     ipConnectionNotifier = NULL;
 
-    // Cancel possible RConnection::Start()
-    Cancel();
-    
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
     if (iMobility) {
         delete iMobility;
@@ -93,7 +90,8 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
     }
 #endif
 
-    iConnection.Close();
+    // Cancel possible RConnection::Start()
+    Cancel();
     iSocketServ.Close();
     
     // Close global 'Open C' RConnection
@@ -366,44 +364,6 @@ void QNetworkSessionPrivateImpl::open()
     }
     
     if (publicConfig.type() == QNetworkConfiguration::InternetAccessPoint) {
-        // Search through existing connections.
-        // If there is already connection which matches to given IAP
-        // try to attach to existing connection.
-        TBool connected(EFalse);
-        TConnectionInfoBuf connInfo;
-        TUint count;
-        if (iConnection.EnumerateConnections(count) == KErrNone) {
-            for (TUint i=1; i<=count; i++) {
-                // Note: GetConnectionInfo expects 1-based index.
-                if (iConnection.GetConnectionInfo(i, connInfo) == KErrNone) {
-                    SymbianNetworkConfigurationPrivate *symbianConfig =
-                        toSymbianConfig(privateConfiguration(publicConfig));
-
-                    if (connInfo().iIapId == symbianConfig->numericIdentifier()) {
-                        if (iConnection.Attach(connInfo, RConnection::EAttachTypeNormal) == KErrNone) {
-                            activeConfig = publicConfig;
-#ifndef QT_NO_NETWORKINTERFACE
-                            activeInterface = interface(symbianConfig->numericIdentifier());
-#endif
-                            connected = ETrue;
-                            startTime = QDateTime::currentDateTime();
-                            // Use name of the IAP to open global 'Open C' RConnection
-                            QByteArray nameAsByteArray = publicConfig.name().toUtf8();
-                            ifreq ifr;
-                            memset(&ifr, 0, sizeof(struct ifreq));
-                            strcpy(ifr.ifr_name, nameAsByteArray.constData());
-                            error = setdefaultif(&ifr);
-                            isOpen = true;
-                            // Make sure that state will be Connected
-                            newState(QNetworkSession::Connected);
-                            emit quitPendingWaitsForOpened();
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-        if (!connected) {
             SymbianNetworkConfigurationPrivate *symbianConfig =
                 toSymbianConfig(privateConfiguration(publicConfig));
 
@@ -429,7 +389,6 @@ void QNetworkSessionPrivateImpl::open()
                 SetActive();
             }
             newState(QNetworkSession::Connecting);
-        }
     } else if (publicConfig.type() == QNetworkConfiguration::ServiceNetwork) {
         SymbianNetworkConfigurationPrivate *symbianConfig =
             toSymbianConfig(privateConfiguration(publicConfig));
@@ -508,15 +467,16 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
             << "close() called, session state is: " << state << " and isOpen is : "
             << isOpen;
 #endif
-    if (!isOpen) {
+
+    if (!isOpen && state != QNetworkSession::Connecting) {
         return;
     }
     // Mark this session as closed-by-user so that we are able to report
     // distinguish between stop() and close() state transitions
     // when reporting.
     iClosedByUser = true;
-
     isOpen = false;
+
 #ifndef OCC_FUNCTIONALITY_AVAILABLE
     // On Symbian^3 we need to keep track of active configuration longer
     // in case of empty-SNAP-triggered EasyWLAN.
@@ -524,7 +484,6 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
 #endif
     serviceConfig = QNetworkConfiguration();
     
-    Cancel();
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
     if (iMobility) {
         delete iMobility;
@@ -538,7 +497,7 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
         iHandleStateNotificationsFromManager = true;
     }
     
-    iConnection.Close();
+    Cancel(); // closes iConnection
     iSocketServ.Close();
     
     // Close global 'Open C' RConnection. If OpenC supports,
@@ -551,11 +510,20 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
         setdefaultif(0);
     }
 
-    if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
+    // If UserChoice, go down immediately. If some other configuration,
+    // go down immediately if there is no reports expected from the platform;
+    // in practice Connection Monitor is aware of connections only after
+    // KFinishedSelection event, and hence reports only after that event, but
+    // that does not seem to be trusted on all Symbian versions --> safest
+    // to go down.
+    if (publicConfig.type() == QNetworkConfiguration::UserChoice || state == QNetworkSession::Connecting) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+    qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+             << "going Disconnected because session was Connecting.";
+#endif
         newState(QNetworkSession::Closing);
         newState(QNetworkSession::Disconnected);
     }
-    
     if (allowSignals) {
         emit closed();
     }
@@ -755,7 +723,7 @@ void QNetworkSessionPrivateImpl::Error(TInt /*aError*/)
 {
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
     qDebug() << "QNS this : " << QString::number((uint)this) << " - "
-            << "roaming Error() occured";
+            << "roaming Error() occured, isOpen is: " << isOpen;
 #endif
     if (isOpen) {
         isOpen = false;
@@ -1361,7 +1329,6 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
         case KFinishedSelection:
             if (aError == KErrNone)
                 {
-                // The user successfully selected an IAP to be used
                 break;
                 }
             else
diff --git a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
index e4f2486..e4b8c14 100644
--- a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
@@ -75,17 +75,20 @@ private slots:
 
     void robustnessBombing();
 
+    void sessionClosing_data();
+    void sessionClosing();
+
     void outOfProcessSession();
     void invalidSession();
 
     void repeatedOpenClose_data();
     void repeatedOpenClose();
-    
-    void roamingErrorCodes();
-    
+
     void sessionStop_data();
     void sessionStop();
 
+    void roamingErrorCodes();
+    
     void sessionProperties_data();
     void sessionProperties();
 
@@ -131,6 +134,7 @@ void tst_QNetworkSession::initTestCase()
     // If you wish to skip tests, set value as false. This is often very convinient because tests are so lengthy.
     // Better way still would be to make this readable from a file.
     testsToRun["robustnessBombing"] = true;
+    testsToRun["sessionClosing"] = true;
     testsToRun["outOfProcessSession"] = true;
     testsToRun["invalidSession"] = true;
     testsToRun["repeatedOpenClose"] = true;
@@ -265,6 +269,53 @@ void tst_QNetworkSession::robustnessBombing()
     testSession.reject();
 }
 
+void tst_QNetworkSession::sessionClosing_data() {
+    QTest::addColumn<QString>("bearerType");
+    QTest::addColumn<QNetworkConfiguration::Type>("configurationType");
+
+    QTest::newRow("WLAN_IAP") << "WLAN" << QNetworkConfiguration::InternetAccessPoint;
+    QTest::newRow("Cellular_IAP") << "cellular" << QNetworkConfiguration::InternetAccessPoint;
+    QTest::newRow("SNAP") << "bearer_type_not_relevant_with_SNAPs" << QNetworkConfiguration::ServiceNetwork;
+}
+
+// Testcase for closing the session at unexpected times
+void tst_QNetworkSession::sessionClosing()
+{
+    if (!testsToRun["sessionClosing"]) {
+        QSKIP("Temporary skip due to value set false (or it is missing) in testsToRun map", SkipAll);
+    }
+    QFETCH(QString, bearerType);
+    QFETCH(QNetworkConfiguration::Type, configurationType);
+
+    // Update configurations so that WLANs are discovered too.
+    updateConfigurations();
+
+    // First check that opening once succeeds and determine if test is doable
+    QNetworkConfiguration config = suitableConfiguration(bearerType, configurationType);
+    if (!config.isValid()) {
+        QSKIP("No suitable configurations, skipping this round of repeated open-close test.", SkipSingle);
+    }
+    qDebug() << "Using following configuration to bomb with close(): " << config.name();
+    QNetworkSession session(config);
+    if (!openSession(&session) ||
+        !closeSession(&session)) {
+        QSKIP("Unable to open/close session, skipping this round of close() bombing.", SkipSingle);
+    }
+
+    qDebug() << "Closing without issuing open()";
+    session.close();
+
+    for (int i = 0; i < 25; i++) {
+        qDebug() << "Opening and then waiting: " << i * 100 << " ms before closing.";
+        session.open();
+        QTest::qWait(i*100);
+        session.close();
+        // Sooner or later session must end in Disconnected state,
+        // no matter what the phase was.
+        QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
+        QTest::qWait(200); // Give platform a breathe, otherwise we'll be catching other errors
+    }
+}
 
 void tst_QNetworkSession::invalidSession()
 { 
@@ -1060,15 +1111,27 @@ void tst_QNetworkSession::sessionOpenCloseStop()
                     QTRY_VERIFY(stateChangedSpy.count() > 0);
                     state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 1).at(0));                    
                     
+                    for (int i = 0; i < stateChangedSpy.count(); i++) {
+                        QNetworkSession::State state_temp =
+                                qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(i).at(0));
+                        // Extra debug because a fragile point in testcase because statuses vary.
+                        qDebug() << "------- Statechange spy at: " << i << " is " << state_temp;
+                    }
+
                     if (state == QNetworkSession::Roaming) {
                         QTRY_VERIFY(session.state() == QNetworkSession::Connected);
                         QTRY_VERIFY(session2.state() == QNetworkSession::Connected);
                         roamedSuccessfully = true;
+                    } else if (state == QNetworkSession::Closing) {
+                        QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
+                        QTRY_VERIFY(session.state() == QNetworkSession::Connected);
+                        roamedSuccessfully = true;
                     } else if (state == QNetworkSession::Disconnected) {
                         QTRY_VERIFY(!errorSpy.isEmpty());
                         QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
                   	} else if (state == QNetworkSession::Connected) {
                         QTRY_VERIFY(errorSpy.isEmpty());
+
                         if (stateChangedSpy.count() > 1) {
                             state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 2).at(0));                        
                             QVERIFY(state == QNetworkSession::Roaming);
@@ -1102,9 +1165,18 @@ void tst_QNetworkSession::sessionOpenCloseStop()
                         QVERIFY(state == QNetworkSession::Closing);
                         state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
                         QVERIFY(state == QNetworkSession::Disconnected);
-                    } else { // Assume .count() == 1
-                        QCOMPARE(stateChangedSpy2.count(), 1); 
-                        QNetworkSession::State state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
+                    } else {
+                        QVERIFY(stateChangedSpy2.count() >= 1);
+
+                        for (int i = 0; i < stateChangedSpy2.count(); i++) {
+                            QNetworkSession::State state_temp =
+                                    qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(i).at(0));
+                            // Extra debug because a fragile point in testcase.
+                            qDebug() << "+++++ Statechange spy at: " << i << " is " << state_temp;
+                        }
+
+                        QNetworkSession::State state =
+                                qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(stateChangedSpy2.count() - 1).at(0));
                          // Symbian version dependant.
                         QVERIFY(state == QNetworkSession::Disconnected);	
                     }
-- 
cgit v0.12


From 91413d5ad27e97a95df4ab9a25f8c71548dbf3c3 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Fri, 11 Jun 2010 13:11:06 +1000
Subject: Cherry pick fix for QTMOBILITY-253 from Qt Mobility.

f3d7f49b7f6975cbfa65adeb10b281e2b37172ce
---
 examples/network/bearermonitor/bearermonitor_240_320.ui | 2 +-
 examples/network/bearermonitor/bearermonitor_640_480.ui | 2 +-
 examples/network/bearermonitor/bearermonitor_maemo.ui   | 2 +-
 examples/network/bearermonitor/sessionwidget.ui         | 2 +-
 examples/network/bearermonitor/sessionwidget_maemo.ui   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/network/bearermonitor/bearermonitor_240_320.ui b/examples/network/bearermonitor/bearermonitor_240_320.ui
index ce9c2d1..93cfc5e 100644
--- a/examples/network/bearermonitor/bearermonitor_240_320.ui
+++ b/examples/network/bearermonitor/bearermonitor_240_320.ui
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Form</string>
+   <string>BearerMonitor</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_5">
    <item>
diff --git a/examples/network/bearermonitor/bearermonitor_640_480.ui b/examples/network/bearermonitor/bearermonitor_640_480.ui
index 941eaa0..52866bc 100644
--- a/examples/network/bearermonitor/bearermonitor_640_480.ui
+++ b/examples/network/bearermonitor/bearermonitor_640_480.ui
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Form</string>
+   <string>BearerMonitor</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
diff --git a/examples/network/bearermonitor/bearermonitor_maemo.ui b/examples/network/bearermonitor/bearermonitor_maemo.ui
index 5f17e7d..a7940c6 100644
--- a/examples/network/bearermonitor/bearermonitor_maemo.ui
+++ b/examples/network/bearermonitor/bearermonitor_maemo.ui
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Form</string>
+   <string>BearerMonitor</string>
   </property>
   <layout class="QHBoxLayout" name="horizontalLayout_3">
    <item>
diff --git a/examples/network/bearermonitor/sessionwidget.ui b/examples/network/bearermonitor/sessionwidget.ui
index 56a2d0e..4199109 100644
--- a/examples/network/bearermonitor/sessionwidget.ui
+++ b/examples/network/bearermonitor/sessionwidget.ui
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Form</string>
+   <string>Session Details</string>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_2">
    <item>
diff --git a/examples/network/bearermonitor/sessionwidget_maemo.ui b/examples/network/bearermonitor/sessionwidget_maemo.ui
index 86f915c..ca68246 100644
--- a/examples/network/bearermonitor/sessionwidget_maemo.ui
+++ b/examples/network/bearermonitor/sessionwidget_maemo.ui
@@ -11,7 +11,7 @@
    </rect>
   </property>
   <property name="windowTitle">
-   <string>Form</string>
+   <string>Session Details</string>
   </property>
   <layout class="QHBoxLayout" name="horizontalLayout">
    <item>
-- 
cgit v0.12


From e8fb98b6fcbace6ed7be3e4112b6a7516129ade2 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Fri, 11 Jun 2010 13:17:25 +1000
Subject: Cherry pick fix for MOBILITY-1063 from Qt Mobility.

4713262c16cb3eba1f4beccb6962a1ae210479c0
---
 .../bearer/symbian/qnetworksession_impl.cpp        | 35 ++++++++++++++++++----
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index cce8095..1c581b6 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -53,10 +53,11 @@
 QT_BEGIN_NAMESPACE
 
 QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
-    : CActive(CActive::EPriorityUserInput), engine(engine),
-      ipConnectionNotifier(0), iHandleStateNotificationsFromManager(false),
-      iFirstSync(true), iStoppedByUser(false), iClosedByUser(false), iDeprecatedConnectionId(0),
-      iError(QNetworkSession::UnknownSessionError), iALREnabled(0), iConnectInBackground(false)
+:   CActive(CActive::EPriorityUserInput), engine(engine),
+    iDynamicUnSetdefaultif(0), ipConnectionNotifier(0),
+    iHandleStateNotificationsFromManager(false), iFirstSync(true), iStoppedByUser(false),
+    iClosedByUser(false), iDeprecatedConnectionId(0),
+    iError(QNetworkSession::UnknownSessionError), iALREnabled(0), iConnectInBackground(false)
 {
     CActiveScheduler::Add(this);
 
@@ -69,6 +70,13 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
     if (iOpenCLibrary.Load(_L("libc")) == KErrNone) {
         iDynamicUnSetdefaultif = (TOpenCUnSetdefaultifFunction)iOpenCLibrary.Lookup(597);
     }
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+    qDebug() << "QNS this : " << QString::number((uint)this) << " - ";
+    if (iDynamicUnSetdefaultif)
+        qDebug() << "dynamic setdefaultif() resolution succeeded. ";
+    else
+        qDebug() << "dynamic setdefaultif() resolution failed. ";
+#endif
 
     TRAP_IGNORE(iConnectionMonitor.ConnectL());
 }
@@ -517,10 +525,25 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
     // that does not seem to be trusted on all Symbian versions --> safest
     // to go down.
     if (publicConfig.type() == QNetworkConfiguration::UserChoice || state == QNetworkSession::Connecting) {
+        SymbianNetworkConfigurationPrivate *symbianConfig =
+            toSymbianConfig(privateConfiguration(publicConfig));
+
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
-    qDebug() << "QNS this : " << QString::number((uint)this) << " - "
-             << "going Disconnected because session was Connecting.";
+
+        symbianConfig->mutex.lock();
+        qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+                 << "going Disconnected right away. Deprecating connection monitor ID: "
+                 << symbianConfig->connectionId;
+        symbianConfig->mutex.unlock();
 #endif
+
+        // The connection has gone down, and processing of status updates must be
+        // stopped. Depending on platform, there may come 'connecting/connected' states
+        // considerably later (almost a second). Connection id is an increasing
+        // number, so this does not affect next _real_ 'conneting/connected' states.
+        symbianConfig->mutex.lock();
+        iDeprecatedConnectionId = symbianConfig->connectionId;
+        symbianConfig->mutex.unlock();
         newState(QNetworkSession::Closing);
         newState(QNetworkSession::Disconnected);
     }
-- 
cgit v0.12


From d24c09fe2354135d233ca3374f0b6a7488f0615c Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Fri, 11 Jun 2010 13:42:13 +1000
Subject: Cherry pick fix for MOBILITY-800 from Qt Mobility.

21abc07dc396f08c888bf3cac96b535cc296cb00
---
 .../bearer/symbian/qnetworksession_impl.cpp        | 91 +++++++++-------------
 src/plugins/bearer/symbian/qnetworksession_impl.h  |  1 -
 .../qnetworksession/test/tst_qnetworksession.cpp   | 39 ++++++----
 3 files changed, 61 insertions(+), 70 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 1c581b6..15123be 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -56,8 +56,8 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
 :   CActive(CActive::EPriorityUserInput), engine(engine),
     iDynamicUnSetdefaultif(0), ipConnectionNotifier(0),
     iHandleStateNotificationsFromManager(false), iFirstSync(true), iStoppedByUser(false),
-    iClosedByUser(false), iDeprecatedConnectionId(0),
-    iError(QNetworkSession::UnknownSessionError), iALREnabled(0), iConnectInBackground(false)
+    iClosedByUser(false), iError(QNetworkSession::UnknownSessionError), iALREnabled(0),
+    iConnectInBackground(false)
 {
     CActiveScheduler::Add(this);
 
@@ -73,9 +73,9 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
     qDebug() << "QNS this : " << QString::number((uint)this) << " - ";
     if (iDynamicUnSetdefaultif)
-        qDebug() << "dynamic setdefaultif() resolution succeeded. ";
+        qDebug() << "dynamic unsetdefaultif() is present in PIPS library. ";
     else
-        qDebug() << "dynamic setdefaultif() resolution failed. ";
+        qDebug() << "dynamic unsetdefaultif() not present in PIPS library. ";
 #endif
 
     TRAP_IGNORE(iConnectionMonitor.ConnectL());
@@ -108,6 +108,9 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
     
     iConnectionMonitor.Close();
     iOpenCLibrary.Close();
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+    qDebug() << "QNS this : " << QString::number((uint)this) << " - destroyed (and setdefaultif(0))";
+#endif
 }
 
 void QNetworkSessionPrivateImpl::configurationStateChanged(TUint32 accessPointId, TUint32 connMonId, QNetworkSession::State newState)
@@ -115,18 +118,12 @@ void QNetworkSessionPrivateImpl::configurationStateChanged(TUint32 accessPointId
     if (iHandleStateNotificationsFromManager) {
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
         qDebug() << "QNS this : " << QString::number((uint)this) << " - "
-                << "configurationStateChanged from manager for IAP : " << QString::number(accessPointId)
-                << "configurationStateChanged connMon ID : " << QString::number(connMonId)
-                << " : to a state: " << newState
-                << " whereas my current state is: " << state;
-#endif
-        if (connMonId == iDeprecatedConnectionId) {
-#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
-            qDebug() << "QNS this : " << QString::number((uint)this) << " - "
-                    << "however status update from manager ignored because it related to already closed connection.";
+                 << "configurationStateChanged from manager for IAP : " << QString::number(accessPointId)
+                 << "connMon ID : " << QString::number(connMonId) << " : to a state: " << newState
+                 << "whereas my current state is: " << state;
+#else
+      Q_UNUSED(connMonId);
 #endif
-            return;
-        }
         this->newState(newState, accessPointId);
     }
 }
@@ -250,6 +247,14 @@ QNetworkInterface QNetworkSessionPrivateImpl::interface(TUint iapId) const
 #ifndef QT_NO_NETWORKINTERFACE
 QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const
 {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+    qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+             << "currentInterface() requested, state: " << state
+             << "publicConfig validity: " << publicConfig.isValid();
+    if (activeInterface.isValid())
+        qDebug() << "interface is: " << activeInterface.humanReadableName();
+#endif
+
     if (!publicConfig.isValid() || state != QNetworkSession::Connected) {
         return QNetworkInterface();
     }
@@ -339,7 +344,6 @@ void QNetworkSessionPrivateImpl::open()
     // Clear possible previous states
     iStoppedByUser = false;
     iClosedByUser = false;
-    iDeprecatedConnectionId = 0;
 
     TInt error = iSocketServ.Connect();
     if (error != KErrNone) {
@@ -396,7 +400,11 @@ void QNetworkSessionPrivateImpl::open()
             if (!IsActive()) {
                 SetActive();
             }
-            newState(QNetworkSession::Connecting);
+            // Avoid flip flop of states if the configuration is already
+            // active. IsOpen/opened() will indicate when ready.
+            if (state != QNetworkSession::Connected) {
+                newState(QNetworkSession::Connecting);
+            }
     } else if (publicConfig.type() == QNetworkConfiguration::ServiceNetwork) {
         SymbianNetworkConfigurationPrivate *symbianConfig =
             toSymbianConfig(privateConfiguration(publicConfig));
@@ -420,7 +428,11 @@ void QNetworkSessionPrivateImpl::open()
         if (!IsActive()) {
             SetActive();
         }
-        newState(QNetworkSession::Connecting);
+        // Avoid flip flop of states if the configuration is already
+        // active. IsOpen/opened() will indicate when ready.
+        if (state != QNetworkSession::Connected) {
+            newState(QNetworkSession::Connecting);
+        }
     } else if (publicConfig.type() == QNetworkConfiguration::UserChoice) {
         iKnownConfigsBeforeConnectionStart = engine->accessPointConfigurationIdentifiers();
         iConnection.Start(iStatus);
@@ -485,11 +497,6 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
     iClosedByUser = true;
     isOpen = false;
 
-#ifndef OCC_FUNCTIONALITY_AVAILABLE
-    // On Symbian^3 we need to keep track of active configuration longer
-    // in case of empty-SNAP-triggered EasyWLAN.
-    activeConfig = QNetworkConfiguration();
-#endif
     serviceConfig = QNetworkConfiguration();
     
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE
@@ -525,25 +532,10 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
     // that does not seem to be trusted on all Symbian versions --> safest
     // to go down.
     if (publicConfig.type() == QNetworkConfiguration::UserChoice || state == QNetworkSession::Connecting) {
-        SymbianNetworkConfigurationPrivate *symbianConfig =
-            toSymbianConfig(privateConfiguration(publicConfig));
-
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
-
-        symbianConfig->mutex.lock();
         qDebug() << "QNS this : " << QString::number((uint)this) << " - "
-                 << "going Disconnected right away. Deprecating connection monitor ID: "
-                 << symbianConfig->connectionId;
-        symbianConfig->mutex.unlock();
+                 << "going disconnected right away, since either UserChoice or Connecting";
 #endif
-
-        // The connection has gone down, and processing of status updates must be
-        // stopped. Depending on platform, there may come 'connecting/connected' states
-        // considerably later (almost a second). Connection id is an increasing
-        // number, so this does not affect next _real_ 'conneting/connected' states.
-        symbianConfig->mutex.lock();
-        iDeprecatedConnectionId = symbianConfig->connectionId;
-        symbianConfig->mutex.unlock();
         newState(QNetworkSession::Closing);
         newState(QNetworkSession::Disconnected);
     }
@@ -1191,6 +1183,12 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
         return false;
     }
 
+    // Make sure that some lagging 'connecting' state-changes do not overwrite
+    // if we are already connected (may righfully still happen with roaming though).
+    if (state == QNetworkSession::Connected && newState == QNetworkSession::Connecting) {
+        return false;
+    }
+
     bool emitSessionClosed = false;
 
     // If we abruptly go down and user hasn't closed the session, we've been aborted.
@@ -1306,27 +1304,12 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
 #endif
         }
     }
-    
     if (emitSessionClosed) {
         emit closed();
     }
     if (state == QNetworkSession::Disconnected) {
-        // The connection has gone down, and processing of status updates must be
-        // stopped. Depending on platform, there may come 'connecting/connected' states
-        // considerably later (almost a second). Connection id is an increasing
-        // number, so this does not affect next _real_ 'conneting/connected' states.
-
-        SymbianNetworkConfigurationPrivate *symbianConfig =
-            toSymbianConfig(privateConfiguration(publicConfig));
-
-        symbianConfig->mutex.lock();
-        iDeprecatedConnectionId = symbianConfig->connectionId;
-        symbianConfig->mutex.unlock();
-
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
         // Just in case clear activeConfiguration.
         activeConfig = QNetworkConfiguration();
-#endif
     }
     return retVal;
 }
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index 4b4f28c..284e771 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -167,7 +167,6 @@ private: // data
     bool iFirstSync;
     bool iStoppedByUser;
     bool iClosedByUser;
-    TUint32 iDeprecatedConnectionId;
     
 #ifdef SNAP_FUNCTIONALITY_AVAILABLE    
     CActiveCommsMobilityApiExt* iMobility;
diff --git a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
index e4b8c14..24f6e52 100644
--- a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp
@@ -680,7 +680,7 @@ void tst_QNetworkSession::sessionStop()
         QVERIFY(openSession(&innocentSession));    
         qDebug("Waiting for %d ms after open to make sure all platform indications are propagated", configWaitdelayInMs);
         QTest::qWait(configWaitdelayInMs);
-    qDebug("----------4.2 Calling closedSession.stop()");
+        qDebug("----------4.2 Calling closedSession.stop()");
         closedSession.stop();
         qDebug("Waiting for %d ms to get all configurationChange signals from platform..", configWaitdelayInMs);
         QTest::qWait(configWaitdelayInMs); // Wait to get all relevant configurationChange() signals
@@ -1088,21 +1088,28 @@ void tst_QNetworkSession::sessionOpenCloseStop()
                 if (configuration.type() == QNetworkConfiguration::ServiceNetwork) {
                     bool roamedSuccessfully = false;
 
-                    QCOMPARE(stateChangedSpy2.count(), 4);
+                    QNetworkSession::State state;
+                    if (stateChangedSpy2.count() == 4) {
+                        state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
+                        QVERIFY(state == QNetworkSession::Connecting);
 
-                    QNetworkSession::State state =
-                        qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
-                    QVERIFY(state == QNetworkSession::Connecting);
+                        state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
+                        QVERIFY(state == QNetworkSession::Connected);
 
-                    state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
-                    QVERIFY(state == QNetworkSession::Connected);
+                        state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(2).at(0));
+                        QVERIFY(state == QNetworkSession::Closing);
 
-                    state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(2).at(0));
-                    QVERIFY(state == QNetworkSession::Closing);
+                        state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(3).at(0));
+                        QVERIFY(state == QNetworkSession::Disconnected);
+                    } else if (stateChangedSpy2.count() == 2) {
+                        state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
+                        QVERIFY(state == QNetworkSession::Closing);
 
-                    state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(3).at(0));
-                    QVERIFY(state == QNetworkSession::Disconnected);
-                    
+                        state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
+                        QVERIFY(state == QNetworkSession::Disconnected);
+                    } else {
+                        QFAIL("Unexpected amount of state changes when roaming.");
+                    }
 			
                     QTRY_VERIFY(session.state() == QNetworkSession::Roaming ||
                                 session.state() == QNetworkSession::Connected ||
@@ -1137,16 +1144,18 @@ void tst_QNetworkSession::sessionOpenCloseStop()
                             QVERIFY(state == QNetworkSession::Roaming);
                         }
                         roamedSuccessfully = true;
-                  	}
+                    }
 
                     if (roamedSuccessfully) {
+                        // Verify that you can open session based on the disconnected configuration
                         QString configId = session.sessionProperty("ActiveConfiguration").toString();
-                        QNetworkConfiguration config = manager.configurationFromIdentifier(configId); 
+                        QNetworkConfiguration config = manager.configurationFromIdentifier(configId);
                         QNetworkSession session3(config);
                         QSignalSpy errorSpy3(&session3, SIGNAL(error(QNetworkSession::SessionError)));
                         QSignalSpy sessionOpenedSpy3(&session3, SIGNAL(opened()));
                         session3.open();
-                        session3.waitForOpened();      
+                        session3.waitForOpened();
+                        QTest::qWait(1000); // Wait awhile to get all signals from platform
                         if (session.isOpen())
                             QVERIFY(!sessionOpenedSpy3.isEmpty() || !errorSpy3.isEmpty());
                         session.stop();
-- 
cgit v0.12


From c5fa9ed38561a05325c798918e87549dd880af63 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Mon, 21 Jun 2010 15:55:18 +1000
Subject: Abort open early if network session is in the process of openning.

---
 .../bearer/symbian/qnetworksession_impl.cpp        | 23 +++++++++++++++++-----
 src/plugins/bearer/symbian/qnetworksession_impl.h  |  2 ++
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 15123be..b6e11df 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -57,7 +57,7 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
     iDynamicUnSetdefaultif(0), ipConnectionNotifier(0),
     iHandleStateNotificationsFromManager(false), iFirstSync(true), iStoppedByUser(false),
     iClosedByUser(false), iError(QNetworkSession::UnknownSessionError), iALREnabled(0),
-    iConnectInBackground(false)
+    iConnectInBackground(false), isOpening(false)
 {
     CActiveScheduler::Add(this);
 
@@ -84,6 +84,7 @@ QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
 QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
 {
     isOpen = false;
+    isOpening = false;
 
     // Cancel Connection Progress Notifications first.
     // Note: ConnectionNotifier must be destroyed before Canceling RConnection::Start()
@@ -311,12 +312,14 @@ void QNetworkSessionPrivateImpl::open()
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
         qDebug() << "QNS this : " << QString::number((uint)this) << " - "
                 << "open() called, session state is: " << state << " and isOpen is: "
-                << isOpen;
+                << isOpen << isOpening;
 #endif
-    if (isOpen || (state == QNetworkSession::Connecting)) {
+
+    if (isOpen || isOpening)
         return;
-    }
-    
+
+    isOpening = true;
+
     // Stop handling IAP state change signals from QNetworkConfigurationManagerPrivate
     // => RConnection::ProgressNotification will be used for IAP/SNAP monitoring
     iHandleStateNotificationsFromManager = false;
@@ -444,6 +447,7 @@ void QNetworkSessionPrivateImpl::open()
  
     if (error != KErrNone) {
         isOpen = false;
+        isOpening = false;
         iError = QNetworkSession::UnknownSessionError;
         emit QNetworkSessionPrivate::error(iError);
         if (ipConnectionNotifier) {
@@ -496,6 +500,7 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
     // when reporting.
     iClosedByUser = true;
     isOpen = false;
+    isOpening = false;
 
     serviceConfig = QNetworkConfiguration();
     
@@ -599,6 +604,7 @@ void QNetworkSessionPrivateImpl::stop()
 #endif
         // Since we are open, use RConnection to stop the interface
         isOpen = false;
+        isOpening = false;
         iStoppedByUser = true;
         newState(QNetworkSession::Closing);
         if (ipConnectionNotifier) {
@@ -608,6 +614,7 @@ void QNetworkSessionPrivateImpl::stop()
         }
         iConnection.Stop(RConnection::EStopAuthoritative);
         isOpen = true;
+        isOpening = false;
         close(false);
         emit closed();
     }
@@ -742,6 +749,7 @@ void QNetworkSessionPrivateImpl::Error(TInt /*aError*/)
 #endif
     if (isOpen) {
         isOpen = false;
+        isOpening = false;
         activeConfig = QNetworkConfiguration();
         serviceConfig = QNetworkConfiguration();
         iError = QNetworkSession::RoamingError;
@@ -1048,6 +1056,7 @@ void QNetworkSessionPrivateImpl::RunL()
             
             if (error != KErrNone) {
                 isOpen = false;
+                isOpening = false;
                 iError = QNetworkSession::UnknownSessionError;
                 QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
                 Cancel();
@@ -1066,6 +1075,7 @@ void QNetworkSessionPrivateImpl::RunL()
 #endif
 
             isOpen = true;
+            isOpening = false;
             activeConfig = newActiveConfig;
 
             SymbianNetworkConfigurationPrivate *symbianConfig =
@@ -1089,6 +1099,7 @@ void QNetworkSessionPrivateImpl::RunL()
             break;
         case KErrNotFound: // Connection failed
             isOpen = false;
+            isOpening = false;
             activeConfig = QNetworkConfiguration();
             serviceConfig = QNetworkConfiguration();
             iError = QNetworkSession::InvalidConfigurationError;
@@ -1103,6 +1114,7 @@ void QNetworkSessionPrivateImpl::RunL()
         case KErrAlreadyExists: // Connection already exists
         default:
             isOpen = false;
+            isOpening = false;
             activeConfig = QNetworkConfiguration();
             serviceConfig = QNetworkConfiguration();
             if (publicConfig.state() == QNetworkConfiguration::Undefined ||
@@ -1202,6 +1214,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
         // application or session stops connection or when network drops
         // unexpectedly).
         isOpen = false;
+        isOpening = false;
         activeConfig = QNetworkConfiguration();
         serviceConfig = QNetworkConfiguration();
         iError = QNetworkSession::SessionAbortedError;
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index 284e771..0754ace 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -182,6 +182,8 @@ private: // data
     TUint32 iOldRoamingIap;
     TUint32 iNewRoamingIap;
 
+    bool isOpening;
+
     friend class ConnectionProgressNotifier;
 };
 
-- 
cgit v0.12


From d63e7d8ec0c9337999a3d90b594eb3e955145de9 Mon Sep 17 00:00:00 2001
From: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Date: Thu, 24 Jun 2010 10:34:56 +0200
Subject: QKeyEvent::text() inconsistency between Linux and Mac

For a key event triggered by the cursor keys, QKeyEvent::text() returns
char with value 0x14 or similar. This patch (Cocoa only)will remove
text from all key events for the unicode range 0xF700-0xF747. This is
part of the corporate unicode range used by apple for keyboard function keys.
[http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CORPCHAR.TXT]

Task-number: QTBUG-11225
Reviewed-by: Bradley T. Hughes
---
 src/gui/kernel/qkeymapper_mac.cpp      | 15 ++++++++++++++-
 src/gui/kernel/qt_cocoa_helpers_mac.mm |  7 ++++---
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp
index 873b8f9..3dc6afc 100644
--- a/src/gui/kernel/qkeymapper_mac.cpp
+++ b/src/gui/kernel/qkeymapper_mac.cpp
@@ -866,14 +866,27 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
         UInt32 macModifiers = 0;
         GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, 0,
                           sizeof(macModifiers), 0, &macModifiers);
+#ifdef QT_MAC_USE_COCOA
+        // The unicode characters in the range 0xF700-0xF747 are reserved
+        // by Mac OS X for transient use as keyboard function keys. We
+        // wont send 'text' for such key events. This is done to match
+        // behavior on other platforms.
+        unsigned int *unicodeKey = (unsigned int*)info;
+        if (*unicodeKey >= 0xf700 && *unicodeKey <= 0xf747)
+            text = QString();
+        bool isAccepted;
+#endif
         handled_event = QKeyMapper::sendKeyEvent(widget, grab,
                                                  (ekind == kEventRawKeyUp) ? QEvent::KeyRelease : QEvent::KeyPress,
                                                  qtKey, modifiers, text, ekind == kEventRawKeyRepeat, 0,
                                                  macScanCode, macVirtualKey, macModifiers
 #ifdef QT_MAC_USE_COCOA
-                                                 ,static_cast<bool *>(info)
+                                                 ,&isAccepted
 #endif
                                                  );
+#ifdef QT_MAC_USE_COCOA
+        *unicodeKey = (unsigned int)isAccepted;
+#endif
     }
     return handled_event;
 }
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 8cef03c..3fc27f4 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -682,10 +682,12 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve
     NSEvent *event = static_cast<NSEvent *>(keyEvent);
     EventRef key_event = static_cast<EventRef>(const_cast<void *>([event eventRef]));
     Q_ASSERT(key_event);
+    unsigned int info = 0;
     if ([event type] == NSKeyDown) {
         NSString *characters = [event characters];
         unichar value = [characters characterAtIndex:0];
         qt_keymapper_private()->updateKeyMap(0, key_event, (void *)&value);
+        info = value;
     }
 
     // Redirect keys to alien widgets.
@@ -701,9 +703,8 @@ bool qt_dispatchKeyEvent(void * /*NSEvent * */ keyEvent, QWidget *widgetToGetEve
 
     if (mustUseCocoaKeyEvent())
         return qt_dispatchKeyEventWithCocoa(keyEvent, widgetToGetEvent);
-    bool isAccepted;
-    bool consumed = qt_keymapper_private()->translateKeyEvent(widgetToGetEvent, 0, key_event, &isAccepted, true);
-    return consumed && isAccepted;
+    bool consumed = qt_keymapper_private()->translateKeyEvent(widgetToGetEvent, 0, key_event, &info, true);
+    return consumed && (info != 0);
 #endif
 }
 
-- 
cgit v0.12


From b60be84ad8121f9562f1ab4193136426df6dc6d4 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 24 Jun 2010 10:18:18 +0200
Subject: Fixed memory restrictions not being passed on to elf2e32.

Task:     QTBUG-11351
RevBy:    Trust me
---
 mkspecs/common/symbian/symbian-makefile.conf  | 2 --
 mkspecs/features/symbian/symbian_building.prf | 7 +++++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/mkspecs/common/symbian/symbian-makefile.conf b/mkspecs/common/symbian/symbian-makefile.conf
index ab0c5b9..b1ca367 100644
--- a/mkspecs/common/symbian/symbian-makefile.conf
+++ b/mkspecs/common/symbian/symbian-makefile.conf
@@ -14,8 +14,6 @@ QMAKE_RUN_CXX		= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
 QMAKE_RUN_CXX_IMP	= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
 
 QMAKE_ELF2E32_FLAGS	= --dlldata \
-                          --heap=0x00020000,0x00800000 \
-                          --stack=0x00014000 \
                           --fpu=softvfp \
                           --unfrozen \
                           --compressionmethod bytepair \
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 9fc4d1e..5861bb6 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -8,6 +8,9 @@
     QMAKE_LFLAGS += -Ttext 0x80000 -Tdata 0x400000
 }
 
+isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
+isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+
 symbianObjdir=$$OBJECTS_DIR
 isEmpty(symbianObjdir) {
     symbianObjdir = .
@@ -114,6 +117,8 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
                       --dso=$$symbianObjdir/$${TARGET}.dso \
                       --defoutput=$$symbianObjdir/$${TARGET}.def \
                       --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+                      --heap=$$join(TARGET.EPOCHEAPSIZE, ",") \
+                      --stack=$$TARGET.EPOCSTACKSIZE \
                       $$elf2e32_LIBPATH \
                       $$capability \
                       $$QMAKE_ELF2E32_FLAGS \
@@ -163,6 +168,8 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
                       --elfinput=$${symbianDestdir}/$${TARGET}.sym \
                       --output=$${symbianDestdir}/$${TARGET}.exe \
                       --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+                      --heap=$$join(TARGET.EPOCHEAPSIZE, ",") \
+                      --stack=$$TARGET.EPOCSTACKSIZE \
                       $$elf2e32_LIBPATH \
                       $$capability \
                       $$QMAKE_ELF2E32_FLAGS \
-- 
cgit v0.12


From 9f7a9b1272357a06cd721d64e66fcde1921bd325 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Thu, 24 Jun 2010 10:56:08 +0200
Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to
 a80fd59e3b3b18116803a14e6369345933994236

* Disable data structure packing with RVCT, as it appears that the
compiler miscompiles the code.
---
 src/3rdparty/harfbuzz/src/harfbuzz-global.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index 5b2b679..bccd6a2 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -39,7 +39,7 @@
 #define HB_END_HEADER  /* nothing */
 #endif
 
-#if defined(__GNUC__) || defined(__ARMCC__) || defined(__CC_ARM) || defined(_MSC_VER)
+#if defined(__GNUC__) || defined(_MSC_VER)
 #define HB_USE_PACKED_STRUCTS
 #endif
 
-- 
cgit v0.12


From d8ffdacc0aa0b22a02b8ac3bae03570049b65d5d Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Thu, 24 Jun 2010 10:56:08 +0200
Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to
 a80fd59e3b3b18116803a14e6369345933994236

* Disable data structure packing with RVCT, as it appears that the
compiler miscompiles the code.
---
 src/3rdparty/harfbuzz/src/harfbuzz-global.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index 5b2b679..bccd6a2 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -39,7 +39,7 @@
 #define HB_END_HEADER  /* nothing */
 #endif
 
-#if defined(__GNUC__) || defined(__ARMCC__) || defined(__CC_ARM) || defined(_MSC_VER)
+#if defined(__GNUC__) || defined(_MSC_VER)
 #define HB_USE_PACKED_STRUCTS
 #endif
 
-- 
cgit v0.12


From 06aaa4bc68a1ee10d2a7bb8de4928c92ce84546d Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 24 Jun 2010 11:58:42 +0200
Subject: Revert "Fixing race condition in qeventdispatcher_symbian.cpp code
 path"

This reverts commit 3a9ca8ba50a63e564c15023f65cbac36d365d309.

It's the wrong fix for the problem. The socket operations in the
select thread are not supposed to be thread safe. It is thread safe
between the select thread and the caller thread, but not if there are
more than one caller thread. Ensuring complete thread safety would
probably require fixes in other areas as well.

The correct fix is for the client to ensure that calls to the socket
registering functions are either serialized or contained within one
thread.

Task:     QT-3496
RevBy:    Aleksandar Sasha Babic
---
 src/corelib/kernel/qeventdispatcher_symbian.cpp | 101 ++++++++++--------------
 src/corelib/kernel/qeventdispatcher_symbian_p.h |   5 --
 2 files changed, 40 insertions(+), 66 deletions(-)

diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index 75b7619..d00a623 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -114,13 +114,9 @@ public:
         // is in select call
         if (m_selectCallMutex->tryLock()) {
             m_selectCallMutex->unlock();
-
-            //m_threadMutex->lock();
-            //bHasThreadLock = true;
             return;
         }
 
-
         char dummy = 0;
         qt_pipe_write(fd, &dummy, 1);
 
@@ -409,14 +405,11 @@ void QSelectThread::run()
         FD_ZERO(&exceptionfds);
 
         int maxfd = 0;
-        {
-            QMutexLocker asoLocker(&m_AOStatusesMutex);
-            maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Read, &readfds));
-            maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Write, &writefds));
-            maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Exception, &exceptionfds));
-            maxfd = qMax(maxfd, m_pipeEnds[0]);
-            maxfd++;
-        }
+        maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Read, &readfds));
+        maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Write, &writefds));
+        maxfd = qMax(maxfd, updateSocketSet(QSocketNotifier::Exception, &exceptionfds));
+        maxfd = qMax(maxfd, m_pipeEnds[0]);
+        maxfd++;
 
         FD_SET(m_pipeEnds[0], &readfds);
 
@@ -461,42 +454,40 @@ void QSelectThread::run()
                 FD_ZERO(&readfds);
                 FD_ZERO(&writefds);
                 FD_ZERO(&exceptionfds);
-                {
-                    QMutexLocker asoLocker(&m_AOStatusesMutex);
-                    for (QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
-                            i != m_AOStatuses.end(); ++i) {
+                for (QHash<QSocketNotifier *, TRequestStatus *>::const_iterator i = m_AOStatuses.begin();
+                        i != m_AOStatuses.end(); ++i) {
 
-                       fd_set onefds;
-                       FD_ZERO(&onefds);
-                       FD_SET(i.key()->socket(), &onefds);
+                    fd_set onefds;
+                    FD_ZERO(&onefds);
+                    FD_SET(i.key()->socket(), &onefds);
 
-                       fd_set excfds;
-                       FD_ZERO(&excfds);
-                       FD_SET(i.key()->socket(), &excfds);
+                    fd_set excfds;
+                    FD_ZERO(&excfds);
+                    FD_SET(i.key()->socket(), &excfds);
 
-                        maxfd = i.key()->socket() + 1;
+                    maxfd = i.key()->socket() + 1;
 
-                        struct timeval timeout;
-                        timeout.tv_sec = 0;
-                        timeout.tv_usec = 0;
+                    struct timeval timeout;
+                    timeout.tv_sec = 0;
+                    timeout.tv_usec = 0;
 
-                        ret = 0;
+                    ret = 0;
 
-                        if(i.key()->type() == QSocketNotifier::Read) {
-                            ret = ::select(maxfd, &onefds, 0, &excfds, &timeout);
-                            if(ret != 0) FD_SET(i.key()->socket(), &readfds);
-                        } else if(i.key()->type() == QSocketNotifier::Write) {
-                            ret = ::select(maxfd, 0, &onefds, &excfds, &timeout);
-                            if(ret != 0) FD_SET(i.key()->socket(), &writefds);
-                        }
+                    if(i.key()->type() == QSocketNotifier::Read) {
+                        ret = ::select(maxfd, &onefds, 0, &excfds, &timeout);
+                        if(ret != 0) FD_SET(i.key()->socket(), &readfds);
+                    } else if(i.key()->type() == QSocketNotifier::Write) {
+                        ret = ::select(maxfd, 0, &onefds, &excfds, &timeout);
+                        if(ret != 0) FD_SET(i.key()->socket(), &writefds);
+                    }
 
-                    } // end for
+                } // end for
+
+                // traversed all, so update
+                updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
+                updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
+                updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
 
-                    // traversed all, so update
-                    updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
-                    updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
-                    updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
-                }
                 break;
             case EINTR: // Should never occur on Symbian, but this is future proof!
             default:
@@ -505,12 +496,9 @@ void QSelectThread::run()
                 break;
             }
         } else {
-            {
-                QMutexLocker asoLocker(&m_AOStatusesMutex);
-                updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
-                updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
-                updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
-            }
+            updateActivatedNotifiers(QSocketNotifier::Exception, &exceptionfds);
+            updateActivatedNotifiers(QSocketNotifier::Read, &readfds);
+            updateActivatedNotifiers(QSocketNotifier::Write, &writefds);
         }
 
         m_waitCond.wait(&m_mutex);
@@ -529,16 +517,12 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
 
     QMutexLocker locker(&m_grabberMutex);
 
-    {
-        // first do the thing
-        QMutexLocker aosLocker(&m_AOStatusesMutex); 
-        Q_ASSERT(!m_AOStatuses.contains(notifier));
-        m_AOStatuses.insert(notifier, status);
-    }
-
-    // and now tell it to the others
     QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
 
+    Q_ASSERT(!m_AOStatuses.contains(notifier));
+
+    m_AOStatuses.insert(notifier, status);
+
     m_waitCond.wakeAll();
 }
 
@@ -546,15 +530,10 @@ void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
 {
     QMutexLocker locker(&m_grabberMutex);
 
-    {
-        // first do the thing
-        QMutexLocker aosLocker(&m_AOStatusesMutex);
-        m_AOStatuses.remove(notifier);
-    }
-
-    // and now tell it to the others
     QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
 
+    m_AOStatuses.remove(notifier);
+
     m_waitCond.wakeAll();
 }
 
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 68d5833..7021314 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -231,11 +231,6 @@ private:
     // causes later in locking
     // of the thread in waitcond
     QMutex m_selectCallMutex;
-
-    // Argh ... not again
-    // one more unprotected
-    // resource is m_AOStatuses
-    QMutex m_AOStatusesMutex;
 };
 
 class Q_CORE_EXPORT CQtActiveScheduler : public CActiveScheduler
-- 
cgit v0.12


From 7ae5285132db6c435e91ab097f41097217d68a2c Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 24 Jun 2010 10:57:23 +0200
Subject: Revert "Fixing the race condition in event dispatcher implementation
 on"

This reverts commit 5f21450a61ba2459e6dc5b08b236b15a067bf81f.

It's the wrong fix for the problem. The socket operations in the
select thread are not supposed to be thread safe. It is thread safe
between the select thread and the caller thread, but not if there are
more than one caller thread. Ensuring complete thread safety would
probably require fixes in other areas as well.

The correct fix is for the client to ensure that calls to the socket
registering functions are either serialized or contained within one
thread.

Task:     QT-3358
RevBy:    Aleksandar Sasha Babic
---
 src/corelib/kernel/qeventdispatcher_symbian.cpp | 46 ++++++-------------------
 src/corelib/kernel/qeventdispatcher_symbian_p.h | 20 -----------
 2 files changed, 10 insertions(+), 56 deletions(-)

diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index d00a623..826caf2 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -100,40 +100,25 @@ static inline int qt_socket_select(int nfds, fd_set *readfds, fd_set *writefds,
 class QSelectMutexGrabber
 {
 public:
-    QSelectMutexGrabber(int fd, QMutex *threadMutex, QMutex *selectCallMutex)
-        : m_threadMutex(threadMutex), m_selectCallMutex(selectCallMutex), bHasThreadLock(false)
+    QSelectMutexGrabber(int fd, QMutex *mutex)
+        : m_mutex(mutex)
     {
-        // see if selectThread is waiting m_waitCond
-        // if yes ... dont write to pipe
-        if (m_threadMutex->tryLock()) {
-            bHasThreadLock = true;
+        if (m_mutex->tryLock())
             return;
-        }
-
-        // still check that SelectThread
-        // is in select call
-        if (m_selectCallMutex->tryLock()) {
-            m_selectCallMutex->unlock();
-            return;
-        }
 
         char dummy = 0;
         qt_pipe_write(fd, &dummy, 1);
 
-        m_threadMutex->lock();
-        bHasThreadLock = true;
+        m_mutex->lock();
     }
 
     ~QSelectMutexGrabber()
     {
-        if(bHasThreadLock)
-            m_threadMutex->unlock();
+        m_mutex->unlock();
     }
 
 private:
-    QMutex *m_threadMutex;
-    QMutex *m_selectCallMutex;
-    bool bHasThreadLock;
+    QMutex *m_mutex;
 };
 
 /*
@@ -415,12 +400,7 @@ void QSelectThread::run()
 
         int ret;
         int savedSelectErrno;
-        {
-            // helps fighting the race condition between
-            // selctthread and new socket requests (cancel, restart ...)
-            QMutexLocker locker(&m_selectCallMutex);
-            ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
-        }
+        ret = qt_socket_select(maxfd, &readfds, &writefds, &exceptionfds, 0);
         savedSelectErrno = errno;
 
         char buffer;
@@ -515,9 +495,7 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
         start();
     }
 
-    QMutexLocker locker(&m_grabberMutex);
-
-    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
 
     Q_ASSERT(!m_AOStatuses.contains(notifier));
 
@@ -528,9 +506,7 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta
 
 void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
 {
-    QMutexLocker locker(&m_grabberMutex);
-
-    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
 
     m_AOStatuses.remove(notifier);
 
@@ -539,9 +515,7 @@ void QSelectThread::cancelSocketEvents ( QSocketNotifier *notifier )
 
 void QSelectThread::restart()
 {
-    QMutexLocker locker(&m_grabberMutex);
-
-    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex, &m_selectCallMutex);
+    QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex);
 
     m_waitCond.wakeAll();
 }
diff --git a/src/corelib/kernel/qeventdispatcher_symbian_p.h b/src/corelib/kernel/qeventdispatcher_symbian_p.h
index 7021314..8a9c9a0 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian_p.h
+++ b/src/corelib/kernel/qeventdispatcher_symbian_p.h
@@ -211,26 +211,6 @@ private:
     QMutex m_mutex;
     QWaitCondition m_waitCond;
     bool m_quit;
-
-    // to protect when several
-    // requests like:
-    // requestSocketEvents
-    // cancelSocketEvents
-    // kick in the same time
-    // all will fight for m_mutex
-    //
-    // TODO: fix more elegantely
-    //
-    QMutex m_grabberMutex;
-
-    // this one will tell
-    // if selectthread is
-    // really in select call
-    // and will prevent
-    // writing to pipe that
-    // causes later in locking
-    // of the thread in waitcond
-    QMutex m_selectCallMutex;
 };
 
 class Q_CORE_EXPORT CQtActiveScheduler : public CActiveScheduler
-- 
cgit v0.12


From 598ba59b9d2e4b28469088d4ef12407b0c27514a Mon Sep 17 00:00:00 2001
From: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Date: Thu, 24 Jun 2010 12:32:42 +0200
Subject: Child windows shown automatically when their parent is shown(Cocoa).

While setting up the stacking order for child windows, their hidden state
was never taken into consideration.

Task-number: QTBUG-11239
Reviewed-by: Richard Moe Gustavsen
---
 src/gui/kernel/qwidget_mac.mm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 280712a..a9bb691 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2804,7 +2804,7 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
     QList<QWidget *> widgets = q->findChildren<QWidget *>();
     for (int i=0; i<widgets.size(); ++i) {
         QWidget *child = widgets.at(i);
-        if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created)) {
+        if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created) && child->isVisibleTo(q)) {
             if (set)
                 [qt_mac_window_for(q) addChildWindow:qt_mac_window_for(child) ordered:NSWindowAbove];
             else
-- 
cgit v0.12


From 4df92b8b5e7f44d7a5e2b91f23638c92512b41f9 Mon Sep 17 00:00:00 2001
From: Alessandro Portale <alessandro.portale@nokia.com>
Date: Thu, 24 Jun 2010 12:45:27 +0200
Subject: Don't crash when cleaning the uninitialized fontdatabase (Symbian)

Applications that do not render fonts will not cause a call to
initializeDb(). In that case, there will be no creation of
QSymbianFontDatabaseExtras.

This fix adds a NULL-pointer check before cleaning the
QSymbianFontDatabaseExtras instance.

Task-number: QTBUG-11683
Reviewed-by: Miikka Heikkinen
---
 src/gui/text/qfontdatabase_s60.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 5148568..0b38aab 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -162,6 +162,8 @@ void qt_cleanup_symbianFontDatabaseExtras()
 {
     const QSymbianFontDatabaseExtrasImplementation *dbExtras =
             static_cast<const QSymbianFontDatabaseExtrasImplementation*>(privateDb()->symbianExtras);
+    if (!dbExtras)
+        return; // initializeDb() has never been called
 #ifdef Q_SYMBIAN_HAS_FONTTABLE_API
     qDeleteAll(dbExtras->m_extrasHash);
 #else // Q_SYMBIAN_HAS_FONTTABLE_API
-- 
cgit v0.12


From 3119f5e2d675ba5d39e94cdae26db9eb8f373eab Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Thu, 24 Jun 2010 13:55:31 +0200
Subject: Moved the QML WebKit integration into QtWebKit.sis

Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
Reviewed-by: Janne Koskinen <janne.p.koskinen@digia.com>
---
 src/3rdparty/webkit/WebCore/WebCore.pro                   | 7 +++++++
 src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro | 7 -------
 src/s60installs/s60installs.pro                           | 7 -------
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index f0e41bc..e208b5f 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -25,6 +25,13 @@ symbian: {
     webkitbackup.sources = ../WebKit/qt/symbian/backup_registration.xml
     webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
 
+    contains(QT_CONFIG, declarative): {
+         declarativeImport.sources = qmlwebkitplugin$${QT_LIBINFIX}.dll
+         declarativeImport.sources += ../WebKit/qt/declarative/qmldir
+         declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
+         DEPLOYMENT += declarativeImport
+    }
+
     DEPLOYMENT += webkitlibs webkitbackup
 
     # Need to guarantee that these come before system includes of /epoc32/include
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro b/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
index c75bbce..75268f3 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/declarative.pro
@@ -67,13 +67,6 @@ qmldir.path +=  $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
 
 symbian:{
     TARGET.UID3 = 0x20021321
-    load(data_caging_paths)
-    include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
-
-    importFiles.sources = qmlwebkitplugin.dll qmldir
-    importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
-
-    DEPLOYMENT = importFiles
 }
 
 INSTALLS += target qmldir
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index a093e4c..4addb84 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -175,13 +175,6 @@ symbian: {
         particlesImport.path = c:$$QT_IMPORTS_BASE_DIR/Qt/labs/particles
 
         DEPLOYMENT += folderlistmodelImport gesturesImport particlesImport
-
-        contains(QT_CONFIG, webkit): {
-            webkitImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
-            webkitImport.sources += $$QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/declarative/qmldir
-            webkitImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
-            DEPLOYMENT += webkitImport
-        }
     }
 
     graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems
-- 
cgit v0.12


From 9dc6dc38bf9035ec6460fa20159c33d5ad7084ca Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Thu, 24 Jun 2010 14:05:08 +0200
Subject: Updated WebKit to 2f598e9b7b376d851fe089bc1dc729bcf0393a06

* Fixed QML packaging

|| <https://webkit.org/b/39304> || Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set. ||
|| <https://webkit.org/b/39309> || Allocate the m_preloads list hash set dynamically and free it when done. ||
|| <https://webkit.org/b/33150> || Do not render the full frame when there is some elements with fixed positioning ||
---
 src/3rdparty/webkit/.tag                           |   2 +-
 src/3rdparty/webkit/JavaScriptCore/ChangeLog       |  34 ++++
 .../webkit/JavaScriptCore/wtf/ListHashSet.h        | 206 ++++++++++-----------
 src/3rdparty/webkit/VERSION                        |   2 +-
 src/3rdparty/webkit/WebCore/ChangeLog              |  78 ++++++++
 src/3rdparty/webkit/WebCore/WebCore.pro            |   2 +-
 src/3rdparty/webkit/WebCore/loader/DocLoader.cpp   |  15 +-
 src/3rdparty/webkit/WebCore/loader/DocLoader.h     |   5 +-
 src/3rdparty/webkit/WebCore/page/FrameView.cpp     |  12 +-
 .../webkit/WebCore/rendering/RenderBlock.cpp       |   8 +-
 .../webkit/WebCore/rendering/RenderBlock.h         |   9 +-
 .../webkit/WebCore/rendering/RenderLayer.cpp       |   8 +
 .../webkit/WebCore/rendering/RenderLayer.h         |   1 +
 src/3rdparty/webkit/WebKit/qt/ChangeLog            |  16 ++
 .../webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc     |   4 +-
 15 files changed, 274 insertions(+), 128 deletions(-)

diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 21b75f0..24cf142 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-b3589e88fb8d581fb523578763831109f914dc2e
+2f598e9b7b376d851fe089bc1dc729bcf0393a06
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index 676ed23..8fa3a72 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -1,3 +1,37 @@
+2010-05-18  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set.
+        https://bugs.webkit.org/show_bug.cgi?id=39304
+        <rdar://problem/7998366>
+
+        Add an inlineCapacity template parameter to ListHashSet.
+
+        * wtf/ListHashSet.h:
+        (WTF::::ListHashSet):
+        (WTF::::operator):
+        (WTF::::swap):
+        (WTF::::~ListHashSet):
+        (WTF::::size):
+        (WTF::::capacity):
+        (WTF::::isEmpty):
+        (WTF::::begin):
+        (WTF::::end):
+        (WTF::::find):
+        (WTF::::contains):
+        (WTF::::add):
+        (WTF::::insertBefore):
+        (WTF::::remove):
+        (WTF::::clear):
+        (WTF::::unlinkAndDelete):
+        (WTF::::appendNode):
+        (WTF::::insertNodeBefore):
+        (WTF::::deleteAllNodes):
+        (WTF::::makeIterator):
+        (WTF::::makeConstIterator):
+        (WTF::deleteAllValues):
+
 2010-06-18  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h b/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
index 54ed36b..09355ad 100644
--- a/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
+++ b/src/3rdparty/webkit/JavaScriptCore/wtf/ListHashSet.h
@@ -37,27 +37,27 @@ namespace WTF {
     // and an append that moves the element to the end even if already present,
     // but unclear yet if these are needed.
 
-    template<typename Value, typename HashFunctions> class ListHashSet;
+    template<typename Value, size_t inlineCapacity, typename HashFunctions> class ListHashSet;
 
     template<typename T> struct IdentityExtractor;
 
-    template<typename Value, typename HashFunctions>
-    void deleteAllValues(const ListHashSet<Value, HashFunctions>&);
+    template<typename Value, size_t inlineCapacity, typename HashFunctions>
+    void deleteAllValues(const ListHashSet<Value, inlineCapacity, HashFunctions>&);
 
-    template<typename ValueArg, typename HashArg> class ListHashSetIterator;
-    template<typename ValueArg, typename HashArg> class ListHashSetConstIterator;
+    template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetIterator;
+    template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetConstIterator;
 
-    template<typename ValueArg> struct ListHashSetNode;
-    template<typename ValueArg> struct ListHashSetNodeAllocator;
-    template<typename ValueArg, typename HashArg> struct ListHashSetNodeHashFunctions;
+    template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode;
+    template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNodeAllocator;
+    template<typename ValueArg, size_t inlineCapacity, typename HashArg> struct ListHashSetNodeHashFunctions;
 
-    template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet : public FastAllocBase {
+    template<typename ValueArg, size_t inlineCapacity = 256, typename HashArg = typename DefaultHash<ValueArg>::Hash> class ListHashSet : public FastAllocBase {
     private:
-        typedef ListHashSetNode<ValueArg> Node;
-        typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+        typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
+        typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
 
         typedef HashTraits<Node*> NodeTraits;
-        typedef ListHashSetNodeHashFunctions<ValueArg, HashArg> NodeHash;
+        typedef ListHashSetNodeHashFunctions<ValueArg, inlineCapacity, HashArg> NodeHash;
 
         typedef HashTable<Node*, Node*, IdentityExtractor<Node*>, NodeHash, NodeTraits, NodeTraits> ImplType;
         typedef HashTableIterator<Node*, Node*, IdentityExtractor<Node*>, NodeHash, NodeTraits, NodeTraits> ImplTypeIterator;
@@ -67,10 +67,10 @@ namespace WTF {
 
     public:
         typedef ValueArg ValueType;
-        typedef ListHashSetIterator<ValueType, HashArg> iterator;
-        typedef ListHashSetConstIterator<ValueType, HashArg> const_iterator;
+        typedef ListHashSetIterator<ValueType, inlineCapacity, HashArg> iterator;
+        typedef ListHashSetConstIterator<ValueType, inlineCapacity, HashArg> const_iterator;
 
-        friend class ListHashSetConstIterator<ValueType, HashArg>;
+        friend class ListHashSetConstIterator<ValueType, inlineCapacity, HashArg>;
 
         ListHashSet();
         ListHashSet(const ListHashSet&);
@@ -119,9 +119,9 @@ namespace WTF {
         OwnPtr<NodeAllocator> m_allocator;
     };
 
-    template<typename ValueArg> struct ListHashSetNodeAllocator {
-        typedef ListHashSetNode<ValueArg> Node;
-        typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+    template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNodeAllocator {
+        typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
+        typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
 
         ListHashSetNodeAllocator() 
             : m_freeList(pool())
@@ -181,15 +181,15 @@ namespace WTF {
 
         Node* m_freeList;
         bool m_isDoneWithInitialFreeList;
-        static const size_t m_poolSize = 256;
+        static const size_t m_poolSize = inlineCapacity;
         union {
             char pool[sizeof(Node) * m_poolSize];
             double forAlignment;
         } m_pool;
     };
 
-    template<typename ValueArg> struct ListHashSetNode {
-        typedef ListHashSetNodeAllocator<ValueArg> NodeAllocator;
+    template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode {
+        typedef ListHashSetNodeAllocator<ValueArg, inlineCapacity> NodeAllocator;
 
         ListHashSetNode(ValueArg value)
             : m_value(value)
@@ -220,25 +220,25 @@ namespace WTF {
 #endif
     };
 
-    template<typename ValueArg, typename HashArg> struct ListHashSetNodeHashFunctions {
-        typedef ListHashSetNode<ValueArg> Node;
+    template<typename ValueArg, size_t inlineCapacity, typename HashArg> struct ListHashSetNodeHashFunctions {
+        typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
         
         static unsigned hash(Node* const& key) { return HashArg::hash(key->m_value); }
         static bool equal(Node* const& a, Node* const& b) { return HashArg::equal(a->m_value, b->m_value); }
         static const bool safeToCompareToEmptyOrDeleted = false;
     };
 
-    template<typename ValueArg, typename HashArg> class ListHashSetIterator {
+    template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetIterator {
     private:
-        typedef ListHashSet<ValueArg, HashArg> ListHashSetType;
-        typedef ListHashSetIterator<ValueArg, HashArg> iterator;
-        typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;
-        typedef ListHashSetNode<ValueArg> Node;
+        typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
+        typedef ListHashSetIterator<ValueArg, inlineCapacity, HashArg> iterator;
+        typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_iterator;
+        typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
         typedef ValueArg ValueType;
         typedef ValueType& ReferenceType;
         typedef ValueType* PointerType;
 
-        friend class ListHashSet<ValueArg, HashArg>;
+        friend class ListHashSet<ValueArg, inlineCapacity, HashArg>;
 
         ListHashSetIterator(const ListHashSetType* set, Node* position) : m_iterator(set, position) { }
 
@@ -271,18 +271,18 @@ namespace WTF {
         const_iterator m_iterator;
     };
 
-    template<typename ValueArg, typename HashArg> class ListHashSetConstIterator {
+    template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetConstIterator {
     private:
-        typedef ListHashSet<ValueArg, HashArg> ListHashSetType;
-        typedef ListHashSetIterator<ValueArg, HashArg> iterator;
-        typedef ListHashSetConstIterator<ValueArg, HashArg> const_iterator;
-        typedef ListHashSetNode<ValueArg> Node;
+        typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
+        typedef ListHashSetIterator<ValueArg, inlineCapacity, HashArg> iterator;
+        typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_iterator;
+        typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
         typedef ValueArg ValueType;
         typedef const ValueType& ReferenceType;
         typedef const ValueType* PointerType;
 
-        friend class ListHashSet<ValueArg, HashArg>;
-        friend class ListHashSetIterator<ValueArg, HashArg>;
+        friend class ListHashSet<ValueArg, inlineCapacity, HashArg>;
+        friend class ListHashSetIterator<ValueArg, inlineCapacity, HashArg>;
 
         ListHashSetConstIterator(const ListHashSetType* set, Node* position)
             : m_set(set)
@@ -341,11 +341,11 @@ namespace WTF {
     };
 
 
-    template<typename ValueType, typename HashFunctions>
+    template<typename ValueType, size_t inlineCapacity, typename HashFunctions>
     struct ListHashSetTranslator {
     private:
-        typedef ListHashSetNode<ValueType> Node;
-        typedef ListHashSetNodeAllocator<ValueType> NodeAllocator;
+        typedef ListHashSetNode<ValueType, inlineCapacity> Node;
+        typedef ListHashSetNodeAllocator<ValueType, inlineCapacity> NodeAllocator;
     public:
         static unsigned hash(const ValueType& key) { return HashFunctions::hash(key); }
         static bool equal(Node* const& a, const ValueType& b) { return HashFunctions::equal(a->m_value, b); }
@@ -355,16 +355,16 @@ namespace WTF {
         }
     };
 
-    template<typename T, typename U>
-    inline ListHashSet<T, U>::ListHashSet()
+    template<typename T, size_t inlineCapacity, typename U>
+    inline ListHashSet<T, inlineCapacity, U>::ListHashSet()
         : m_head(0)
         , m_tail(0)
         , m_allocator(new NodeAllocator)
     {
     }
 
-    template<typename T, typename U>
-    inline ListHashSet<T, U>::ListHashSet(const ListHashSet& other)
+    template<typename T, size_t inlineCapacity, typename U>
+    inline ListHashSet<T, inlineCapacity, U>::ListHashSet(const ListHashSet& other)
         : m_head(0)
         , m_tail(0)
         , m_allocator(new NodeAllocator)
@@ -374,16 +374,16 @@ namespace WTF {
             add(*it);
     }
 
-    template<typename T, typename U>
-    inline ListHashSet<T, U>& ListHashSet<T, U>::operator=(const ListHashSet& other)
+    template<typename T, size_t inlineCapacity, typename U>
+    inline ListHashSet<T, inlineCapacity, U>& ListHashSet<T, inlineCapacity, U>::operator=(const ListHashSet& other)
     {
         ListHashSet tmp(other);
         swap(tmp);
         return *this;
     }
 
-    template<typename T, typename U>
-    inline void ListHashSet<T, U>::swap(ListHashSet& other)
+    template<typename T, size_t inlineCapacity, typename U>
+    inline void ListHashSet<T, inlineCapacity, U>::swap(ListHashSet& other)
     {
         m_impl.swap(other.m_impl);
         std::swap(m_head, other.m_head);
@@ -391,95 +391,95 @@ namespace WTF {
         m_allocator.swap(other.m_allocator);
     }
 
-    template<typename T, typename U>
-    inline ListHashSet<T, U>::~ListHashSet()
+    template<typename T, size_t inlineCapacity, typename U>
+    inline ListHashSet<T, inlineCapacity, U>::~ListHashSet()
     {
         deleteAllNodes();
     }
 
-    template<typename T, typename U>
-    inline int ListHashSet<T, U>::size() const
+    template<typename T, size_t inlineCapacity, typename U>
+    inline int ListHashSet<T, inlineCapacity, U>::size() const
     {
         return m_impl.size(); 
     }
 
-    template<typename T, typename U>
-    inline int ListHashSet<T, U>::capacity() const
+    template<typename T, size_t inlineCapacity, typename U>
+    inline int ListHashSet<T, inlineCapacity, U>::capacity() const
     {
         return m_impl.capacity(); 
     }
 
-    template<typename T, typename U>
-    inline bool ListHashSet<T, U>::isEmpty() const
+    template<typename T, size_t inlineCapacity, typename U>
+    inline bool ListHashSet<T, inlineCapacity, U>::isEmpty() const
     {
         return m_impl.isEmpty(); 
     }
 
-    template<typename T, typename U>
-    inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::begin()
+    template<typename T, size_t inlineCapacity, typename U>
+    inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::begin()
     {
         return makeIterator(m_head); 
     }
 
-    template<typename T, typename U>
-    inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::end()
+    template<typename T, size_t inlineCapacity, typename U>
+    inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::end()
     {
         return makeIterator(0);
     }
 
-    template<typename T, typename U>
-    inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::begin() const
+    template<typename T, size_t inlineCapacity, typename U>
+    inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::begin() const
     {
         return makeConstIterator(m_head); 
     }
 
-    template<typename T, typename U>
-    inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::end() const
+    template<typename T, size_t inlineCapacity, typename U>
+    inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::end() const
     {
         return makeConstIterator(0); 
     }
 
-    template<typename T, typename U>
-    inline typename ListHashSet<T, U>::iterator ListHashSet<T, U>::find(const ValueType& value)
+    template<typename T, size_t inlineCapacity, typename U>
+    inline typename ListHashSet<T, inlineCapacity, U>::iterator ListHashSet<T, inlineCapacity, U>::find(const ValueType& value)
     {
-        typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+        typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
         ImplTypeIterator it = m_impl.template find<ValueType, Translator>(value);
         if (it == m_impl.end())
             return end();
         return makeIterator(*it); 
     }
 
-    template<typename T, typename U>
-    inline typename ListHashSet<T, U>::const_iterator ListHashSet<T, U>::find(const ValueType& value) const
+    template<typename T, size_t inlineCapacity, typename U>
+    inline typename ListHashSet<T, inlineCapacity, U>::const_iterator ListHashSet<T, inlineCapacity, U>::find(const ValueType& value) const
     {
-        typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+        typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
         ImplTypeConstIterator it = m_impl.template find<ValueType, Translator>(value);
         if (it == m_impl.end())
             return end();
         return makeConstIterator(*it);
     }
 
-    template<typename T, typename U>
-    inline bool ListHashSet<T, U>::contains(const ValueType& value) const
+    template<typename T, size_t inlineCapacity, typename U>
+    inline bool ListHashSet<T, inlineCapacity, U>::contains(const ValueType& value) const
     {
-        typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+        typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
         return m_impl.template contains<ValueType, Translator>(value);
     }
 
-    template<typename T, typename U>
-    pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::add(const ValueType &value)
+    template<typename T, size_t inlineCapacity, typename U>
+    pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::add(const ValueType &value)
     {
-        typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+        typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
         pair<typename ImplType::iterator, bool> result = m_impl.template add<ValueType, NodeAllocator*, Translator>(value, m_allocator.get());
         if (result.second)
             appendNode(*result.first);
         return std::make_pair(makeIterator(*result.first), result.second);
     }
 
-    template<typename T, typename U>
-    pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::insertBefore(iterator it, const ValueType& newValue)
+    template<typename T, size_t inlineCapacity, typename U>
+    pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::insertBefore(iterator it, const ValueType& newValue)
     {
-        typedef ListHashSetTranslator<ValueType, HashFunctions> Translator;
+        typedef ListHashSetTranslator<ValueType, inlineCapacity, HashFunctions> Translator;
         pair<typename ImplType::iterator, bool> result = m_impl.template add<ValueType, NodeAllocator*, Translator>(newValue, m_allocator.get());
         if (result.second)
             insertNodeBefore(it.node(), *result.first);
@@ -487,14 +487,14 @@ namespace WTF {
 
     }
 
-    template<typename T, typename U>
-    pair<typename ListHashSet<T, U>::iterator, bool> ListHashSet<T, U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue)
+    template<typename T, size_t inlineCapacity, typename U>
+    pair<typename ListHashSet<T, inlineCapacity, U>::iterator, bool> ListHashSet<T, inlineCapacity, U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue)
     {
         return insertBefore(find(beforeValue), newValue); 
     }
 
-    template<typename T, typename U>
-    inline void ListHashSet<T, U>::remove(iterator it)
+    template<typename T, size_t inlineCapacity, typename U>
+    inline void ListHashSet<T, inlineCapacity, U>::remove(iterator it)
     {
         if (it == end())
             return;
@@ -502,14 +502,14 @@ namespace WTF {
         unlinkAndDelete(it.node());
     }
 
-    template<typename T, typename U>
-    inline void ListHashSet<T, U>::remove(const ValueType& value)
+    template<typename T, size_t inlineCapacity, typename U>
+    inline void ListHashSet<T, inlineCapacity, U>::remove(const ValueType& value)
     {
         remove(find(value));
     }
 
-    template<typename T, typename U>
-    inline void ListHashSet<T, U>::clear()
+    template<typename T, size_t inlineCapacity, typename U>
+    inline void ListHashSet<T, inlineCapacity, U>::clear()
     {
         deleteAllNodes();
         m_impl.clear(); 
@@ -517,8 +517,8 @@ namespace WTF {
         m_tail = 0;
     }
 
-    template<typename T, typename U>
-    void ListHashSet<T, U>::unlinkAndDelete(Node* node)
+    template<typename T, size_t inlineCapacity, typename U>
+    void ListHashSet<T, inlineCapacity, U>::unlinkAndDelete(Node* node)
     {
         if (!node->m_prev) {
             ASSERT(node == m_head);
@@ -539,8 +539,8 @@ namespace WTF {
         node->destroy(m_allocator.get());
     }
 
-    template<typename T, typename U>
-    void ListHashSet<T, U>::appendNode(Node* node)
+    template<typename T, size_t inlineCapacity, typename U>
+    void ListHashSet<T, inlineCapacity, U>::appendNode(Node* node)
     {
         node->m_prev = m_tail;
         node->m_next = 0;
@@ -556,8 +556,8 @@ namespace WTF {
         m_tail = node;
     }
 
-    template<typename T, typename U>
-    void ListHashSet<T, U>::insertNodeBefore(Node* beforeNode, Node* newNode)
+    template<typename T, size_t inlineCapacity, typename U>
+    void ListHashSet<T, inlineCapacity, U>::insertNodeBefore(Node* beforeNode, Node* newNode)
     {
         if (!beforeNode)
             return appendNode(newNode);
@@ -572,8 +572,8 @@ namespace WTF {
             m_head = newNode;
     }
 
-    template<typename T, typename U>
-    void ListHashSet<T, U>::deleteAllNodes()
+    template<typename T, size_t inlineCapacity, typename U>
+    void ListHashSet<T, inlineCapacity, U>::deleteAllNodes()
     {
         if (!m_head)
             return;
@@ -582,16 +582,16 @@ namespace WTF {
             node->destroy(m_allocator.get());
     }
 
-    template<typename T, typename U>
-    inline ListHashSetIterator<T, U> ListHashSet<T, U>::makeIterator(Node* position) 
+    template<typename T, size_t inlineCapacity, typename U>
+    inline ListHashSetIterator<T, inlineCapacity, U> ListHashSet<T, inlineCapacity, U>::makeIterator(Node* position) 
     {
-        return ListHashSetIterator<T, U>(this, position); 
+        return ListHashSetIterator<T, inlineCapacity, U>(this, position); 
     }
 
-    template<typename T, typename U>
-    inline ListHashSetConstIterator<T, U> ListHashSet<T, U>::makeConstIterator(Node* position) const
+    template<typename T, size_t inlineCapacity, typename U>
+    inline ListHashSetConstIterator<T, inlineCapacity, U> ListHashSet<T, inlineCapacity, U>::makeConstIterator(Node* position) const
     { 
-        return ListHashSetConstIterator<T, U>(this, position); 
+        return ListHashSetConstIterator<T, inlineCapacity, U>(this, position); 
     }
 
     template<bool, typename ValueType, typename HashTableType>
@@ -603,10 +603,10 @@ namespace WTF {
             delete (*it)->m_value;
     }
 
-    template<typename T, typename U>
-    inline void deleteAllValues(const ListHashSet<T, U>& collection)
+    template<typename T, size_t inlineCapacity, typename U>
+    inline void deleteAllValues(const ListHashSet<T, inlineCapacity, U>& collection)
     {
-        deleteAllValues<true, typename ListHashSet<T, U>::ValueType>(collection.m_impl);
+        deleteAllValues<true, typename ListHashSet<T, inlineCapacity, U>::ValueType>(collection.m_impl);
     }
 
 } // namespace WTF
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 57c1cf6..924b120 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
 
 and has the sha1 checksum
 
-        b3589e88fb8d581fb523578763831109f914dc2e
+        2f598e9b7b376d851fe089bc1dc729bcf0393a06
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 687b76b..a84f177 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,81 @@
+2010-06-24  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Unreviewed Symbian build fix.
+
+        The QML WebKit integration needs to be part of QtWebKit.sis
+
+        * WebCore.pro: Deploy qmlwebkitplugin.dll.
+
+2010-06-23  Benjamin Poulain  <benjamin.poulain@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Do not render the full frame when there is some elements with fixed positioning
+        https://bugs.webkit.org/show_bug.cgi?id=33150
+
+        Do not render the full frame when there is some elements with fixed positioning
+        https://bugs.webkit.org/show_bug.cgi?id=33150
+
+        The frame view take into acount the list of fixed object when scrolling
+        the view. If the number of object is lower than a certain threshold, the pixel
+        are blitted, and the invalidated area updated.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::addFixedObject):
+        (WebCore::FrameView::removeFixedObject):
+        (WebCore::FrameView::scrollContentsFastPath):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollContents):
+        (WebCore::ScrollView::scrollContentsFastPath):
+        * platform/ScrollView.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::repaintRectIncludingDescendants):
+        * rendering/RenderLayer.h:
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::styleWillChange):
+
+2010-05-18  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Allocate the m_preloads list hash set dynamically and free it when done.
+        https://bugs.webkit.org/show_bug.cgi?id=39309
+        <rdar://problem/7998495>
+
+        This saves about 6000 bytes on a fully loaded document.
+
+        * loader/DocLoader.cpp:
+        (WebCore::DocLoader::requestPreload):
+        (WebCore::DocLoader::clearPreloads):
+        * loader/DocLoader.h:
+
+2010-05-18  Anders Carlsson  <andersca@apple.com>
+
+        Revert unintended indentation and unnecessary nested name specifier.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::clipOutPositionedObjects):
+        (WebCore::RenderBlock::insertPositionedObject):
+
+2010-05-18  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add an inlineCapacity template parameter to ListHashSet and use it to shrink the positioned object list hash set.
+        https://bugs.webkit.org/show_bug.cgi?id=39304
+        <rdar://problem/7998366>
+
+        Set the inlineCapacity for the positionedObjects ListHashSet to 4 instead of 256. Since a RenderBlock usually has 
+        few positioned objects, this saves memory.
+
+        * WebCore.base.exp:
+        * rendering/RenderBlock.cpp:
+        (WebCore::clipOutPositionedObjects):
+        (WebCore::RenderBlock::insertPositionedObject):
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::positionedObjects):
+
 2010-06-22  Simon Hausmann  <simon.hausmann@nokia.com>
 
         Unreviewed Qt/Symbian build fix.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index e208b5f..1162a52 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -25,7 +25,7 @@ symbian: {
     webkitbackup.sources = ../WebKit/qt/symbian/backup_registration.xml
     webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
 
-    contains(QT_CONFIG, declarative): {
+    contains(QT_CONFIG, declarative) {
          declarativeImport.sources = qmlwebkitplugin$${QT_LIBINFIX}.dll
          declarativeImport.sources += ../WebKit/qt/declarative/qmldir
          declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
diff --git a/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp b/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
index 0053e7b..4597704 100644
--- a/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
+++ b/src/3rdparty/webkit/WebCore/loader/DocLoader.cpp
@@ -407,10 +407,14 @@ void DocLoader::requestPreload(CachedResource::Type type, const String& url, con
         encoding = charset.isEmpty() ? m_doc->frame()->loader()->encoding() : charset;
 
     CachedResource* resource = requestResource(type, url, encoding, true);
-    if (!resource || m_preloads.contains(resource))
+    if (!resource || (m_preloads && m_preloads->contains(resource)))
         return;
     resource->increasePreloadCount();
-    m_preloads.add(resource);
+
+    if (!m_preloads)
+        m_preloads.set(new ListHashSet<CachedResource*>);
+    m_preloads->add(resource);
+
 #if PRELOAD_DEBUG
     printf("PRELOADING %s\n",  resource->url().latin1().data());
 #endif
@@ -421,8 +425,11 @@ void DocLoader::clearPreloads()
 #if PRELOAD_DEBUG
     printPreloadStats();
 #endif
-    ListHashSet<CachedResource*>::iterator end = m_preloads.end();
-    for (ListHashSet<CachedResource*>::iterator it = m_preloads.begin(); it != end; ++it) {
+    if (!m_preloads)
+        return;
+
+    ListHashSet<CachedResource*>::iterator end = m_preloads->end();
+    for (ListHashSet<CachedResource*>::iterator it = m_preloads->begin(); it != end; ++it) {
         CachedResource* res = *it;
         res->decreasePreloadCount();
         if (res->canDelete() && !res->inCache())
diff --git a/src/3rdparty/webkit/WebCore/loader/DocLoader.h b/src/3rdparty/webkit/WebCore/loader/DocLoader.h
index 8ec73e1..66e4164 100644
--- a/src/3rdparty/webkit/WebCore/loader/DocLoader.h
+++ b/src/3rdparty/webkit/WebCore/loader/DocLoader.h
@@ -47,8 +47,7 @@ class ImageLoader;
 class KURL;
 
 // The DocLoader manages the loading of scripts/images/stylesheets for a single document.
-class DocLoader : public Noncopyable
-{
+class DocLoader : public Noncopyable {
 friend class Cache;
 friend class ImageLoader;
 
@@ -117,7 +116,7 @@ private:
     
     int m_requestCount;
     
-    ListHashSet<CachedResource*> m_preloads;
+    OwnPtr<ListHashSet<CachedResource*> > m_preloads;
     struct PendingPreload {
         CachedResource::Type m_type;
         String m_url;
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
index a53db36..639414b 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
@@ -884,7 +884,7 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
 {
     const size_t fixedObjectThreshold = 5;
 
-    ListHashSet<RenderBox*>* positionedObjects = 0;
+    RenderBlock::PositionedObjectsListHashSet* positionedObjects = 0;
     if (RenderView* root = m_frame->contentRenderer())
         positionedObjects = root->positionedObjects();
 
@@ -896,14 +896,14 @@ bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect
     // Get the rects of the fixed objects visible in the rectToScroll
     Vector<IntRect, fixedObjectThreshold> subRectToUpdate;
     bool updateInvalidatedSubRect = true;
-    ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end();
-    for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+    RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
+    for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
         RenderBox* renderBox = *it;
         if (renderBox->style()->position() != FixedPosition)
             continue;
-        IntRect topLevelRect;
-        IntRect updateRect = renderBox->paintingRootRect(topLevelRect);
-        updateRect.move(-scrollX(), -scrollY());
+        IntRect updateRect = renderBox->layer()->repaintRectIncludingDescendants();
+        updateRect = contentsToWindow(updateRect);
+
         updateRect.intersect(rectToScroll);
         if (!updateRect.isEmpty()) {
             if (subRectToUpdate.size() >= fixedObjectThreshold) {
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
index a7b8a02..798663e 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
@@ -1982,13 +1982,13 @@ void RenderBlock::paintSelection(PaintInfo& paintInfo, int tx, int ty)
 }
 
 #ifndef BUILDING_ON_TIGER
-static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, ListHashSet<RenderBox*>* positionedObjects)
+static void clipOutPositionedObjects(const RenderObject::PaintInfo* paintInfo, int tx, int ty, RenderBlock::PositionedObjectsListHashSet* positionedObjects)
 {
     if (!positionedObjects)
         return;
     
-    ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end();
-    for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+    RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
+    for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
         RenderBox* r = *it;
         paintInfo->context->clipOut(IntRect(tx + r->x(), ty + r->y(), r->width(), r->height()));
     }
@@ -2274,7 +2274,7 @@ void RenderBlock::insertPositionedObject(RenderBox* o)
 {
     // Create the list of special objects if we don't aleady have one
     if (!m_positionedObjects)
-        m_positionedObjects = new ListHashSet<RenderBox*>;
+        m_positionedObjects = new PositionedObjectsListHashSet;
 
     m_positionedObjects->add(o);
 }
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
index 184f983..d555d31 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h
@@ -74,7 +74,9 @@ public:
     void insertPositionedObject(RenderBox*);
     void removePositionedObject(RenderBox*);
     void removePositionedObjects(RenderBlock*);
-    ListHashSet<RenderBox*>* positionedObjects() const { return m_positionedObjects; }
+
+    typedef ListHashSet<RenderBox*, 4> PositionedObjectsListHashSet;
+    PositionedObjectsListHashSet* positionedObjects() const { return m_positionedObjects; }
 
     void addPercentHeightDescendant(RenderBox*);
     static void removePercentHeightDescendant(RenderBox*);
@@ -483,9 +485,10 @@ private:
     void setCollapsedBottomMargin(const MarginInfo&);
     // End helper functions and structs used by layoutBlockChildren.
 
-    typedef ListHashSet<RenderBox*>::const_iterator Iterator;
+    typedef PositionedObjectsListHashSet::const_iterator Iterator;
     DeprecatedPtrList<FloatingObject>* m_floatingObjects;
-    ListHashSet<RenderBox*>* m_positionedObjects;
+    
+    PositionedObjectsListHashSet* m_positionedObjects;
 
     // An inline can be split with blocks occurring in between the inline content.
     // When this occurs we need a pointer to our next object.  We can basically be
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
index 3314772..a012868 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
@@ -325,6 +325,14 @@ void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags)
         m_marquee->updateMarqueePosition();
 }
 
+IntRect RenderLayer::repaintRectIncludingDescendants() const
+{
+    IntRect repaintRect = m_repaintRect;
+    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
+        repaintRect.unite(child->repaintRectIncludingDescendants());
+    return repaintRect;
+}
+
 void RenderLayer::computeRepaintRects()
 {
     RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
index 81a66e1..e221f28 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
@@ -394,6 +394,7 @@ public:
 
     // Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
     IntRect repaintRect() const { return m_repaintRect; }
+    IntRect repaintRectIncludingDescendants() const;
     void computeRepaintRects();
     void updateRepaintRectsAfterScroll(bool fixed = false);
     void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 050b1c1..69a431f 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,19 @@
+2010-06-24  Simon Hausmann  <simon.hausmann@nokia.com>
+
+        Unreviewed Symbian build fix.
+
+        The QML WebKit integration needs to be part of QtWebKit.sis
+
+        * declarative/declarative.pro: Removed non-working deployment.
+
+2010-06-23  David Boddie  <dboddie@trolltech.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Doc: Fixed documentation errors.
+
+        * docs/qtwebkit-bridge.qdoc:
+
 2010-06-23  Alessandro Portale  <alessandro.portale@nokia.com>
 
         Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
index fa93293..c2a38fd 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
+++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit-bridge.qdoc
@@ -8,7 +8,7 @@
 
     The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native
     objects that are represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection,
-    a part of the \l{Qt Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
+    a part of the \l{Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
     for example \l{QObject} properties map directly to JavaScript properties.
 
     For example, both JavaScript and QObjects have properties: a construct that represent a getter/setter
@@ -24,7 +24,7 @@
     applications. For example, an application that contains a media-player, playlist manager, and music store.
     The playlist manager is usually best authored as a classic desktop application,
     with the native-looking robust \l{QWidget}s helping with producing that application.
-    The media-player control, which usually looks custom, can be written using \l{The Graphics View framework}
+    The media-player control, which usually looks custom, can be written using the \l{Graphics View framework}
     or with in a declarative way with \l{QtDeclarative}. The music store, which shows dynamic content
     from the internet and gets modified rapidly, is best authored in HTML and maintained on the server.
 
-- 
cgit v0.12


From 5b5ae51b22b57897dd61b9f8910e510757fa59c5 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 24 Jun 2010 14:07:49 +0200
Subject: Fixed several problems with the postlinker for Symbian (elf2e32).

The fixes were too complicated for a profile and so a perl script was
introduced. These are the issues that were addressed:

- Made sure that we link correctly in all cases where there is a
  mismatch between the DEF file and the ELF file. Specifically, these
  two cases:

    - If elf2e32 detects a symbols in the ELF file that is marked as
      absent in the DEF file, an ordinal mapping will not be
      generated in the dso file. This means that binaries linking to
      the library will not find the symbol, even though it exists in
      the code. Since this is completely useless behavior, this was
      fixed to include the symbol regardless.

    - If the DEF file contains a symbol that is not present in the
      ELF file, an ordinal mapping will be created in the dso file
      regardless, which means applications can link to a symbol that
      does not exist. This is even worse than point one, since it is
      not detected until runtime, when the dynamic link will fail.
      Fixed by leaving the symbol out of the dso file if it does not
      exist in the ELF file.

  Both fixes require rerunning elf2e32 to fix the symbol mappings
  that were broken in the first run, but it only happens if at least
  one symbol is broken in the way described above. Also, freezing the
  DEF files will "save" the symbols, so that it does not occur after
  that.

  Note that this does not remove the ability to get the postlinker to
  tell you about mismatches. By doing
  "QMAKE_ELF2E32_FLAGS -= --unfrozen", the symbol mismatches will be
  considered errors instead of warnings, and they can be caught that
  way.

- Code that was previously in the profile was moved to the perl
  script:

    - Detecting that there are errors in the postlink and return
      nonzero. elf2e32 does not do this on its own (at least not when
      using Wine).

    - Only overwriting the old dso file if the new one is different.
      This saves build time, since binaries that depend on the
      library do not trigger relink if the dso has not changed.

  These two points simplify the code, and they will also help the
  porting to Windows, since the old shell script tricks would not
  have worked there.

RevBy:    Trust me
---
 bin/elf2e32_qtwrapper                         | 145 ++++++++++++++++++++++++++
 mkspecs/features/symbian/def_files.prf        |   4 +-
 mkspecs/features/symbian/symbian_building.prf |  13 +--
 3 files changed, 151 insertions(+), 11 deletions(-)
 create mode 100755 bin/elf2e32_qtwrapper

diff --git a/bin/elf2e32_qtwrapper b/bin/elf2e32_qtwrapper
new file mode 100755
index 0000000..694d54a
--- /dev/null
+++ b/bin/elf2e32_qtwrapper
@@ -0,0 +1,145 @@
+#!/usr/bin/perl -w
+
+# A script to get around some shortcomings in elf2e32, namely:
+# - Returning 0 even when there are errors.
+# - Excluding symbols from the dso file even when they are present in the ELF file.
+# - Including symbols in the the dso file even when they are not present in the ELF file.
+# - Overwriting the old dso file even when there are no changes (increases build time).
+
+use File::Copy;
+
+my @args = ();
+my @definput;
+my @defoutput;
+my @dso;
+my @tmpdso;
+foreach (@ARGV) {
+    if (/^--definput/o) {
+        @definput = split('=', $_);
+    } elsif (/^--defoutput/o) {
+        @defoutput = split('=', $_);
+    } elsif (/^--dso/o) {
+        @dso = split('=', $_);
+    } elsif (/^--tmpdso/o) {
+        @tmpdso = split('=', $_);
+        $tmpdso[0] = "--dso";
+    } else {
+        push(@args, $_);
+    }
+}
+
+@definput = () if (!@definput || ! -e $definput[1]);
+
+if (@dso && !@tmpdso || !@dso && @tmpdso) {
+    print("--dso and --tmpdso must be used together.\n");
+    exit 1;
+}
+
+my $buildingLibrary = (@defoutput && @dso) ? 1 : 0;
+
+my $fixupFile = "";
+my $runCount = 0;
+my $returnCode = 0;
+
+while (1) {
+    if (++$runCount > 2) {
+        print("Internal error in $0, link succeeded, but exports may be wrong.\n");
+        last;
+    }
+
+    my $elf2e32Pipe;
+    my $elf2e32Cmd = "elf2e32 @args"
+         . " " . join("=", @definput)
+         . " " . join("=", @defoutput)
+         . " " . join("=", @tmpdso);
+    open($elf2e32Pipe, "$elf2e32Cmd 2>&1 |") or die ("Could not run elf2e32");
+
+    my %fixupSymbols;
+    my $foundBrokenSymbols = 0;
+    my $errors = 0;
+    while (<$elf2e32Pipe>) {
+        print;
+        if (/Error:/io) {
+            $errors = 1;
+        } elsif (/symbol ([a-z0-9_]+) absent in the DEF file, but present in the ELF file/io) {
+            $fixupSymbols{$1} = 1;
+            $foundBrokenSymbols = 1;
+        } elsif (/[0-9]+ Frozen Export\(s\) missing from the ELF file/io) {
+            $foundBrokenSymbols = 1;
+        }
+    }
+    close($elf2e32Pipe);
+
+    if ($errors) {
+        $returnCode = 1;
+        last;
+    }
+
+    if ($buildingLibrary) {
+        my $tmpDefFile;
+        my $defFile;
+        open($defFile, "< $defoutput[1]") or die("Could not open $defoutput[1]");
+        open($tmpDefFile, "> $defoutput[1].tmp") or die("Could not open $defoutput[1].tmp");
+        $fixupFile = "$defoutput[1].tmp";
+        while (<$defFile>) {
+            s/\r//;
+            s/\n//;
+            next if (/; NEW:/);
+            if (/([a-z0-9_]+) @/i) {
+                if (exists($fixupSymbols{$1})) {
+                    s/ ABSENT//;
+                } elsif (s/; MISSING://) {
+                    s/$/ ABSENT/;
+                }
+            }
+            print($tmpDefFile "$_\n");
+        }
+        close($defFile);
+        close($tmpDefFile);
+
+        $definput[1] = "$defoutput[1].tmp";
+
+        if (!$foundBrokenSymbols || $errors) {
+            last;
+        }
+
+        print("Rerunning elf2e32 due to DEF file / ELF file mismatch\n");
+    } else {
+        last;
+    }
+};
+
+if ($fixupFile) {
+    unlink($defoutput[1]);
+    move($fixupFile, $defoutput[1]);
+}
+
+exit $returnCode if ($returnCode != 0);
+
+if ($buildingLibrary) {
+    my $differenceFound = 0;
+
+    if (-e $dso[1]) {
+        my $dsoFile;
+        my $tmpdsoFile;
+        my $dsoBuf;
+        my $tmpdsoBuf;
+        open($dsoFile, "< $dso[1]") or die("Could not open $dso[1]");
+        open($tmpdsoFile, "< $tmpdso[1]") or die("Could not open $tmpdso[1]");
+        binmode($dsoFile);
+        binmode($tmpdsoFile);
+        while(read($dsoFile, $dsoBuf, 4096) && read($tmpdsoFile, $tmpdsoBuf, 4096)) {
+            if ($dsoBuf ne $tmpdsoBuf) {
+                $differenceFound = 1;
+            }
+        }
+        close($tmpdsoFile);
+        close($dsoFile);
+    } else {
+        $differenceFound = 1;
+    }
+
+    if ($differenceFound) {
+        copy($tmpdso[1], $dso[1]);
+    }
+}
diff --git a/mkspecs/features/symbian/def_files.prf b/mkspecs/features/symbian/def_files.prf
index 1b8e551..bae9d2d 100644
--- a/mkspecs/features/symbian/def_files.prf
+++ b/mkspecs/features/symbian/def_files.prf
@@ -56,7 +56,7 @@ symbian-abld|symbian-sbsv2 {
     } else {
         elf2e32FileToAdd = $$_PRO_FILE_PWD_/$$defFile
     }
-    QMAKE_ELF2E32_FLAGS += "`test -e $$elf2e32FileToAdd && echo --definput=$$elf2e32FileToAdd`"
+    QMAKE_ELF2E32_FLAGS += "--definput=$$elf2e32FileToAdd"
 
     symbianObjdir = $$OBJECTS_DIR
     isEmpty(symbianObjdir):symbianObjdir = .
@@ -64,7 +64,7 @@ symbian-abld|symbian-sbsv2 {
     freeze_target.target = freeze
     freeze_target.depends = first
     # The perl part is to convert to unix line endings and remove comments, which the s60 tools refuse to do.
-    freeze_target.commands = perl -n -e \'next if (/; NEW/); s/\\r//g; if (/MISSING:(.*)/x) { print(\"\$\$1 ABSENT\\n\"); } else { print; }\' < $$symbianObjdir/$${TARGET}.def >  $$elf2e32FileToAdd
+    freeze_target.commands = $$QMAKE_COPY $$symbianObjdir/$${TARGET}.def $$elf2e32FileToAdd
     QMAKE_EXTRA_TARGETS += freeze_target
 } else:contains(TEMPLATE, subdirs) {
     freeze_target.target = freeze
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 5861bb6..bdab8d5 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -106,7 +106,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
     # The comparison of dso files is to avoid extra building of modules that depend on this dso, in
     # case it has not changed.
     QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET}.dll $$symbianDestdir/$${TARGET}.sym \
-                      && elf2e32  --version=$$decVersion \
+                      && elf2e32_qtwrapper  --version=$$decVersion \
                       --sid=$$TARGET.SID \
                       --uid1=0x10000079 \
                       --uid2=$$TARGET.UID2 \
@@ -114,7 +114,8 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
                       --targettype=DLL \
                       --elfinput=$${symbianDestdir}/$${TARGET}.sym \
                       --output=$${symbianDestdir}/$${TARGET}.dll \
-                      --dso=$$symbianObjdir/$${TARGET}.dso \
+                      --tmpdso=$${symbianObjdir}/$${TARGET}.dso \
+                      --dso=$${symbianDestdir}/$${TARGET}.dso \
                       --defoutput=$$symbianObjdir/$${TARGET}.def \
                       --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
                       --heap=$$join(TARGET.EPOCHEAPSIZE, ",") \
@@ -122,11 +123,6 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
                       $$elf2e32_LIBPATH \
                       $$capability \
                       $$QMAKE_ELF2E32_FLAGS \
-                      | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
-                      && if ! diff -q $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso \
-                      > /dev/null 2>&1; then \
-                          $$QMAKE_COPY $${symbianObjdir}/$${TARGET}.dso $${symbianDestdir}/$${TARGET}.dso; \
-                      fi \
                       $$QMAKE_POST_LINK
     QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
     QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.dso
@@ -159,7 +155,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
     }
     # the tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error
     QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym \
-                      && elf2e32  --version $$decVersion \
+                      && elf2e32_qtwrapper  --version $$decVersion \
                       --sid=$$TARGET.SID \
                       --uid1=0x1000007a \
                       --uid2=$$TARGET.UID2 \
@@ -173,7 +169,6 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
                       $$elf2e32_LIBPATH \
                       $$capability \
                       $$QMAKE_ELF2E32_FLAGS \
-                      | tee elf2e32.log && test `grep -c 'Error:' elf2e32.log` = 0 && rm elf2e32.log \
                       && ln "$${symbianDestdir}/$${TARGET}.exe" "$${symbianDestdir}/$$TARGET" \
                       $$QMAKE_POST_LINK
     QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
-- 
cgit v0.12


From d806b996beab76cbc43ffa11bc38721fa19c9c81 Mon Sep 17 00:00:00 2001
From: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Date: Thu, 24 Jun 2010 15:02:02 +0200
Subject: No more enter & leave events after a popup menu is closed on Windows

We use the TrackMouseEvent() to keep track of enter and leave messages.
Upon receiving a WM_MOUSELEAVE, the effect of that function call is over,
we need to call it again if we need more messages. This was not done when
we close a popup because of mouse click outside.

Task-number: QTBUG-11582
Reviewed-by: Bradley T. Hughes
---
 src/gui/kernel/qapplication_win.cpp | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 2a85fdc..ef719ca 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -3065,6 +3065,11 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
             break;
         }
     }
+#ifndef Q_OS_WINCE
+    static bool trackMouseEventLookup = false;
+    typedef BOOL (WINAPI *PtrTrackMouseEvent)(LPTRACKMOUSEEVENT);
+    static PtrTrackMouseEvent ptrTrackMouseEvent = 0;
+#endif
     state  = translateButtonState(msg.wParam, type, button); // button state
     const QPoint widgetPos = mapFromGlobal(QPoint(msg.pt.x, msg.pt.y));
     QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos);
@@ -3129,9 +3134,6 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
 #ifndef Q_OS_WINCE
 
             if (curWin != 0) {
-                static bool trackMouseEventLookup = false;
-                typedef BOOL (WINAPI *PtrTrackMouseEvent)(LPTRACKMOUSEEVENT);
-                static PtrTrackMouseEvent ptrTrackMouseEvent = 0;
                 if (!trackMouseEventLookup) {
                     trackMouseEventLookup = true;
                     ptrTrackMouseEvent = (PtrTrackMouseEvent)QLibrary::resolve(QLatin1String("comctl32"), "_TrackMouseEvent");
@@ -3245,6 +3247,21 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
             qt_button_down = 0;
         }
 
+#ifndef Q_OS_WINCE
+        if (type == QEvent::MouseButtonPress
+            && QApplication::activePopupWidget() != activePopupWidget
+            && ptrTrackMouseEvent
+            && curWin) {
+            // Since curWin is already the window we clicked on,
+            // we have to setup the mouse tracking here.
+            TRACKMOUSEEVENT tme;
+            tme.cbSize = sizeof(TRACKMOUSEEVENT);
+            tme.dwFlags = 0x00000002;    // TME_LEAVE
+            tme.hwndTrack = curWin;      // Track on window receiving msgs
+            tme.dwHoverTime = (DWORD)-1; // HOVER_DEFAULT
+            ptrTrackMouseEvent(&tme);
+        }
+#endif
         if (type == QEvent::MouseButtonPress
             && QApplication::activePopupWidget() != activePopupWidget
             && replayPopupMouseEvent) {
-- 
cgit v0.12


From 0531b97863f93c5a141bd9ef0b58bcf6282024e7 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Thu, 24 Jun 2010 15:27:13 +0200
Subject: Manipulate buffer position via 'pPos' in peek()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
---
 src/corelib/io/qiodevice.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index ea60792..26e587d 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1452,7 +1452,7 @@ qint64 QIODevicePrivate::peek(char *data, qint64 maxSize)
         return readBytes;
 
     buffer.ungetBlock(data, readBytes);
-    pos -= readBytes;
+    *pPos -= readBytes;
     return readBytes;
 }
 
@@ -1467,7 +1467,7 @@ QByteArray QIODevicePrivate::peek(qint64 maxSize)
         return result;
 
     buffer.ungetBlock(result.constData(), result.size());
-    pos -= result.size();
+    *pPos -= result.size();
     return result;
 }
 
-- 
cgit v0.12


From 415eab3eab1a037badec279dbfd41278f0f92719 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 24 Jun 2010 15:15:28 +0200
Subject: Fixed make runonphone that looked for the package in the wrong place.

Task:     QTBUG-11670
RevBy:    Trust me
---
 mkspecs/features/symbian/run_on_phone.prf | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mkspecs/features/symbian/run_on_phone.prf b/mkspecs/features/symbian/run_on_phone.prf
index 6948a48..818151a 100644
--- a/mkspecs/features/symbian/run_on_phone.prf
+++ b/mkspecs/features/symbian/run_on_phone.prf
@@ -11,9 +11,13 @@ else:!equals(DEPLOYMENT, default_deployment) {
 }
 
 equals(GENERATE_RUN_TARGETS, true) {
-    sis_destdir = $$DESTDIR
-    !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
-    contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+    symbian-abld|symbian-sbsv2 {
+        sis_destdir =
+    } else {
+        sis_destdir = $$DESTDIR
+        !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
+        contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+    }
 
     contains(SYMBIAN_PLATFORMS, "WINSCW"):contains(TEMPLATE, "app") {
         run_target.target = run
-- 
cgit v0.12


From 7bc00632dde1b718cbe1412e988ad006dc3d125f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= <bjorn.nilsen@nokia.com>
Date: Thu, 24 Jun 2010 15:11:05 +0200
Subject: Add a new (internal) flag
 QGraphicsItem::ItemStopsClickFocusPropagation.

This flag allows you to create a non-focusable item that can be clicked
on without changing the focus. This is also possible to achieve by
using focus scopes / panels, however the implementation is then way
more complex. Thew new flag is tailored for simple uses cases where
you simply want to stop the propagation and nothing more.

Auto test included.

Task-number: QT-3499
Reviewed-by: yoann
---
 src/gui/graphicsview/qgraphicsitem.cpp         |  8 ++++
 src/gui/graphicsview/qgraphicsitem.h           |  3 +-
 src/gui/graphicsview/qgraphicsitem_p.h         |  6 +--
 src/gui/graphicsview/qgraphicsscene.cpp        |  2 +
 tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 54 ++++++++++++++++++++++++++
 5 files changed, 69 insertions(+), 4 deletions(-)

diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 2de3638..61285d2 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -411,6 +411,11 @@
     these notifications are disabled by default. You must enable this flag
     to receive notifications for scene position changes. This flag was
     introduced in Qt 4.6.
+
+    \omitvalue ItemStopsClickFocusPropagation \omit The item stops propagating
+    click focus to items underneath when being clicked on. This flag
+    allows you create a non-focusable item that can be clicked on without
+    changing the focus. \endomit
 */
 
 /*!
@@ -11432,6 +11437,9 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag)
     case QGraphicsItem::ItemSendsScenePositionChanges:
         str = "ItemSendsScenePositionChanges";
         break;
+    case QGraphicsItem::ItemStopsClickFocusPropagation:
+        str = "ItemStopsClickFocusPropagation";
+        break;
     }
     debug << str;
     return debug;
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index d7d5332..3c193cd 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -106,7 +106,8 @@ public:
         ItemNegativeZStacksBehindParent = 0x2000,
         ItemIsPanel = 0x4000,
         ItemIsFocusScope = 0x8000, // internal
-        ItemSendsScenePositionChanges = 0x10000
+        ItemSendsScenePositionChanges = 0x10000,
+        ItemStopsClickFocusPropagation = 0x20000
         // NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag.
     };
     Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag)
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index bde6e7d..f9f5d3d 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -556,7 +556,7 @@ public:
     quint32 dirtyChildrenBoundingRect : 1;
 
     // Packed 32 bits
-    quint32 flags : 17;
+    quint32 flags : 18;
     quint32 paintedViewBoundingRectsNeedRepaint : 1;
     quint32 dirtySceneTransform : 1;
     quint32 geometryChanged : 1;
@@ -571,9 +571,9 @@ public:
     quint32 notifyBoundingRectChanged : 1;
     quint32 notifyInvalidated : 1;
     quint32 mouseSetsFocus : 1;
-    quint32 explicitActivate : 1;
 
     // New 32 bits
+    quint32 explicitActivate : 1;
     quint32 wantsActive : 1;
     quint32 holesInSiblingIndex : 1;
     quint32 sequentialOrdering : 1;
@@ -582,7 +582,7 @@ public:
     quint32 pendingPolish : 1;
     quint32 mayHaveChildWithGraphicsEffect : 1;
     quint32 isDeclarativeItem : 1;
-    quint32 padding : 24;
+    quint32 padding : 23;
 
     // Optional stacking order
     int globalStackingOrder;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index ca3b56f..d04074a 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1336,6 +1336,8 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou
                 break;
             }
         }
+        if (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation)
+            break;
         if (item->isPanel())
             break;
     }
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index fe68c8e..31a6845 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -442,6 +442,7 @@ private slots:
     void updateMicroFocus();
     void textItem_shortcuts();
     void scroll();
+    void stopClickFocusPropagation();
 
     // task specific tests below me
     void task141694_textItemEnsureVisible();
@@ -10268,6 +10269,59 @@ void tst_QGraphicsItem::scroll()
     QCOMPARE(item2->lastExposedRect, expectedItem2Expose);
 }
 
+void tst_QGraphicsItem::stopClickFocusPropagation()
+{
+    class MyItem : public QGraphicsRectItem
+    {
+    public:
+        MyItem() : QGraphicsRectItem(0, 0, 100, 100) {}
+        void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+        {
+            painter->fillRect(boundingRect(), hasFocus() ? QBrush(Qt::red) : brush());
+        }
+    };
+
+    QGraphicsScene scene(-50, -50, 400, 400);
+    scene.setStickyFocus(true);
+
+    QGraphicsRectItem *noFocusOnTop = new MyItem;
+    noFocusOnTop->setBrush(Qt::yellow);
+    noFocusOnTop->setFlag(QGraphicsItem::ItemStopsClickFocusPropagation);
+
+    QGraphicsRectItem *focusableUnder = new MyItem;
+    focusableUnder->setBrush(Qt::blue);
+    focusableUnder->setFlag(QGraphicsItem::ItemIsFocusable);
+    focusableUnder->setPos(50, 50);
+
+    QGraphicsRectItem *itemWithFocus = new MyItem;
+    itemWithFocus->setBrush(Qt::black);
+    itemWithFocus->setFlag(QGraphicsItem::ItemIsFocusable);
+    itemWithFocus->setPos(250, 10);
+
+    scene.addItem(noFocusOnTop);
+    scene.addItem(focusableUnder);
+    scene.addItem(itemWithFocus);
+    focusableUnder->stackBefore(noFocusOnTop);
+    itemWithFocus->setFocus();
+
+    QGraphicsView view(&scene);
+    view.show();
+    QTest::qWaitForWindowShown(&view);
+
+    QApplication::setActiveWindow(&view);
+    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+    QVERIFY(itemWithFocus->hasFocus());
+
+    QPointF mousePressPoint = noFocusOnTop->mapToScene(QPointF());
+    mousePressPoint.rx() += 60;
+    mousePressPoint.ry() += 60;
+    const QList<QGraphicsItem *> itemsAtMousePressPosition = scene.items(mousePressPoint);
+    QVERIFY(itemsAtMousePressPosition.contains(focusableUnder));
+
+    sendMousePress(&scene, mousePressPoint);
+    QVERIFY(itemWithFocus->hasFocus());
+}
+
 void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor()
 {
     struct Item : public QGraphicsTextItem
-- 
cgit v0.12


From 8d88f35f5f5c06277e2a54b6aea48b7f3e2e1c51 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Thu, 24 Jun 2010 16:23:16 +0200
Subject: Fixed incorrect parsing of TARGET.EPOCHEAPSIZE.

RevBy:    Trust me
---
 mkspecs/features/symbian/symbian_building.prf | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index bdab8d5..08ab3e7 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -10,6 +10,8 @@
 
 isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000
 isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+epoc_heap_size = $$split(TARGET.EPOCHEAPSIZE, " ")
+epoc_heap_size = $$join(epoc_heap_size, ",")
 
 symbianObjdir=$$OBJECTS_DIR
 isEmpty(symbianObjdir) {
@@ -118,7 +120,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
                       --dso=$${symbianDestdir}/$${TARGET}.dso \
                       --defoutput=$$symbianObjdir/$${TARGET}.def \
                       --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
-                      --heap=$$join(TARGET.EPOCHEAPSIZE, ",") \
+                      --heap=$$epoc_heap_size \
                       --stack=$$TARGET.EPOCSTACKSIZE \
                       $$elf2e32_LIBPATH \
                       $$capability \
@@ -164,7 +166,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
                       --elfinput=$${symbianDestdir}/$${TARGET}.sym \
                       --output=$${symbianDestdir}/$${TARGET}.exe \
                       --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
-                      --heap=$$join(TARGET.EPOCHEAPSIZE, ",") \
+                      --heap=$$epoc_heap_size \
                       --stack=$$TARGET.EPOCSTACKSIZE \
                       $$elf2e32_LIBPATH \
                       $$capability \
-- 
cgit v0.12


From 72acc2eac69a5f58f8d99c25cb58f0afaebec7a4 Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Date: Thu, 24 Jun 2010 13:38:49 +0200
Subject: qmake: Fix CONFIG += exceptions_off with the MSVC project generator,
 take 2.

The previous patch caused the pch header to be compiled without exception
handling since the compilertool for the pch compilation do not get
its options filled from the compiler flags.

This patch instead set the value to off before calling parseOptions.
This also reverts commit 73fa311f67b21c9b897de0196d3b8227f27d828f.

Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
---
 qmake/generators/win32/msbuild_objectmodel.cpp | 1 -
 qmake/generators/win32/msvc_objectmodel.cpp    | 7 ++-----
 qmake/generators/win32/msvc_vcproj.cpp         | 1 +
 qmake/generators/win32/msvc_vcxproj.cpp        | 1 +
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index bf874b2..75fc910 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -385,7 +385,6 @@ VCXCLCompilerTool::VCXCLCompilerTool()
         DisableLanguageExtensions(unset),
         EnableFiberSafeOptimizations(unset),
         EnablePREfast(unset),
-        ExceptionHandling("false"),
         ExpandAttributedSource(unset),
         FloatingPointExceptions(unset),
         ForceConformanceInForLoopScope(unset),
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index e23e119..1e060a0 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -360,11 +360,8 @@ inline XmlOutput::xml_output xformUsePrecompiledHeaderForNET2005(pchOption whatP
 
 inline XmlOutput::xml_output xformExceptionHandlingNET2005(exceptionHandling eh, DotNET compilerVersion)
 {
-    if (eh == ehDefault) {
-        if (compilerVersion >= NET2005)
-            return attrE(_ExceptionHandling, ehNone);
-        return attrS(_ExceptionHandling, "false");
-    }
+    if (eh == ehDefault)
+        return noxml();
 
     if (compilerVersion >= NET2005)
         return attrE(_ExceptionHandling, eh);
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 35e4896..8686ae8 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -900,6 +900,7 @@ void VcprojGenerator::initCompilerTool()
     conf.compiler.AssemblerListingLocation = placement ;
     conf.compiler.ProgramDataBaseFileName = ".\\" ;
     conf.compiler.ObjectFile = placement ;
+    conf.compiler.ExceptionHandling = ehNone;
     // PCH
     if (usePCH) {
         conf.compiler.UsePrecompiledHeader     = pchUseUsingSpecific;
diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp
index 05c1511..f68a435 100644
--- a/qmake/generators/win32/msvc_vcxproj.cpp
+++ b/qmake/generators/win32/msvc_vcxproj.cpp
@@ -274,6 +274,7 @@ void VcxprojGenerator::initCompilerTool()
     conf.compiler.AssemblerListingLocation = placement ;
     conf.compiler.ProgramDataBaseFileName = ".\\" ;
     conf.compiler.ObjectFileName = placement ;
+    conf.compiler.ExceptionHandling = "false";
     // PCH
     if (usePCH) {
         conf.compiler.PrecompiledHeader             = "Use";
-- 
cgit v0.12


From a91f8d704c3ff3826f0ea8b7e73fc6d91dd5b836 Mon Sep 17 00:00:00 2001
From: Kent Hansen <kent.hansen@nokia.com>
Date: Wed, 23 Jun 2010 17:22:47 +0200
Subject: Use custom static scopes to improve QML/JavaScript performance

This commit introduces a new internal JS object type,
QScriptStaticScopeObject, that enables the JS compiler to make
more aggressive optimizations of scoped property access.

QScriptStaticScopeObject registers all its properties in a
symbol table that the JS compiler has access to. If the compiler
finds the property in the symbol table, it will generate the
fast index-based op_{get,put}_scoped_var bytecodes, rather than
the dynamic (slow) op_resolve and friends.

If the compiler _doesn't_ find the property in the symbol table,
it infers that it's safe to skip the scope object when later
resolving the property, which will also improve performance
(see op_resolve_skip bytecode).

QScriptStaticScopeObject is only safe to use when all relevant
properties are known at JS compile time; that is, when a
function that has the static scope object in its scope chain is
compiled.
It's up to the user of the class (e.g. QtDeclarative) to ensure
that this constraint is not violated.

The API for constructing QScriptStaticScopeObject instances is
not public; it lives in QScriptDeclarativeClass for now, an
internal class exported for the purpose of QML. The instance is
returned as a QScriptValue and can be manipulated like any
other JS object (e.g. by QScriptValue::setProperty()).

The other part of this commit utilizes QScriptStaticScopeObject
in QtDeclarative in the two major places where it's currently
possible:

1) QML disallows adding properties to the Global Object.
Furthermore, it's not possible for QML IDs and properties to
"shadow" global variables. Hence, a QScriptStaticScopeObject
can be used to hold all the standard ECMA properties, and this
scope object can come _before_ the QML component in the scope
chain. This enables binding expressions and scripts to have
optimized (direct) access to e.g. Math.sin.

2) Imported scripts can have their properties (resulting from
variable declarations ("var" statements) and function
declarations) added to a static scope object. This enables
functions in the script to have optimized (direct) access to
the script's own properties, as well as to global properties
such as Math.

With this change, it's no longer possible to delete properties
of the Global Object, nor delete properties of an imported
script. It's a compromise we make in order to make the
optimization safe.

Task-number: QTBUG-8576
Reviewed-by: Aaron Kennedy
Reviewed-by: Olivier Goffart
Reviewed-by: Jedrzej Nowacki
---
 src/declarative/qml/qdeclarativecontext.cpp        |  12 +-
 src/declarative/qml/qdeclarativeexpression.cpp     |   8 +-
 .../qml/qdeclarativeglobalscriptclass.cpp          |  39 ++--
 .../qml/qdeclarativeglobalscriptclass_p.h          |   4 +-
 src/declarative/qml/qdeclarativeinclude.cpp        |   2 +-
 src/script/api/qscriptengine.cpp                   |  12 +-
 src/script/api/qscriptengine_p.h                   |  15 ++
 src/script/bridge/bridge.pri                       |   2 +
 src/script/bridge/qscriptdeclarativeclass.cpp      |  36 +++
 src/script/bridge/qscriptdeclarativeclass_p.h      |   5 +
 src/script/bridge/qscriptstaticscopeobject.cpp     | 157 +++++++++++++
 src/script/bridge/qscriptstaticscopeobject_p.h     | 103 +++++++++
 tests/auto/qscriptengine/tst_qscriptengine.cpp     | 242 +++++++++++++++++++++
 .../script/qscriptengine/tst_qscriptengine.cpp     |  52 +++++
 14 files changed, 652 insertions(+), 37 deletions(-)
 create mode 100644 src/script/bridge/qscriptstaticscopeobject.cpp
 create mode 100644 src/script/bridge/qscriptstaticscopeobject_p.h

diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index 2221d78..60e9dd3 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -660,10 +660,9 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
             QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
 
             scriptContext->pushScope(enginePriv->contextClass->newUrlContext(url));
-            scriptContext->pushScope(enginePriv->globalClass->globalObject());
+            scriptContext->pushScope(enginePriv->globalClass->staticGlobalObject());
         
-            QScriptValue scope = scriptEngine->newObject();
-            scriptContext->setActivationObject(scope);
+            QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(scriptEngine);
             scriptContext->pushScope(scope);
 
             scriptEngine->evaluate(code, url, 1);
@@ -686,10 +685,9 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
         QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
 
         scriptContext->pushScope(enginePriv->contextClass->newUrlContext(this, 0, url));
-        scriptContext->pushScope(enginePriv->globalClass->globalObject());
-        
-        QScriptValue scope = scriptEngine->newObject();
-        scriptContext->setActivationObject(scope);
+        scriptContext->pushScope(enginePriv->globalClass->staticGlobalObject());
+
+        QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(scriptEngine);
         scriptContext->pushScope(scope);
 
         scriptEngine->evaluate(code, url, 1);
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index b1aecfa..8ae5f2f 100644
--- a/src/declarative/qml/qdeclarativeexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -145,7 +145,7 @@ void QDeclarativeExpressionPrivate::init(QDeclarativeContextData *ctxt, void *ex
         if (!dd->cachedClosures.at(progIdx)) {
             QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
             scriptContext->pushScope(ep->contextClass->newSharedContext());
-            scriptContext->pushScope(ep->globalClass->globalObject());
+            scriptContext->pushScope(ep->globalClass->staticGlobalObject());
             dd->cachedClosures[progIdx] = new QScriptValue(scriptEngine->evaluate(data->expression, data->url, data->line));
             scriptEngine->popContext();
         }
@@ -188,7 +188,7 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
     } else {
         scriptContext->pushScope(ep->contextClass->newContext(context, object));
     }
-    scriptContext->pushScope(ep->globalClass->globalObject());
+    scriptContext->pushScope(ep->globalClass->staticGlobalObject());
     QScriptValue rv = ep->scriptEngine.evaluate(program, fileName, lineNumber);
     ep->scriptEngine.popContext();
     return rv;
@@ -206,7 +206,7 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
     } else {
         scriptContext->pushScope(ep->contextClass->newContext(context, object));
     }
-    scriptContext->pushScope(ep->globalClass->globalObject());
+    scriptContext->pushScope(ep->globalClass->staticGlobalObject());
     QScriptValue rv = ep->scriptEngine.evaluate(program);
     ep->scriptEngine.popContext();
     return rv;
@@ -369,7 +369,7 @@ QScriptValue QDeclarativeExpressionPrivate::eval(QObject *secondaryScope, bool *
         QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
         data->expressionContext = ep->contextClass->newContext(data->context(), data->me);
         scriptContext->pushScope(data->expressionContext);
-        scriptContext->pushScope(ep->globalClass->globalObject());
+        scriptContext->pushScope(ep->globalClass->staticGlobalObject());
 
         if (data->expressionRewritten) {
             data->expressionFunction = scriptEngine->evaluate(data->expression, 
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
index 6e107fb..39ea101 100644
--- a/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass.cpp
@@ -41,10 +41,13 @@
 
 #include "private/qdeclarativeglobalscriptclass_p.h"
 
+#include <QtCore/qvector.h>
 #include <QtScript/qscriptstring.h>
 #include <QtScript/qscriptengine.h>
 #include <QtScript/qscriptvalueiterator.h>
 
+#include <private/qscriptdeclarativeclass_p.h>
+
 QT_BEGIN_NAMESPACE
 
 /*
@@ -55,23 +58,31 @@ QDeclarativeGlobalScriptClass::QDeclarativeGlobalScriptClass(QScriptEngine *engi
 {
     QString eval = QLatin1String("eval");
 
-    QScriptValue globalObject = engine->globalObject();
+    QScriptValue originalGlobalObject = engine->globalObject();
 
-    m_globalObject = engine->newObject();
     QScriptValue newGlobalObject = engine->newObject();
 
-    QScriptValueIterator iter(globalObject);
-
-    while (iter.hasNext()) {
-        iter.next();
-
-        QString name = iter.name();
-
-        if (name != eval)
-            m_globalObject.setProperty(iter.scriptName(), iter.value());
-        newGlobalObject.setProperty(iter.scriptName(), iter.value());
-
-        m_illegalNames.insert(name);
+    {
+        QScriptValueIterator iter(originalGlobalObject);
+        QVector<QString> names;
+        QVector<QScriptValue> values;
+        QVector<QScriptValue::PropertyFlags> flags;
+        while (iter.hasNext()) {
+            iter.next();
+
+            QString name = iter.name();
+
+            if (name != eval) {
+                names.append(name);
+                values.append(iter.value());
+                flags.append(iter.flags() | QScriptValue::Undeletable);
+            }
+            newGlobalObject.setProperty(iter.scriptName(), iter.value());
+
+            m_illegalNames.insert(name);
+        }
+        m_staticGlobalObject = QScriptDeclarativeClass::newStaticScopeObject(
+            engine, names.size(), names.constData(), values.constData(), flags.constData());
     }
 
     newGlobalObject.setScriptClass(this);
diff --git a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
index 7690edd..414bf02 100644
--- a/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
+++ b/src/declarative/qml/qdeclarativeglobalscriptclass_p.h
@@ -75,13 +75,13 @@ public:
 
     void explicitSetProperty(const QString &, const QScriptValue &);
 
-    const QScriptValue &globalObject() const { return m_globalObject; }
+    const QScriptValue &staticGlobalObject() const { return m_staticGlobalObject; }
 
     const QSet<QString> &illegalNames() const { return m_illegalNames; }
 
 private:
     QSet<QString> m_illegalNames;
-    QScriptValue m_globalObject;
+    QScriptValue m_staticGlobalObject;
 };
 
 QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeinclude.cpp b/src/declarative/qml/qdeclarativeinclude.cpp
index c29005a..f26b54f 100644
--- a/src/declarative/qml/qdeclarativeinclude.cpp
+++ b/src/declarative/qml/qdeclarativeinclude.cpp
@@ -240,7 +240,7 @@ QScriptValue QDeclarativeInclude::include(QScriptContext *ctxt, QScriptEngine *e
 
             QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(engine);
             scriptContext->pushScope(ep->contextClass->newUrlContext(context, 0, urlString));
-            scriptContext->pushScope(ep->globalClass->globalObject());
+            scriptContext->pushScope(ep->globalClass->staticGlobalObject());
             QScriptValue scope = QScriptDeclarativeClass::scopeChainValue(ctxt, -5);
             scriptContext->pushScope(scope);
             scriptContext->setActivationObject(scope);
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index e2999c1..655026c 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -64,6 +64,7 @@
 #include "bridge/qscriptqobject_p.h"
 #include "bridge/qscriptglobalobject_p.h"
 #include "bridge/qscriptactivationobject_p.h"
+#include "bridge/qscriptstaticscopeobject_p.h"
 
 #ifndef QT_NO_QOBJECT
 #include <QtCore/qcoreapplication.h>
@@ -905,6 +906,7 @@ QScriptEnginePrivate::QScriptEnginePrivate()
     JSC::ExecState* exec = globalObject->globalExec();
 
     scriptObjectStructure = QScriptObject::createStructure(globalObject->objectPrototype());
+    staticScopeObjectStructure = QScriptStaticScopeObject::createStructure(JSC::jsNull());
 
     qobjectPrototype = new (exec) QScript::QObjectPrototype(exec, QScript::QObjectPrototype::createStructure(globalObject->objectPrototype()), globalObject->prototypeFunctionStructure());
     qobjectWrapperObjectStructure = QScriptObject::createStructure(qobjectPrototype);
@@ -1770,15 +1772,7 @@ void QScriptEnginePrivate::setProperty(JSC::ExecState *exec, JSC::JSValue object
         } else if (flags != QScriptValue::KeepExistingFlags) {
             if (thisObject->hasOwnProperty(exec, id))
                 thisObject->deleteProperty(exec, id); // ### hmmm - can't we just update the attributes?
-            unsigned attribs = 0;
-            if (flags & QScriptValue::ReadOnly)
-                attribs |= JSC::ReadOnly;
-            if (flags & QScriptValue::SkipInEnumeration)
-                attribs |= JSC::DontEnum;
-            if (flags & QScriptValue::Undeletable)
-                attribs |= JSC::DontDelete;
-            attribs |= flags & QScriptValue::UserRange;
-            thisObject->putWithAttributes(exec, id, value, attribs);
+            thisObject->putWithAttributes(exec, id, value, propertyFlagsToJSCAttributes(flags));
         } else {
             JSC::PutPropertySlot slot;
             thisObject->put(exec, id, value, slot);
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 56366e2..1b35704 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -205,6 +205,7 @@ public:
 
     inline QScriptValue scriptValueFromJSCValue(JSC::JSValue value);
     inline JSC::JSValue scriptValueToJSCValue(const QScriptValue &value);
+    static inline unsigned propertyFlagsToJSCAttributes(const QScriptValue::PropertyFlags &flags);
 
     static inline JSC::JSValue jscValueFromVariant(JSC::ExecState*, const QVariant &value);
     static QVariant jscValueToVariant(JSC::ExecState*, JSC::JSValue value, int targetType);
@@ -346,6 +347,7 @@ public:
     JSC::ExecState *currentFrame;
 
     WTF::RefPtr<JSC::Structure> scriptObjectStructure;
+    WTF::RefPtr<JSC::Structure> staticScopeObjectStructure;
 
     QScript::QObjectPrototype *qobjectPrototype;
     WTF::RefPtr<JSC::Structure> qobjectWrapperObjectStructure;
@@ -639,6 +641,19 @@ inline JSC::JSValue QScriptEnginePrivate::scriptValueToJSCValue(const QScriptVal
     return vv->jscValue;
 }
 
+inline unsigned QScriptEnginePrivate::propertyFlagsToJSCAttributes(const QScriptValue::PropertyFlags &flags)
+{
+    unsigned attribs = 0;
+    if (flags & QScriptValue::ReadOnly)
+        attribs |= JSC::ReadOnly;
+    if (flags & QScriptValue::SkipInEnumeration)
+        attribs |= JSC::DontEnum;
+    if (flags & QScriptValue::Undeletable)
+        attribs |= JSC::DontDelete;
+    attribs |= flags & QScriptValue::UserRange;
+    return attribs;
+}
+
 inline QScriptValuePrivate::~QScriptValuePrivate()
 {
     if (engine)
diff --git a/src/script/bridge/bridge.pri b/src/script/bridge/bridge.pri
index 09e2dfb..ab0a322 100644
--- a/src/script/bridge/bridge.pri
+++ b/src/script/bridge/bridge.pri
@@ -6,6 +6,7 @@ SOURCES += \
     $$PWD/qscriptqobject.cpp \
     $$PWD/qscriptglobalobject.cpp \
     $$PWD/qscriptactivationobject.cpp \
+    $$PWD/qscriptstaticscopeobject.cpp \
     $$PWD/qscriptdeclarativeobject.cpp \
     $$PWD/qscriptdeclarativeclass.cpp 
 
@@ -17,5 +18,6 @@ HEADERS += \
     $$PWD/qscriptqobject_p.h \
     $$PWD/qscriptglobalobject_p.h \
     $$PWD/qscriptactivationobject_p.h \
+    $$PWD/qscriptstaticscopeobject_p.h \
     $$PWD/qscriptdeclarativeobject_p.h \
     $$PWD/qscriptdeclarativeclass_p.h
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp
index 1093448..8080b9f 100644
--- a/src/script/bridge/qscriptdeclarativeclass.cpp
+++ b/src/script/bridge/qscriptdeclarativeclass.cpp
@@ -24,6 +24,7 @@
 #include "qscriptdeclarativeclass_p.h"
 #include "qscriptdeclarativeobject_p.h"
 #include "qscriptobject_p.h"
+#include "qscriptstaticscopeobject_p.h"
 #include <QtScript/qscriptstring.h>
 #include <QtScript/qscriptengine.h>
 #include <QtScript/qscriptengineagent.h>
@@ -549,4 +550,39 @@ QScriptContext *QScriptDeclarativeClass::context() const
     return d_ptr->context;
 }
 
+/*!
+  Creates a scope object with a fixed set of undeletable properties.
+*/
+QScriptValue QScriptDeclarativeClass::newStaticScopeObject(
+    QScriptEngine *engine, int propertyCount, const QString *names,
+    const QScriptValue *values, const QScriptValue::PropertyFlags *flags)
+{
+    QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
+    QScript::APIShim shim(eng_p);
+    JSC::ExecState *exec = eng_p->currentFrame;
+    QScriptStaticScopeObject::PropertyInfo *props = new QScriptStaticScopeObject::PropertyInfo[propertyCount];
+    for (int i = 0; i < propertyCount; ++i) {
+        unsigned attribs = QScriptEnginePrivate::propertyFlagsToJSCAttributes(flags[i]);
+        Q_ASSERT_X(attribs & JSC::DontDelete, Q_FUNC_INFO, "All properties must be undeletable");
+        JSC::Identifier id = JSC::Identifier(exec, names[i]);
+        JSC::JSValue jsval = eng_p->scriptValueToJSCValue(values[i]);
+        props[i] = QScriptStaticScopeObject::PropertyInfo(id, jsval, attribs);
+    }
+    QScriptValue result = eng_p->scriptValueFromJSCValue(new (exec)QScriptStaticScopeObject(eng_p->staticScopeObjectStructure,
+                                                                                            propertyCount, props));
+    delete[] props;
+    return result;
+}
+
+/*!
+  Creates a static scope object that's initially empty, but to which new
+  properties can be added.
+*/
+QScriptValue QScriptDeclarativeClass::newStaticScopeObject(QScriptEngine *engine)
+{
+    QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
+    QScript::APIShim shim(eng_p);
+    return eng_p->scriptValueFromJSCValue(new (eng_p->currentFrame)QScriptStaticScopeObject(eng_p->staticScopeObjectStructure));
+}
+
 QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h
index 714a67c..420b133 100644
--- a/src/script/bridge/qscriptdeclarativeclass_p.h
+++ b/src/script/bridge/qscriptdeclarativeclass_p.h
@@ -92,6 +92,11 @@ public:
     static QScriptValue scopeChainValue(QScriptContext *, int index);
     static QScriptContext *pushCleanContext(QScriptEngine *);
 
+    static QScriptValue newStaticScopeObject(
+        QScriptEngine *, int propertyCount, const QString *names,
+       const QScriptValue *values, const QScriptValue::PropertyFlags *flags);
+    static QScriptValue newStaticScopeObject(QScriptEngine *);
+
     class Q_SCRIPT_EXPORT PersistentIdentifier 
     {
     public:
diff --git a/src/script/bridge/qscriptstaticscopeobject.cpp b/src/script/bridge/qscriptstaticscopeobject.cpp
new file mode 100644
index 0000000..44548a4
--- /dev/null
+++ b/src/script/bridge/qscriptstaticscopeobject.cpp
@@ -0,0 +1,157 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL-ONLY$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "config.h"
+#include "qscriptstaticscopeobject_p.h"
+
+namespace JSC
+{
+    ASSERT_CLASS_FITS_IN_CELL(QT_PREPEND_NAMESPACE(QScriptStaticScopeObject));
+}
+
+QT_BEGIN_NAMESPACE
+
+/*!
+  \class QScriptStaticScopeObject
+  \internal
+
+    Represents a static scope object.
+
+    This class allows the VM to determine at JS script compile time whether
+    the object has a given property or not. If the object has the property,
+    a fast, index-based read/write operation will be used. If the object
+    doesn't have the property, the compiler knows it can safely skip this
+    object when dynamically resolving the property. Either way, this can
+    greatly improve performance.
+
+  \sa QScriptContext::pushScope()
+*/
+
+const JSC::ClassInfo QScriptStaticScopeObject::info = { "QScriptStaticScopeObject", 0, 0, 0 };
+
+/*!
+    Creates a static scope object with a fixed set of undeletable properties.
+
+    It's not possible to add new properties to the object after construction.
+*/
+QScriptStaticScopeObject::QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure,
+                                                   int propertyCount, const PropertyInfo* props)
+    : JSC::JSVariableObject(structure, new Data(/*canGrow=*/false))
+{
+    int index = growRegisterArray(propertyCount);
+    for (int i = 0; i < propertyCount; ++i, --index) {
+        const PropertyInfo& prop = props[i];
+        JSC::SymbolTableEntry entry(index, prop.attributes);
+        symbolTable().add(prop.identifier.ustring().rep(), entry);
+        registerAt(index) = prop.value;
+    }
+}
+
+/*!
+    Creates an empty static scope object.
+
+    Properties can be added to the object after construction, either by
+    calling QScriptValue::setProperty(), or by pushing the object on the
+    scope chain; variable declarations ("var" statements) and function
+    declarations in JavaScript will create properties on the scope object.
+
+    Note that once the scope object has been used in a closure and the
+    resulting function has been compiled, it's no longer safe to add
+    properties to the scope object (because the VM will bypass this
+    object the next time the function is executed).
+*/
+QScriptStaticScopeObject::QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure)
+    : JSC::JSVariableObject(structure, new Data(/*canGrow=*/true))
+{
+}
+
+QScriptStaticScopeObject::~QScriptStaticScopeObject()
+{
+    delete d;
+}
+
+bool QScriptStaticScopeObject::getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot& slot)
+{
+    return symbolTableGet(propertyName, slot);
+}
+
+bool QScriptStaticScopeObject::getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor)
+{
+    return symbolTableGet(propertyName, descriptor);
+}
+
+void QScriptStaticScopeObject::putWithAttributes(JSC::ExecState* exec, const JSC::Identifier &propertyName, JSC::JSValue value, unsigned attributes)
+{
+    if (symbolTablePutWithAttributes(propertyName, value, attributes))
+        return;
+    Q_ASSERT(d_ptr()->canGrow);
+    addSymbolTableProperty(propertyName, value, attributes);
+}
+
+void QScriptStaticScopeObject::put(JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::JSValue value, JSC::PutPropertySlot&)
+{
+    if (symbolTablePut(propertyName, value))
+        return;
+    Q_ASSERT(d_ptr()->canGrow);
+    addSymbolTableProperty(propertyName, value, /*attributes=*/0);
+}
+
+bool QScriptStaticScopeObject::deleteProperty(JSC::ExecState*, const JSC::Identifier&)
+{
+    return false;
+}
+
+void QScriptStaticScopeObject::markChildren(JSC::MarkStack& markStack)
+{
+    JSC::Register* registerArray = d_ptr()->registerArray.get();
+    if (!registerArray)
+        return;
+    markStack.appendValues(reinterpret_cast<JSC::JSValue*>(registerArray), d_ptr()->registerArraySize);
+}
+
+void QScriptStaticScopeObject::addSymbolTableProperty(const JSC::Identifier& name, JSC::JSValue value, unsigned attributes)
+{
+    int index = growRegisterArray(1);
+    JSC::SymbolTableEntry newEntry(index, attributes | JSC::DontDelete);
+    symbolTable().add(name.ustring().rep(), newEntry);
+    registerAt(index) = value;
+}
+
+/*!
+  Grows the register array by \a count elements, and returns the offset of
+  the newly added elements (note that the register file grows downwards,
+  starting at index -1).
+*/
+int QScriptStaticScopeObject::growRegisterArray(int count)
+{
+    size_t oldSize = d_ptr()->registerArraySize;
+    size_t newSize = oldSize + count;
+    JSC::Register* registerArray = new JSC::Register[newSize];
+    if (d_ptr()->registerArray)
+        memcpy(registerArray + count, d_ptr()->registerArray.get(), oldSize * sizeof(JSC::Register));
+    setRegisters(registerArray + newSize, registerArray);
+    d_ptr()->registerArraySize = newSize;
+    return -oldSize - 1;
+}
+
+QT_END_NAMESPACE
diff --git a/src/script/bridge/qscriptstaticscopeobject_p.h b/src/script/bridge/qscriptstaticscopeobject_p.h
new file mode 100644
index 0000000..0a0e7ef
--- /dev/null
+++ b/src/script/bridge/qscriptstaticscopeobject_p.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtScript module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL-ONLY$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSCRIPTSTATICSCOPEOBJECT_P_H
+#define QSCRIPTSTATICSCOPEOBJECT_P_H
+
+//
+//  W A R N I N G
+//  -------------
+//
+// This file is not part of the Qt API.  It exists purely as an
+// implementation detail.  This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobjectdefs.h>
+
+#include "JSVariableObject.h"
+
+QT_BEGIN_NAMESPACE
+
+class QScriptStaticScopeObject : public JSC::JSVariableObject {
+public:
+    struct PropertyInfo {
+        PropertyInfo(const JSC::Identifier& i, JSC::JSValue v, unsigned a)
+            : identifier(i), value(v), attributes(a)
+            { }
+        PropertyInfo() {}
+
+        JSC::Identifier identifier;
+        JSC::JSValue value;
+        unsigned attributes;
+    };
+
+    QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure,
+                            int propertyCount, const PropertyInfo*);
+    QScriptStaticScopeObject(WTF::NonNullPassRefPtr<JSC::Structure> structure);
+    virtual ~QScriptStaticScopeObject();
+
+    virtual bool isDynamicScope() const { return false; }
+
+    virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
+    virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
+
+    virtual void putWithAttributes(JSC::ExecState *exec, const JSC::Identifier &propertyName, JSC::JSValue value, unsigned attributes);
+    virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue value, JSC::PutPropertySlot&);
+
+    virtual bool deleteProperty(JSC::ExecState*, const JSC::Identifier& propertyName);
+
+    virtual void markChildren(JSC::MarkStack&);
+
+    virtual const JSC::ClassInfo* classInfo() const { return &info; }
+    static const JSC::ClassInfo info;
+
+    static WTF::PassRefPtr<JSC::Structure> createStructure(JSC::JSValue proto) {
+        return JSC::Structure::create(proto, JSC::TypeInfo(JSC::ObjectType, StructureFlags));
+    }
+
+protected:
+    static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::NeedsThisConversion | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | JSC::JSVariableObject::StructureFlags;
+
+    struct Data : public JSVariableObjectData {
+        Data(bool canGrow_)
+            : JSVariableObjectData(&symbolTable, /*registers=*/0),
+            canGrow(canGrow_), registerArraySize(0)
+        { }
+        bool canGrow;
+        int registerArraySize;
+        JSC::SymbolTable symbolTable;
+    };
+
+    Data* d_ptr() const { return static_cast<Data*>(JSVariableObject::d); }
+
+private:
+    void addSymbolTableProperty(const JSC::Identifier&, JSC::JSValue, unsigned attributes);
+    int growRegisterArray(int);
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 5e59950..6885adf 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -51,6 +51,8 @@
 #include <QtCore/qnumeric.h>
 #include <stdlib.h>
 
+#include <QtScript/private/qscriptdeclarativeclass_p.h>
+
 Q_DECLARE_METATYPE(QList<int>)
 Q_DECLARE_METATYPE(QObjectList)
 Q_DECLARE_METATYPE(QScriptProgram)
@@ -169,6 +171,8 @@ private slots:
     void qRegExpInport_data();
     void qRegExpInport();
     void reentrency();
+    void newFixedStaticScopeObject();
+    void newGrowingStaticScopeObject();
 };
 
 tst_QScriptEngine::tst_QScriptEngine()
@@ -4955,5 +4959,243 @@ void tst_QScriptEngine::reentrency()
     QCOMPARE(eng.evaluate("foo() + hello").toInt32(), 5+6+9);
 }
 
+void tst_QScriptEngine::newFixedStaticScopeObject()
+{
+    QScriptEngine eng;
+    static const int propertyCount = 4;
+    QString names[] = { "foo", "bar", "baz", "Math" };
+    QScriptValue values[] = { 123, "ciao", true, false };
+    QScriptValue::PropertyFlags flags[] = { QScriptValue::Undeletable,
+                                            QScriptValue::ReadOnly | QScriptValue::Undeletable,
+                                            QScriptValue::SkipInEnumeration | QScriptValue::Undeletable,
+                                            QScriptValue::Undeletable };
+    QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(&eng, propertyCount, names, values, flags);
+
+    // Query property.
+    for (int i = 0; i < propertyCount; ++i) {
+        for (int x = 0; x < 2; ++x) {
+            if (x) {
+                // Properties can't be deleted.
+                scope.setProperty(names[i], QScriptValue());
+            }
+            QVERIFY(scope.property(names[i]).equals(values[i]));
+            QCOMPARE(scope.propertyFlags(names[i]), flags[i]);
+        }
+    }
+
+    // Property that doesn't exist.
+    QVERIFY(!scope.property("noSuchProperty").isValid());
+    QCOMPARE(scope.propertyFlags("noSuchProperty"), QScriptValue::PropertyFlags());
+
+    // Write to writable property.
+    {
+        QScriptValue oldValue = scope.property("foo");
+        QVERIFY(oldValue.isNumber());
+        QScriptValue newValue = oldValue.toNumber() * 2;
+        scope.setProperty("foo", newValue);
+        QVERIFY(scope.property("foo").equals(newValue));
+        scope.setProperty("foo", oldValue);
+        QVERIFY(scope.property("foo").equals(oldValue));
+    }
+
+    // Write to read-only property.
+    scope.setProperty("bar", 456);
+    QVERIFY(scope.property("bar").equals("ciao"));
+
+    // Iterate.
+    {
+        QScriptValueIterator it(scope);
+        QSet<QString> iteratedNames;
+        while (it.hasNext()) {
+            it.next();
+            iteratedNames.insert(it.name());
+        }
+        for (int i = 0; i < propertyCount; ++i)
+            QVERIFY(iteratedNames.contains(names[i]));
+    }
+
+    // Push it on the scope chain of a new context.
+    QScriptContext *ctx = eng.pushContext();
+    ctx->pushScope(scope);
+    QCOMPARE(ctx->scopeChain().size(), 3); // Global Object, native activation, custom scope
+    QVERIFY(ctx->activationObject().equals(scope));
+
+    // Read property from JS.
+    for (int i = 0; i < propertyCount; ++i) {
+        for (int x = 0; x < 2; ++x) {
+            if (x) {
+                // Property can't be deleted from JS.
+                QScriptValue ret = eng.evaluate(QString::fromLatin1("delete %0").arg(names[i]));
+                QVERIFY(ret.equals(false));
+            }
+            QVERIFY(eng.evaluate(names[i]).equals(values[i]));
+        }
+    }
+
+    // Property that doesn't exist.
+    QVERIFY(eng.evaluate("noSuchProperty").equals("ReferenceError: Can't find variable: noSuchProperty"));
+
+    // Write property from JS.
+    {
+        QScriptValue oldValue = eng.evaluate("foo");
+        QVERIFY(oldValue.isNumber());
+        QScriptValue newValue = oldValue.toNumber() * 2;
+        QVERIFY(eng.evaluate("foo = foo * 2; foo").equals(newValue));
+        scope.setProperty("foo", oldValue);
+        QVERIFY(eng.evaluate("foo").equals(oldValue));
+    }
+
+    // Write to read-only property.
+    QVERIFY(eng.evaluate("bar = 456; bar").equals("ciao"));
+
+    // Create a closure and return properties from there.
+    {
+        QScriptValue props = eng.evaluate("(function() { var baz = 'shadow'; return [foo, bar, baz, Math, Array]; })()");
+        QVERIFY(props.isArray());
+        // "foo" and "bar" come from scope object.
+        QVERIFY(props.property(0).equals(scope.property("foo")));
+        QVERIFY(props.property(1).equals(scope.property("bar")));
+        // "baz" shadows property in scope object.
+        QVERIFY(props.property(2).equals("shadow"));
+        // "Math" comes from scope object, and shadows Global Object's "Math".
+        QVERIFY(props.property(3).equals(scope.property("Math")));
+        QVERIFY(!props.property(3).equals(eng.globalObject().property("Math")));
+        // "Array" comes from Global Object.
+        QVERIFY(props.property(4).equals(eng.globalObject().property("Array")));
+    }
+
+    // As with normal JS, assigning to an undefined variable will create
+    // the property on the Global Object, not the inner scope.
+    QVERIFY(!eng.globalObject().property("newProperty").isValid());
+    QVERIFY(eng.evaluate("(function() { newProperty = 789; })()").isUndefined());
+    QVERIFY(!scope.property("newProperty").isValid());
+    QVERIFY(eng.globalObject().property("newProperty").isNumber());
+
+    // Nested static scope.
+    {
+        static const int propertyCount2 = 2;
+        QString names2[] = { "foo", "hum" };
+        QScriptValue values2[] = { 321, "hello" };
+        QScriptValue::PropertyFlags flags2[] = { QScriptValue::Undeletable,
+                                                 QScriptValue::ReadOnly | QScriptValue::Undeletable };
+        QScriptValue scope2 = QScriptDeclarativeClass::newStaticScopeObject(&eng, propertyCount2, names2, values2, flags2);
+        ctx->pushScope(scope2);
+
+        // "foo" shadows scope.foo.
+        QVERIFY(eng.evaluate("foo").equals(scope2.property("foo")));
+        QVERIFY(!eng.evaluate("foo").equals(scope.property("foo")));
+        // "hum" comes from scope2.
+        QVERIFY(eng.evaluate("hum").equals(scope2.property("hum")));
+        // "Array" comes from Global Object.
+        QVERIFY(eng.evaluate("Array").equals(eng.globalObject().property("Array")));
+
+        ctx->popScope();
+    }
+
+    QScriptValue fun = eng.evaluate("(function() { return foo; })");
+    QVERIFY(fun.isFunction());
+    eng.popContext();
+    // Function's scope chain persists after popContext().
+    QVERIFY(fun.call().equals(scope.property("foo")));
+}
+
+void tst_QScriptEngine::newGrowingStaticScopeObject()
+{
+    QScriptEngine eng;
+    QScriptValue scope = QScriptDeclarativeClass::newStaticScopeObject(&eng);
+
+    // Initially empty.
+    QVERIFY(!QScriptValueIterator(scope).hasNext());
+    QVERIFY(!scope.property("foo").isValid());
+
+    // Add a static property.
+    scope.setProperty("foo", 123);
+    QVERIFY(scope.property("foo").equals(123));
+    QCOMPARE(scope.propertyFlags("foo"), QScriptValue::Undeletable);
+
+    // Modify existing property.
+    scope.setProperty("foo", 456);
+    QVERIFY(scope.property("foo").equals(456));
+
+    // Add a read-only property.
+    scope.setProperty("bar", "ciao", QScriptValue::ReadOnly);
+    QVERIFY(scope.property("bar").equals("ciao"));
+    QCOMPARE(scope.propertyFlags("bar"), QScriptValue::ReadOnly | QScriptValue::Undeletable);
+
+    // Attempt to modify read-only property.
+    scope.setProperty("bar", "hello");
+    QVERIFY(scope.property("bar").equals("ciao"));
+
+    // Properties can't be deleted.
+    scope.setProperty("foo", QScriptValue());
+    QVERIFY(scope.property("foo").equals(456));
+    scope.setProperty("bar", QScriptValue());
+    QVERIFY(scope.property("bar").equals("ciao"));
+
+    // Iterate.
+    {
+        QScriptValueIterator it(scope);
+        QSet<QString> iteratedNames;
+        while (it.hasNext()) {
+            it.next();
+            iteratedNames.insert(it.name());
+        }
+        QCOMPARE(iteratedNames.size(), 2);
+        QVERIFY(iteratedNames.contains("foo"));
+        QVERIFY(iteratedNames.contains("bar"));
+    }
+
+    // Push it on the scope chain of a new context.
+    QScriptContext *ctx = eng.pushContext();
+    ctx->pushScope(scope);
+    QCOMPARE(ctx->scopeChain().size(), 3); // Global Object, native activation, custom scope
+    QVERIFY(ctx->activationObject().equals(scope));
+
+    // Read property from JS.
+    QVERIFY(eng.evaluate("foo").equals(scope.property("foo")));
+    QVERIFY(eng.evaluate("bar").equals(scope.property("bar")));
+
+    // Write property from JS.
+    {
+        QScriptValue oldValue = eng.evaluate("foo");
+        QVERIFY(oldValue.isNumber());
+        QScriptValue newValue = oldValue.toNumber() * 2;
+        QVERIFY(eng.evaluate("foo = foo * 2; foo").equals(newValue));
+        scope.setProperty("foo", oldValue);
+        QVERIFY(eng.evaluate("foo").equals(oldValue));
+    }
+
+    // Write to read-only property.
+    QVERIFY(eng.evaluate("bar = 456; bar").equals("ciao"));
+
+    // Shadow property.
+    QVERIFY(eng.evaluate("Math").equals(eng.globalObject().property("Math")));
+    scope.setProperty("Math", "fake Math");
+    QVERIFY(eng.evaluate("Math").equals(scope.property("Math")));
+
+    // Variable declarations will create properties on the scope.
+    eng.evaluate("var baz = 456");
+    QVERIFY(scope.property("baz").equals(456));
+
+    // Function declarations will create properties on the scope.
+    eng.evaluate("function fun() { return baz; }");
+    QVERIFY(scope.property("fun").isFunction());
+    QVERIFY(scope.property("fun").call().equals(scope.property("baz")));
+
+    // Demonstrate the limitation of a growable static scope: Once a function that
+    // uses the scope has been compiled, it won't pick up properties that are added
+    // to the scope later.
+    {
+        QScriptValue fun = eng.evaluate("(function() { return futureProperty; })");
+        QVERIFY(fun.isFunction());
+        QCOMPARE(fun.call().toString(), QString::fromLatin1("ReferenceError: Can't find variable: futureProperty"));
+        scope.setProperty("futureProperty", "added after the function was compiled");
+        // If scope were dynamic, this would return the new property.
+        QCOMPARE(fun.call().toString(), QString::fromLatin1("ReferenceError: Can't find variable: futureProperty"));
+    }
+
+    eng.popContext();
+}
+
 QTEST_MAIN(tst_QScriptEngine)
 #include "tst_qscriptengine.moc"
diff --git a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
index 35e2f28..4610046 100644
--- a/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/benchmarks/script/qscriptengine/tst_qscriptengine.cpp
@@ -42,6 +42,8 @@
 #include <qtest.h>
 #include <QtScript>
 
+#include <QtScript/private/qscriptdeclarativeclass_p.h>
+
 //TESTED_FILES=
 
 class tst_QScriptEngine : public QObject
@@ -74,6 +76,8 @@ private slots:
     void nativeCall();
     void translation_data();
     void translation();
+    void readScopeProperty_data();
+    void readScopeProperty();
 };
 
 tst_QScriptEngine::tst_QScriptEngine()
@@ -288,5 +292,53 @@ void tst_QScriptEngine::translation()
     }
 }
 
+void tst_QScriptEngine::readScopeProperty_data()
+{
+    QTest::addColumn<bool>("staticScope");
+    QTest::addColumn<bool>("nestedScope");
+    QTest::newRow("single dynamic scope") << false << false;
+    QTest::newRow("single static scope") << true << false;
+    QTest::newRow("double dynamic scope") << false << true;
+    QTest::newRow("double static scope") << true << true;
+}
+
+void tst_QScriptEngine::readScopeProperty()
+{
+    QFETCH(bool, staticScope);
+    QFETCH(bool, nestedScope);
+
+    QScriptEngine engine;
+    QScriptContext *ctx = engine.pushContext();
+
+    QScriptValue scope;
+    if (staticScope)
+        scope = QScriptDeclarativeClass::newStaticScopeObject(&engine);
+    else
+        scope = engine.newObject();
+    scope.setProperty("foo", 123);
+    ctx->pushScope(scope);
+
+    if (nestedScope) {
+        QScriptValue scope2;
+        if (staticScope)
+            scope2 = QScriptDeclarativeClass::newStaticScopeObject(&engine);
+        else
+            scope2 = engine.newObject();
+        scope2.setProperty("bar", 456); // ensure a miss in inner scope
+        ctx->pushScope(scope2);
+    }
+
+    QScriptValue fun = engine.evaluate("(function() {\n"
+                                       "  for (var i = 0; i < 10000; ++i) {\n"
+                                       "    foo; foo; foo; foo; foo; foo; foo; foo;\n"
+                                       "  }\n"
+                                       "})");
+    engine.popContext();
+    QVERIFY(fun.isFunction());
+    QBENCHMARK {
+        fun.call();
+    }
+}
+
 QTEST_MAIN(tst_QScriptEngine)
 #include "tst_qscriptengine.moc"
-- 
cgit v0.12


From 3b7ae67fe2715838c32ff28694761e57e4f79537 Mon Sep 17 00:00:00 2001
From: Gunnar Sletta <gunnar.sletta@nokia.com>
Date: Fri, 25 Jun 2010 09:36:50 +0200
Subject: Fix compilation when configured with -no-xrender

Reviewed-by: Eskil
---
 src/gui/kernel/qapplication_x11.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 3664743..e4d9848 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2155,7 +2155,7 @@ void qt_init(QApplicationPrivate *priv, int,
         X11->fc_scale = fc_scale;
         for (int s = 0; s < ScreenCount(X11->display); ++s) {
             int subpixel = FC_RGBA_UNKNOWN;
-#if RENDER_MAJOR > 0 || RENDER_MINOR >= 6
+#if !defined(QT_NO_XRENDER) && (RENDER_MAJOR > 0 || RENDER_MINOR >= 6)
             if (X11->use_xrender) {
                 int rsp = XRenderQuerySubpixelOrder(X11->display, s);
                 switch (rsp) {
-- 
cgit v0.12


From 06ea7cfc8f682904496889aedec03b1f00b0a8e7 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 25 Jun 2010 10:23:44 +0200
Subject: doc: Added more DITA output to the XML generator

Output Q_PROPERTY as a cxxVariable.

Task-number:  	 QTBUG-11391
---
 tools/qdoc3/cppcodeparser.cpp    |  32 +++++++-
 tools/qdoc3/ditaxmlgenerator.cpp |  56 +++++++++++++-
 tools/qdoc3/ditaxmlgenerator.h   |   1 +
 tools/qdoc3/node.cpp             |  39 +++++++++-
 tools/qdoc3/node.h               | 155 ++++++++++++++++++++++-----------------
 5 files changed, 207 insertions(+), 76 deletions(-)

diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp
index 13678af..ce7eba3 100644
--- a/tools/qdoc3/cppcodeparser.cpp
+++ b/tools/qdoc3/cppcodeparser.cpp
@@ -1850,16 +1850,40 @@ bool CppCodeParser::matchProperty(InnerNode *parent)
         else if (key == "WRITE") {
             tre->addPropertyFunction(property, value, PropertyNode::Setter);
             property->setWritable(true);
-        } else if (key == "STORED")
+        }
+        else if (key == "STORED")
             property->setStored(value.toLower() == "true");
-        else if (key == "DESIGNABLE")
-            property->setDesignable(value.toLower() == "true");
+        else if (key == "DESIGNABLE") {
+            QString v = value.toLower();
+            if (v == "true")
+                property->setDesignable(true);
+            else if (v == "false")
+                property->setDesignable(false);
+            else {
+                property->setDesignable(false);
+                property->setRuntimeDesFunc(value);
+            }
+        }
         else if (key == "RESET")
             tre->addPropertyFunction(property, value, PropertyNode::Resetter);
         else if (key == "NOTIFY") {
             tre->addPropertyFunction(property, value, PropertyNode::Notifier);
         }
-
+        else if (key == "SCRIPTABLE") {
+            QString v = value.toLower();
+            if (v == "true")
+                property->setScriptable(true);
+            else if (v == "false")
+                property->setScriptable(false);
+            else {
+                property->setScriptable(false);
+                property->setRuntimeScrFunc(value);
+            }
+        }
+        else if (key == "COSTANT") 
+            property->setConstant();
+        else if (key == "FINAL") 
+            property->setFinal();
     }
     match(Tok_RightParen);
     return true;
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index be734ac..852d209 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -4914,9 +4914,9 @@ void DitaXmlGenerator::writeProperties(const Section& s,
             writer.writeAttribute("value",pn->accessString());
             writer.writeEndElement(); // <cxxVariableAccessSpecifier>
 
-            if (!pn->dataType().isEmpty()) {
+            if (!pn->qualifiedDataType().isEmpty()) {
                 writer.writeStartElement(CXXVARIABLEDECLAREDTYPE);
-                writer.writeCharacters(pn->dataType());
+                writer.writeCharacters(pn->qualifiedDataType());
                 writer.writeEndElement(); // <cxxVariableDeclaredType>
             }
             QString fq = fullQualification(pn);
@@ -4925,11 +4925,49 @@ void DitaXmlGenerator::writeProperties(const Section& s,
                 writer.writeCharacters(fq);
                 writer.writeEndElement(); // <cxxVariableScopedName>
             }
+            
+            writer.writeStartElement(CXXVARIABLEPROTOTYPE);
+            writer.writeCharacters("Q_PROPERTY(");
+            writer.writeCharacters(pn->qualifiedDataType());
+            writer.writeCharacters(" ");
+            writer.writeCharacters(pn->name());
+            writerFunctions("READ",pn->getters());
+            writerFunctions("WRITE",pn->setters());
+            writerFunctions("RESET",pn->resetters());
+            writerFunctions("NOTIFY",pn->notifiers());
+            if (pn->isDesignable() != pn->designableDefault()) {
+                writer.writeCharacters(" DESIGNABLE ");
+                if (!pn->runtimeDesignabilityFunction().isEmpty())
+                    writer.writeCharacters(pn->runtimeDesignabilityFunction());
+                else
+                    writer.writeCharacters(pn->isDesignable() ? "true" : "false");
+            }
+            if (pn->isScriptable() != pn->scriptableDefault()) {
+                writer.writeCharacters(" SCRIPTABLE ");
+                if (!pn->runtimeScriptabilityFunction().isEmpty())
+                    writer.writeCharacters(pn->runtimeScriptabilityFunction());
+                else
+                    writer.writeCharacters(pn->isScriptable() ? "true" : "false");
+            }
+            if (pn->isWritable() != pn->writableDefault()) {
+                writer.writeCharacters(" STORED ");
+                writer.writeCharacters(pn->isStored() ? "true" : "false");
+            }
+            if (pn->isUser() != pn->userDefault()) {
+                writer.writeCharacters(" USER ");
+                writer.writeCharacters(pn->isUser() ? "true" : "false");
+            }
+            if (pn->isConstant())
+                writer.writeCharacters(" CONSTANT");
+            if (pn->isFinal())
+                writer.writeCharacters(" FINAL");
+            writer.writeCharacters(")");
+            writer.writeEndElement(); // <cxxVariablePrototype>
+
             writer.writeStartElement(CXXVARIABLENAMELOOKUP);
             writer.writeCharacters(pn->parent()->name() + "::" + pn->name());
             writer.writeEndElement(); // <cxxVariableNameLookup>
 
-
             if (pn->overriddenFrom() != 0) {
                 PropertyNode* opn = (PropertyNode*)pn->overriddenFrom();
                 writer.writeStartElement(CXXVARIABLEREIMPLEMENTED);
@@ -4954,4 +4992,16 @@ void DitaXmlGenerator::writeProperties(const Section& s,
     }
 }
 
+void DitaXmlGenerator::writerFunctions(const QString& tag, const NodeList& nlist)
+{
+    NodeList::const_iterator n = nlist.begin();
+    while (n != nlist.end()) {
+        writer.writeCharacters(" ");
+        writer.writeCharacters(tag);
+        writer.writeCharacters(" ");
+        writer.writeCharacters((*n)->name());
+        ++n;
+    }
+}
+
 QT_END_NAMESPACE
diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h
index 8c7e439..26788d7 100644
--- a/tools/qdoc3/ditaxmlgenerator.h
+++ b/tools/qdoc3/ditaxmlgenerator.h
@@ -133,6 +133,7 @@ class DitaXmlGenerator : public PageGenerator
     void writeProperties(const Section& s, 
                          const ClassNode* cn, 
                          CodeMarker* marker);
+    void writerFunctions(const QString& tag, const NodeList& nlist);
 
  private:
     enum SubTitleSize { SmallSubTitle, LargeSubTitle };
diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp
index 26957ac..7596825 100644
--- a/tools/qdoc3/node.cpp
+++ b/tools/qdoc3/node.cpp
@@ -1287,21 +1287,39 @@ void FunctionNode::debug() const
 
 /*!
   \class PropertyNode
+
+  This class describes one instance of using the Q_PROPERTY macro.
  */
 
 /*!
+  The constructor sets the \a parent and the \a name, but
+  everything else is set to default values.
  */
 PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
     : LeafNode(Property, parent, name),
       sto(Trool_Default),
       des(Trool_Default),
+      scr(Trool_Default),
+      wri(Trool_Default),
+      usr(Trool_Default),
+      cst(false),
+      fnl(false),
       overrides(0)
 {
+    // nothing.
 }
 
 /*!
+  Sets this property's \e {overridden from} property to
+  \a baseProperty, which indicates that this property
+  overrides \a baseProperty. To begin with, all the values
+  in this property are set to the corresponding values in
+  \a baseProperty.
+
+  We probably should ensure that the constant and final
+  attributes are not being overridden improperly.
  */
-void PropertyNode::setOverriddenFrom(const PropertyNode *baseProperty)
+void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
 {
     for (int i = 0; i < NumFunctionRoles; ++i) {
         if (funcs[i].isEmpty())
@@ -1311,6 +1329,12 @@ void PropertyNode::setOverriddenFrom(const PropertyNode *baseProperty)
         sto = baseProperty->sto;
     if (des == Trool_Default)
         des = baseProperty->des;
+    if (scr == Trool_Default)
+        scr = baseProperty->scr;
+    if (wri == Trool_Default)
+        wri = baseProperty->wri;
+    if (usr == Trool_Default)
+        usr = baseProperty->usr;
     overrides = baseProperty;
 }
 
@@ -1336,7 +1360,9 @@ QString PropertyNode::qualifiedDataType() const
     }
 }
 
-/*!
+/*! Converts the \a boolean value to an enum representation
+  of the boolean type, which includes an enum  value for the
+  \e {default value} of the item, i.e. true, false, or default.
  */
 PropertyNode::Trool PropertyNode::toTrool(bool boolean)
 {
@@ -1344,6 +1370,15 @@ PropertyNode::Trool PropertyNode::toTrool(bool boolean)
 }
 
 /*!
+  Converts the enum \a troolean back to a boolean value.
+  If \a troolean is neither the true enum value nor the
+  false enum value, the boolean value returned is
+  \a defaultValue.
+
+  Note that runtimeDesignabilityFunction() should be called
+  first. If that function returns the name of a function, it
+  means the function must be called at runtime to determine
+  whether the property is Designable.
  */
 bool PropertyNode::fromTrool(Trool troolean, bool defaultValue)
 {
diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h
index 37f2f26..b13e113 100644
--- a/tools/qdoc3/node.h
+++ b/tools/qdoc3/node.h
@@ -153,7 +153,7 @@ class Node
     void setStatus(Status status) { sta = status; }
     void setThreadSafeness(ThreadSafeness safeness) { saf = safeness; }
     void setSince(const QString &since) { sinc = since; }
-    void setRelates(InnerNode *pseudoParent);
+    void setRelates(InnerNode* pseudoParent);
     void setModuleName(const QString &module) { mod = module; }
     void setLink(LinkType linkType, const QString &link, const QString &desc);
     void setUrl(const QString &url);
@@ -167,8 +167,8 @@ class Node
     virtual bool isQmlNode() const { return false; }
     Type type() const { return typ; }
     virtual SubType subType() const { return NoSubType; }
-    InnerNode *parent() const { return par; }
-    InnerNode *relates() const { return rel; }
+    InnerNode* parent() const { return par; }
+    InnerNode* relates() const { return rel; }
     const QString& name() const { return nam; }
     QMap<LinkType, QPair<QString,QString> > links() const { return linkMap; }
     QString moduleName() const;
@@ -195,7 +195,7 @@ class Node
     QString ditaXmlHref();
 
  protected:
-    Node(Type type, InnerNode *parent, const QString& name);
+    Node(Type type, InnerNode* parent, const QString& name);
 
  private:
 
@@ -212,8 +212,8 @@ class Node
     PageType pageTyp : 4;
     Status sta : 3;
 #endif
-    InnerNode *par;
-    InnerNode *rel;
+    InnerNode* par;
+    InnerNode* rel;
     QString nam;
     Location loc;
     Doc d;
@@ -228,35 +228,35 @@ class Node
 class FunctionNode;
 class EnumNode;
 
-typedef QList<Node *> NodeList;
+typedef QList<Node*> NodeList;
 
 class InnerNode : public Node
 {
  public:
     virtual ~InnerNode();
 
-    Node *findNode(const QString& name);
-    Node *findNode(const QString& name, Type type);
-    FunctionNode *findFunctionNode(const QString& name);
-    FunctionNode *findFunctionNode(const FunctionNode *clone);
+    Node* findNode(const QString& name);
+    Node* findNode(const QString& name, Type type);
+    FunctionNode* findFunctionNode(const QString& name);
+    FunctionNode* findFunctionNode(const FunctionNode* clone);
     void addInclude(const QString &include);
     void setIncludes(const QStringList &includes);
-    void setOverload(const FunctionNode *func, bool overlode);
+    void setOverload(const FunctionNode* func, bool overlode);
     void normalizeOverloads();
     void makeUndocumentedChildrenInternal();
     void deleteChildren();
     void removeFromRelated();
 
     virtual bool isInnerNode() const;
-    const Node *findNode(const QString& name) const;
-    const Node *findNode(const QString& name, Type type) const;
-    const FunctionNode *findFunctionNode(const QString& name) const;
-    const FunctionNode *findFunctionNode(const FunctionNode *clone) const;
-    const EnumNode *findEnumNodeForValue(const QString &enumValue) const;
+    const Node* findNode(const QString& name) const;
+    const Node* findNode(const QString& name, Type type) const;
+    const FunctionNode* findFunctionNode(const QString& name) const;
+    const FunctionNode* findFunctionNode(const FunctionNode* clone) const;
+    const EnumNode* findEnumNodeForValue(const QString &enumValue) const;
     const NodeList & childNodes() const { return children; }
     const NodeList & relatedNodes() const { return related; }
     int count() const { return children.size(); }
-    int overloadNumber(const FunctionNode *func) const;
+    int overloadNumber(const FunctionNode* func) const;
     int numOverloads(const QString& funcName) const;
     NodeList overloads(const QString &funcName) const;
     const QStringList& includes() const { return inc; }
@@ -269,23 +269,23 @@ class InnerNode : public Node
     virtual void setAbstract(bool ) { }
 
  protected:
-    InnerNode(Type type, InnerNode *parent, const QString& name);
+    InnerNode(Type type, InnerNode* parent, const QString& name);
 
  private:
     friend class Node;
 
-    static bool isSameSignature(const FunctionNode *f1, const FunctionNode *f2);
-    void addChild(Node *child);
-    void removeChild(Node *child);
-    void removeRelated(Node *pseudoChild);
+    static bool isSameSignature(const FunctionNode* f1, const FunctionNode* f2);
+    void addChild(Node* child);
+    void removeChild(Node* child);
+    void removeRelated(Node* pseudoChild);
 
     QStringList pageKeywds;
     QStringList inc;
     NodeList children;
     NodeList enumChildren;
     NodeList related;
-    QMap<QString, Node *> childMap;
-    QMap<QString, Node *> primaryFunctionMap;
+    QMap<QString, Node*> childMap;
+    QMap<QString, Node*> primaryFunctionMap;
     QMap<QString, NodeList> secondaryFunctionMap;
 };
 
@@ -304,7 +304,7 @@ class LeafNode : public Node
 class NamespaceNode : public InnerNode
 {
  public:
-    NamespaceNode(InnerNode *parent, const QString& name);
+    NamespaceNode(InnerNode* parent, const QString& name);
     virtual ~NamespaceNode() { }
 };
 
@@ -329,11 +329,11 @@ struct RelatedClass
 class ClassNode : public InnerNode
 {
  public:
-    ClassNode(InnerNode *parent, const QString& name);
+    ClassNode(InnerNode* parent, const QString& name);
     virtual ~ClassNode() { }
 
     void addBaseClass(Access access, 
-                      ClassNode *node, 
+                      ClassNode* node, 
                       const QString &dataTypeWithTemplateArgs = "");
     void fixBaseClasses();
 
@@ -363,12 +363,12 @@ class FakeNode : public InnerNode
 {
  public:
 
-    FakeNode(InnerNode *parent, const QString& name, SubType subType);
+    FakeNode(InnerNode* parent, const QString& name, SubType subType);
     virtual ~FakeNode() { }
 
     void setTitle(const QString &title) { tle = title; }
     void setSubTitle(const QString &subTitle) { stle = subTitle; }
-    void addGroupMember(Node *node) { gr.append(node); }
+    void addGroupMember(Node* node) { gr.append(node); }
 
     SubType subType() const { return sub; }
     QString title() const { return tle; }
@@ -388,7 +388,7 @@ class FakeNode : public InnerNode
 class QmlClassNode : public FakeNode
 {
  public:
-    QmlClassNode(InnerNode *parent, 
+    QmlClassNode(InnerNode* parent, 
                  const QString& name, 
                  const ClassNode* cn);
     virtual ~QmlClassNode();
@@ -411,7 +411,7 @@ class QmlClassNode : public FakeNode
 class QmlBasicTypeNode : public FakeNode
 {
  public:
-    QmlBasicTypeNode(InnerNode *parent, 
+    QmlBasicTypeNode(InnerNode* parent, 
                      const QString& name);
     virtual ~QmlBasicTypeNode() { }
     virtual bool isQmlNode() const { return true; }
@@ -498,41 +498,41 @@ class TypedefNode;
 class EnumNode : public LeafNode
 {
  public:
-    EnumNode(InnerNode *parent, const QString& name);
+    EnumNode(InnerNode* parent, const QString& name);
     virtual ~EnumNode() { }
 
     void addItem(const EnumItem& item);
-    void setFlagsType(TypedefNode *typedeff);
+    void setFlagsType(TypedefNode* typedeff);
     bool hasItem(const QString &name) const { return names.contains(name); }
 
     const QList<EnumItem>& items() const { return itms; }
     Access itemAccess(const QString& name) const;
-    const TypedefNode *flagsType() const { return ft; }
+    const TypedefNode* flagsType() const { return ft; }
     QString itemValue(const QString &name) const;
 
  private:
     QList<EnumItem> itms;
     QSet<QString> names;
-    const TypedefNode *ft;
+    const TypedefNode* ft;
 };
 
 class TypedefNode : public LeafNode
 {
  public:
-    TypedefNode(InnerNode *parent, const QString& name);
+    TypedefNode(InnerNode* parent, const QString& name);
     virtual ~TypedefNode() { }
 
-    const EnumNode *associatedEnum() const { return ae; }
+    const EnumNode* associatedEnum() const { return ae; }
 
  private:
-    void setAssociatedEnum(const EnumNode *enume);
+    void setAssociatedEnum(const EnumNode* enume);
 
     friend class EnumNode;
 
-    const EnumNode *ae;
+    const EnumNode* ae;
 };
 
-inline void EnumNode::setFlagsType(TypedefNode *typedeff)
+inline void EnumNode::setFlagsType(TypedefNode* typedeff)
 {
     ft = typedeff;
     typedeff->setAssociatedEnum(this);
@@ -584,8 +584,8 @@ class FunctionNode : public LeafNode
         Native };
     enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual };
 
-    FunctionNode(InnerNode *parent, const QString &name);
-    FunctionNode(Type type, InnerNode *parent, const QString &name, bool attached);
+    FunctionNode(InnerNode* parent, const QString &name);
+    FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached);
     virtual ~FunctionNode() { }
 
     void setReturnType(const QString& returnType) { rt = returnType; }
@@ -598,8 +598,8 @@ class FunctionNode : public LeafNode
     void setReimp(bool r);
     void addParameter(const Parameter& parameter);
     inline void setParameters(const QList<Parameter>& parameters);
-    void borrowParameterNames(const FunctionNode *source);
-    void setReimplementedFrom(FunctionNode *from);
+    void borrowParameterNames(const FunctionNode* source);
+    void setReimplementedFrom(FunctionNode* from);
 
     const QString& returnType() const { return rt; }
     Metaness metaness() const { return met; }
@@ -616,9 +616,9 @@ class FunctionNode : public LeafNode
     int numOverloads() const;
     const QList<Parameter>& parameters() const { return params; }
     QStringList parameterNames() const;
-    const FunctionNode *reimplementedFrom() const { return rf; }
-    const QList<FunctionNode *> &reimplementedBy() const { return rb; }
-    const PropertyNode *associatedProperty() const { return ap; }
+    const FunctionNode* reimplementedFrom() const { return rf; }
+    const QList<FunctionNode*> &reimplementedBy() const { return rb; }
+    const PropertyNode* associatedProperty() const { return ap; }
     const QStringList& parentPath() const { return pp; }
 
     QStringList reconstructParams(bool values = false) const;
@@ -632,7 +632,7 @@ class FunctionNode : public LeafNode
     void debug() const;
 
  private:
-    void setAssociatedProperty(PropertyNode *property);
+    void setAssociatedProperty(PropertyNode* property);
 
     friend class InnerNode;
     friend class PropertyNode;
@@ -652,9 +652,9 @@ class FunctionNode : public LeafNode
     bool reimp: 1; 
     bool att: 1;
     QList<Parameter> params;
-    const FunctionNode *rf;
-    const PropertyNode *ap;
-    QList<FunctionNode *> rb;
+    const FunctionNode* rf;
+    const PropertyNode* ap;
+    QList<FunctionNode*> rb;
 };
 
 class PropertyNode : public LeafNode
@@ -663,16 +663,22 @@ class PropertyNode : public LeafNode
     enum FunctionRole { Getter, Setter, Resetter, Notifier };
     enum { NumFunctionRoles = Notifier + 1 };
 
-    PropertyNode(InnerNode *parent, const QString& name);
+    PropertyNode(InnerNode* parent, const QString& name);
     virtual ~PropertyNode() { }
 
     void setDataType(const QString& dataType) { dt = dataType; }
-    void addFunction(FunctionNode *function, FunctionRole role);
-    void addSignal(FunctionNode *function, FunctionRole role);
+    void addFunction(FunctionNode* function, FunctionRole role);
+    void addSignal(FunctionNode* function, FunctionRole role);
     void setStored(bool stored) { sto = toTrool(stored); }
     void setDesignable(bool designable) { des = toTrool(designable); }
+    void setScriptable(bool scriptable) { scr = toTrool(scriptable); }
     void setWritable(bool writable) { wri = toTrool(writable); }
-    void setOverriddenFrom(const PropertyNode *baseProperty);
+    void setUser(bool user) { usr = toTrool(user); }
+    void setOverriddenFrom(const PropertyNode* baseProperty);
+    void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; }
+    void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; }
+    void setConstant() { cst = true; }
+    void setFinal() { fnl = true; }
 
     const QString &dataType() const { return dt; }
     QString qualifiedDataType() const;
@@ -684,8 +690,20 @@ class PropertyNode : public LeafNode
     NodeList notifiers() const { return functions(Notifier); }
     bool isStored() const { return fromTrool(sto, storedDefault()); }
     bool isDesignable() const { return fromTrool(des, designableDefault()); }
+    bool isScriptable() const { return fromTrool(scr, scriptableDefault()); }
+    const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; }
+    const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; }
     bool isWritable() const { return fromTrool(wri, writableDefault()); }
-    const PropertyNode *overriddenFrom() const { return overrides; }
+    bool isUser() const { return fromTrool(usr, userDefault()); }
+    bool isConstant() const { return cst; }
+    bool isFinal() const { return fnl; }
+    const PropertyNode* overriddenFrom() const { return overrides; }
+
+    bool storedDefault() const { return true; }
+    bool userDefault() const { return false; }
+    bool designableDefault() const { return !setters().isEmpty(); }
+    bool scriptableDefault() const { return true; }
+    bool writableDefault() const { return !setters().isEmpty(); }
 
  private:
     enum Trool { Trool_True, Trool_False, Trool_Default };
@@ -693,16 +711,18 @@ class PropertyNode : public LeafNode
     static Trool toTrool(bool boolean);
     static bool fromTrool(Trool troolean, bool defaultValue);
 
-    bool storedDefault() const { return true; }
-    bool designableDefault() const { return !setters().isEmpty(); }
-    bool writableDefault() const { return !setters().isEmpty(); }
-
     QString dt;
+    QString runtimeDesFunc;
+    QString runtimeScrFunc;
     NodeList funcs[NumFunctionRoles];
     Trool sto;
     Trool des;
+    Trool scr;
     Trool wri;
-    const PropertyNode *overrides;
+    Trool usr;
+    bool cst;
+    bool fnl;
+    const PropertyNode* overrides;
 };
 
 inline void FunctionNode::setParameters(const QList<Parameter> &parameters)
@@ -710,13 +730,13 @@ inline void FunctionNode::setParameters(const QList<Parameter> &parameters)
     params = parameters;
 }
 
-inline void PropertyNode::addFunction(FunctionNode *function, FunctionRole role)
+inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role)
 {
     funcs[(int)role].append(function);
     function->setAssociatedProperty(this);
 }
 
-inline void PropertyNode::addSignal(FunctionNode *function, FunctionRole role)
+inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role)
 {
     funcs[(int)role].append(function);
 }
@@ -732,7 +752,7 @@ inline NodeList PropertyNode::functions() const
 class VariableNode : public LeafNode
 {
  public:
-    VariableNode(InnerNode *parent, const QString &name);
+    VariableNode(InnerNode* parent, const QString &name);
     virtual ~VariableNode() { }
 
     void setLeftType(const QString &leftType) { lt = leftType; }
@@ -750,15 +770,16 @@ class VariableNode : public LeafNode
     bool sta;
 };
 
-inline VariableNode::VariableNode(InnerNode *parent, const QString &name)
+inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
     : LeafNode(Variable, parent, name), sta(false)
 {
+    // nothing.
 }
 
 class TargetNode : public LeafNode
 {
  public:
-    TargetNode(InnerNode *parent, const QString& name);
+    TargetNode(InnerNode* parent, const QString& name);
     virtual ~TargetNode() { }
 
     virtual bool isInnerNode() const;
-- 
cgit v0.12


From 79342a635d71d1612795ab878b145f6e95ab23d2 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 25 Jun 2010 10:32:47 +0200
Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to
 4b88f595ab62b7c5f703a286c4f5f13f8784a936

* Fix crash/regression in thai line word breaking when libthai is installed:
  Commit 4b88f595ab62b7c5f703a286c4f5f13f8784a936 upstream ensures the zero
  termination of the string passed to libthai.
---
 src/3rdparty/harfbuzz/src/harfbuzz-thai.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
index fc2bdbf..e153ba9 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
@@ -53,6 +53,8 @@ static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr)
         else
             result[i] = '?';
     }
+
+    result[len] = 0;
 }
 
 static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttributes *attributes)
@@ -70,8 +72,8 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
     if (!th_brk)
         return;
 
-    if (len > 128)
-        cstr = (char *)malloc(len*sizeof(char));
+    if (len >= 128)
+        cstr = (char *)malloc(len*sizeof(char) + 1);
 
     to_tis620(string, len, cstr);
 
@@ -96,7 +98,7 @@ static void thaiWordBreaks(const HB_UChar16 *string, hb_uint32 len, HB_CharAttri
     if (break_positions != brp)
         free(break_positions);
 
-    if (len > 128)
+    if (len >= 128)
         free(cstr);
 }
 
-- 
cgit v0.12


From bae307e98aedb70d46ca0fd934d6fbca6044b151 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Fri, 25 Jun 2010 11:05:27 +0200
Subject: Fix linking on arm with def files

Added two missing QIODevicePrivate exports used implicitly by QtNetwork

Reviewed-by: Trust me
---
 src/s60installs/eabi/QtCoreu.def | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index 48cad39..7b9e777 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -3707,4 +3707,6 @@ EXPORTS
 	_ZrsR11QDataStreamR12QEasingCurve @ 3706 NONAME
 	_ZNK7QLocale13textDirectionEv @ 3707 NONAME
 	_ZNK7QString13isRightToLeftEv @ 3708 NONAME
+	_ZN16QIODevicePrivate4peekEPcx @ 3709 NONAME
+	_ZN16QIODevicePrivate4peekEx @ 3710 NONAME
 
-- 
cgit v0.12


From 65725d65882bd821c2a704307d201d246d8342b5 Mon Sep 17 00:00:00 2001
From: Zeno Albisser <zeno.albisser@nokia.com>
Date: Fri, 25 Jun 2010 11:14:22 +0200
Subject: Fix warnings in QSslSocketPrivate::systemCaCertificates()

Reviewed-by: Markus Goetz
---
 src/network/ssl/qsslsocket_openssl.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 36a0cc7..9bd93a2 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -574,17 +574,17 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
         }
     }
 #elif defined(Q_OS_AIX)
-    systemCerts.append(QSslCertificate::fromPath("/var/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/var/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
 #elif defined(Q_OS_SOLARIS)
-    systemCerts.append(QSslCertificate::fromPath("/usr/local/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
 #elif defined(Q_OS_HPUX)
-    systemCerts.append(QSslCertificate::fromPath("/opt/openssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard));
+    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/opt/openssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard));
 #elif defined(Q_OS_LINUX)
-    systemCerts.append(QSslCertificate::fromPath("/etc/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard)); // (K)ubuntu, OpenSUSE, Mandriva, ...
-    systemCerts.append(QSslCertificate::fromPath("/etc/pki/tls/certs/ca-bundle.crt", QSsl::Pem)); // Fedora
-    systemCerts.append(QSslCertificate::fromPath("/usr/lib/ssl/certs/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Gentoo, Mandrake
-    systemCerts.append(QSslCertificate::fromPath("/usr/share/ssl/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Centos, Redhat, SuSE
-    systemCerts.append(QSslCertificate::fromPath("/usr/local/ssl/*.pem", QSsl::Pem, QRegExp::Wildcard)); // Normal OpenSSL Tarball
+    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // (K)ubuntu, OpenSUSE, Mandriva, ...
+    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/pki/tls/certs/ca-bundle.crt"), QSsl::Pem)); // Fedora
+    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/lib/ssl/certs/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Gentoo, Mandrake
+    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/share/ssl/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Centos, Redhat, SuSE
+    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/ssl/*.pem"), QSsl::Pem, QRegExp::Wildcard)); // Normal OpenSSL Tarball
 #endif
     return systemCerts;
 }
-- 
cgit v0.12


From 1223f3f3d32bdc394a0fcd8d034fb3ad0afab0c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Samuel=20R=C3=B8dal?= <samuel.rodal@nokia.com>
Date: Thu, 24 Jun 2010 15:15:56 +0200
Subject: Fixed autotest failure in QPainter::setOpacity when NEON is used.

Be more lenient in the comparison, rounding errors might lead to
slightly different values.

Reviewed-by: Trond
---
 tests/auto/qpainter/tst_qpainter.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 701dc2e..27ee6e7 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -2648,12 +2648,16 @@ void tst_QPainter::setOpacity()
     p.drawImage(imageRect, src, imageRect);
     p.end();
 
-    QImage expected(imageSize, destFormat);
-    p.begin(&expected);
-    p.fillRect(imageRect, QColor(127, 127, 127));
-    p.end();
-
-    QCOMPARE(dest, expected);
+    QImage actual = dest.convertToFormat(QImage::Format_RGB32);
+
+    for (int y = 0; y < actual.height(); ++y) {
+        QRgb *p = (QRgb *)actual.scanLine(y);
+        for (int x = 0; x < actual.width(); ++x) {
+            QVERIFY(qAbs(qRed(p[x]) - 127) <= 0xf);
+            QVERIFY(qAbs(qGreen(p[x]) - 127) <= 0xf);
+            QVERIFY(qAbs(qBlue(p[x]) - 127) <= 0xf);
+        }
+    }
 }
 
 void tst_QPainter::drawhelper_blend_untransformed_data()
-- 
cgit v0.12


From 6887d006ecf2b4a4250659c45a2d9ba002dbcb80 Mon Sep 17 00:00:00 2001
From: Iain <qt-info@nokia.com>
Date: Fri, 25 Jun 2010 11:38:56 +0200
Subject: Update EABI and WINSCW DEF files for Symbian

Reviewed-by: TrustMe
---
 src/s60installs/bwins/QtCoreu.def        | 2 ++
 src/s60installs/bwins/QtDeclarativeu.def | 4 ++++
 src/s60installs/bwins/QtGuiu.def         | 4 ++++
 src/s60installs/eabi/QtDeclarativeu.def  | 5 +++++
 src/s60installs/eabi/QtGuiu.def          | 3 +++
 5 files changed, 18 insertions(+)

diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index 45caeb0..101c6a8 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -4480,4 +4480,6 @@ EXPORTS
 	?trUtf8@QEventDispatcherSymbian@@SA?AVQString@@PBD0H@Z @ 4479 NONAME ; class QString QEventDispatcherSymbian::trUtf8(char const *, char const *, int)
 	?staticMetaObject@QEventDispatcherSymbian@@2UQMetaObject@@B @ 4480 NONAME ; struct QMetaObject const QEventDispatcherSymbian::staticMetaObject
 	?textDirection@QLocale@@QBE?AW4LayoutDirection@Qt@@XZ @ 4481 NONAME ; enum Qt::LayoutDirection QLocale::textDirection(void) const
+	?peek@QIODevicePrivate@@UAE_JPAD_J@Z @ 4482 NONAME ; long long QIODevicePrivate::peek(char *, long long)
+	?peek@QIODevicePrivate@@UAE?AVQByteArray@@_J@Z @ 4483 NONAME ; class QByteArray QIODevicePrivate::peek(long long)
 
diff --git a/src/s60installs/bwins/QtDeclarativeu.def b/src/s60installs/bwins/QtDeclarativeu.def
index 0aac72b..ddc8cf4 100644
--- a/src/s60installs/bwins/QtDeclarativeu.def
+++ b/src/s60installs/bwins/QtDeclarativeu.def
@@ -4097,4 +4097,8 @@ EXPORTS
 	?setHeader@QDeclarativeGridView@@QAEXPAVQDeclarativeComponent@@@Z @ 4096 NONAME ; void QDeclarativeGridView::setHeader(class QDeclarativeComponent *)
 	?header@QDeclarativeGridView@@QBEPAVQDeclarativeComponent@@XZ @ 4097 NONAME ; class QDeclarativeComponent * QDeclarativeGridView::header(void) const
 	?footerChanged@QDeclarativeGridView@@IAEXXZ @ 4098 NONAME ; void QDeclarativeGridView::footerChanged(void)
+	?registerAutoParentFunction@QDeclarativePrivate@@YAHP6A?AW4AutoParentResult@1@PAVQObject@@0@Z@Z @ 4099 NONAME ; int QDeclarativePrivate::registerAutoParentFunction(enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *))
+	?parentFunctions@QDeclarativeMetaType@@SA?AV?$QList@P6A?AW4AutoParentResult@QDeclarativePrivate@@PAVQObject@@0@Z@@XZ @ 4100 NONAME ; class QList<enum QDeclarativePrivate::AutoParentResult (*)(class QObject *, class QObject *)> QDeclarativeMetaType::parentFunctions(void)
+	?inputMethodEvent@QDeclarativeTextInput@@MAEXPAVQInputMethodEvent@@@Z @ 4101 NONAME ; void QDeclarativeTextInput::inputMethodEvent(class QInputMethodEvent *)
+	?doUpdate@QDeclarativeBorderImage@@AAEXXZ @ 4102 NONAME ; void QDeclarativeBorderImage::doUpdate(void)
 
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index d439927..6e20131 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12820,4 +12820,8 @@ EXPORTS
 	?textOption@QStaticText@@QBE?AVQTextOption@@XZ @ 12819 NONAME ; class QTextOption QStaticText::textOption(void) const
 	?isRightToLeft@QTextEngine@@QBE_NXZ @ 12820 NONAME ; bool QTextEngine::isRightToLeft(void) const
 	?textDirection@QTextBlock@@QBE?AW4LayoutDirection@Qt@@XZ @ 12821 NONAME ; enum Qt::LayoutDirection QTextBlock::textDirection(void) const
+	?convertInPlace@QImageData@@QAE_NW4Format@QImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 12822 NONAME ; bool QImageData::convertInPlace(enum QImage::Format, class QFlags<enum Qt::ImageConversionFlag>)
+	?createPixmapForImage@QRasterPixmapData@@IAEXAAVQImage@@V?$QFlags@W4ImageConversionFlag@Qt@@@@_N@Z @ 12823 NONAME ; void QRasterPixmapData::createPixmapForImage(class QImage &, class QFlags<enum Qt::ImageConversionFlag>, bool)
+	??0Tab@QTextOption@@QAE@MW4TabType@1@VQChar@@@Z @ 12824 NONAME ; QTextOption::Tab::Tab(float, enum QTextOption::TabType, class QChar)
+	?fromData@QRasterPixmapData@@UAE_NPBEIPBDV?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 12825 NONAME ; bool QRasterPixmapData::fromData(unsigned char const *, unsigned int, char const *, class QFlags<enum Qt::ImageConversionFlag>)
 
diff --git a/src/s60installs/eabi/QtDeclarativeu.def b/src/s60installs/eabi/QtDeclarativeu.def
index f997454..96e74a6 100644
--- a/src/s60installs/eabi/QtDeclarativeu.def
+++ b/src/s60installs/eabi/QtDeclarativeu.def
@@ -3681,4 +3681,9 @@ EXPORTS
 	_ZNK17QDeclarativeState7isNamedEv @ 3680 NONAME
 	_ZNK20QDeclarativeGridView6footerEv @ 3681 NONAME
 	_ZNK20QDeclarativeGridView6headerEv @ 3682 NONAME
+	_ZN19QDeclarativePrivate26registerAutoParentFunctionEPFNS_16AutoParentResultEP7QObjectS2_E @ 3683 NONAME
+	_ZN20QDeclarativeMetaType15parentFunctionsEv @ 3684 NONAME
+	_ZN21QDeclarativeTextInput16inputMethodEventEP17QInputMethodEvent @ 3685 NONAME
+	_ZN23QDeclarativeBorderImage8doUpdateEv @ 3686 NONAME
+	_ZThn8_N21QDeclarativeTextInput16inputMethodEventEP17QInputMethodEvent @ 3687 NONAME
 
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index b59ddee..e7d865b 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12017,4 +12017,7 @@ EXPORTS
 	_ZNK11QStaticText10textOptionEv @ 12016 NONAME
 	_ZNK11QTextEngine13isRightToLeftEv @ 12017 NONAME
 	_ZNK14QWidgetPrivate22childAtRecursiveHelperERK6QPointbb @ 12018 NONAME
+	_ZN10QImageData14convertInPlaceEN6QImage6FormatE6QFlagsIN2Qt19ImageConversionFlagEE @ 12019 NONAME
+	_ZN17QRasterPixmapData20createPixmapForImageER6QImage6QFlagsIN2Qt19ImageConversionFlagEEb @ 12020 NONAME
+	_ZN17QRasterPixmapData8fromDataEPKhjPKc6QFlagsIN2Qt19ImageConversionFlagEE @ 12021 NONAME
 
-- 
cgit v0.12


From a144416f28ff256eed9913edc8453acb00760876 Mon Sep 17 00:00:00 2001
From: "Bradley T. Hughes" <bradley.hughes@nokia.com>
Date: Fri, 25 Jun 2010 11:21:21 +0200
Subject: QSemaphore::tryAquire(timeout) -- never times out on an active
 semaphore

If a thread trying to acquire multiple resources is continuously
preempted by threads acquiring smaller amounts, the larger consumer
would end up waiting forever (instead of for the given timeout).

Fix this by keeping track of elapsed time between wakeups using
QElapsedTimer.

Task-number: QTBUG-11500
Reviewed-by: thiago
---
 src/corelib/thread/qsemaphore.cpp        |  7 ++++-
 tests/auto/qsemaphore/tst_qsemaphore.cpp | 49 ++++++++++++++++++++++++++++++--
 2 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
index 9dc828d..8e8a88a 100644
--- a/src/corelib/thread/qsemaphore.cpp
+++ b/src/corelib/thread/qsemaphore.cpp
@@ -44,6 +44,8 @@
 #ifndef QT_NO_THREAD
 #include "qmutex.h"
 #include "qwaitcondition.h"
+#include "qelapsedtimer.h"
+#include "qdatetime.h"
 
 QT_BEGIN_NAMESPACE
 
@@ -218,8 +220,11 @@ bool QSemaphore::tryAcquire(int n, int timeout)
         while (n > d->avail)
             d->cond.wait(locker.mutex());
     } else {
+        QElapsedTimer timer;
+        timer.start();
         while (n > d->avail) {
-            if (!d->cond.wait(locker.mutex(), timeout))
+            if (timer.hasExpired(timeout)
+                || !d->cond.wait(locker.mutex(), timeout - timer.elapsed()))
                 return false;
         }
     }
diff --git a/tests/auto/qsemaphore/tst_qsemaphore.cpp b/tests/auto/qsemaphore/tst_qsemaphore.cpp
index ace33dc..7cede30 100644
--- a/tests/auto/qsemaphore/tst_qsemaphore.cpp
+++ b/tests/auto/qsemaphore/tst_qsemaphore.cpp
@@ -63,6 +63,7 @@ private slots:
     void tryAcquire();
     void tryAcquireWithTimeout_data();
     void tryAcquireWithTimeout();
+    void tryAcquireWithTimeoutStarvation();
     void release();
     void available();
     void producerConsumer();
@@ -232,8 +233,8 @@ void tst_QSemaphore::tryAcquireWithTimeout_data()
 {
     QTest::addColumn<int>("timeout");
 
-    QTest::newRow("") << 1000;
-    QTest::newRow("") << 10000;
+    QTest::newRow("1s") << 1000;
+    QTest::newRow("10s") << 10000;
 }
 
 void tst_QSemaphore::tryAcquireWithTimeout()
@@ -316,6 +317,50 @@ void tst_QSemaphore::tryAcquireWithTimeout()
     QCOMPARE(semaphore.available(), 0);
 }
 
+void tst_QSemaphore::tryAcquireWithTimeoutStarvation()
+{
+    class Thread : public QThread
+    {
+    public:
+        QSemaphore startup;
+        QSemaphore *semaphore;
+        int amountToConsume, timeout;
+
+        void run()
+        {
+            startup.release();
+            forever {
+                if (!semaphore->tryAcquire(amountToConsume, timeout))
+                    break;
+                semaphore->release(amountToConsume);
+            }
+        }
+    };
+
+    QSemaphore semaphore;
+    semaphore.release(1);
+
+    Thread consumer;
+    consumer.semaphore = &semaphore;
+    consumer.amountToConsume = 1;
+    consumer.timeout = 1000;
+
+    // start the thread and wait for it to start consuming
+    consumer.start();
+    consumer.startup.acquire();
+
+    // try to consume more than the thread we started is, and provide a longer
+    // timeout... we should timeout, not wait indefinitely
+    QVERIFY(!semaphore.tryAcquire(consumer.amountToConsume * 2, consumer.timeout * 2));
+
+    // the consumer should still be running
+    QVERIFY(consumer.isRunning() && !consumer.isFinished());
+
+    // acquire, and wait for smallConsumer to timeout
+    semaphore.acquire();
+    QVERIFY(consumer.wait());
+}
+
 void tst_QSemaphore::release()
 { DEPENDS_ON("acquire"); }
 
-- 
cgit v0.12


From 451a017e4d819a53d22b5dd5b562f99bda7ac087 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Fri, 25 Jun 2010 13:29:45 +0200
Subject: doc: Added more DITA output to the XML generator

Output the \variable stuff as a cxxVariable.

Task-number:  	 QTBUG-11391
---
 tools/qdoc3/codechunk.h          |  2 +-
 tools/qdoc3/ditaxmlgenerator.cpp | 72 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 66 insertions(+), 8 deletions(-)

diff --git a/tools/qdoc3/codechunk.h b/tools/qdoc3/codechunk.h
index e78873c..a0c554e 100644
--- a/tools/qdoc3/codechunk.h
+++ b/tools/qdoc3/codechunk.h
@@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
 /*
   The CodeChunk class represents a tiny piece of C++ code.
 
-  The class provides convertion between a list of lexemes and a string.  It adds
+  The class provides conversion between a list of lexemes and a string.  It adds
   spaces at the right place for consistent style.  The tiny pieces of code it
   represents are data types, enum values, and default parameter values.
 
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index 852d209..0135983 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -4573,7 +4573,8 @@ void DitaXmlGenerator::writeLocation(const Node* n)
         s2 = CXXTYPEDEFDECLARATIONFILE;
         s3 = CXXTYPEDEFDECLARATIONFILELINE;
     }
-    else if (n->type() == Node::Property) {
+    else if ((n->type() == Node::Property) ||
+             (n->type() == Node::Variable)) {
         s1 = CXXVARIABLEAPIITEMLOCATION;
         s2 = CXXVARIABLEDECLARATIONFILE;
         s3 = CXXVARIABLEDECLARATIONFILELINE;
@@ -4716,6 +4717,8 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke
             writer.writeStartElement(CXXFUNCTIONPARAMETER);
             writer.writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE);
             writer.writeCharacters((*p).leftType());
+            if (!(*p).rightType().isEmpty())
+                writer.writeCharacters((*p).rightType());
             writer.writeEndElement(); // <cxxFunctionParameterDeclaredType>
             writer.writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME);
             writer.writeCharacters((*p).name());
@@ -4888,12 +4891,6 @@ void DitaXmlGenerator::writeTypedefs(const Section& s,
     }
 }
 
-void DitaXmlGenerator::writeDataMembers(const Section& s, 
-                                        const ClassNode* cn, 
-                                        CodeMarker* marker)
-{
-}
-
 void DitaXmlGenerator::writeProperties(const Section& s, 
                                        const ClassNode* cn, 
                                        CodeMarker* marker)
@@ -4992,6 +4989,67 @@ void DitaXmlGenerator::writeProperties(const Section& s,
     }
 }
 
+void DitaXmlGenerator::writeDataMembers(const Section& s, 
+                                        const ClassNode* cn, 
+                                        CodeMarker* marker)
+{
+    NodeList::ConstIterator m = s.members.begin();
+    while (m != s.members.end()) {
+        if ((*m)->type() == Node::Variable) {
+            const VariableNode* vn = static_cast<const VariableNode*>(*m);
+            writer.writeStartElement(CXXVARIABLE);
+            writer.writeAttribute("id",vn->guid());
+            writer.writeStartElement(APINAME);
+            writer.writeCharacters(vn->name());
+            writer.writeEndElement(); // </apiName>
+            generateBrief(vn,marker);
+            writer.writeStartElement(CXXVARIABLEDETAIL);
+            writer.writeStartElement(CXXVARIABLEDEFINITION);
+            writer.writeStartElement(CXXVARIABLEACCESSSPECIFIER);
+            writer.writeAttribute("value",vn->accessString());
+            writer.writeEndElement(); // <cxxVariableAccessSpecifier>
+
+            writer.writeStartElement(CXXVARIABLEDECLAREDTYPE);
+            writer.writeCharacters(vn->leftType());
+            if (!vn->rightType().isEmpty())
+                writer.writeCharacters(vn->rightType());
+            writer.writeEndElement(); // <cxxVariableDeclaredType>
+
+            QString fq = fullQualification(vn);
+            if (!fq.isEmpty()) {
+                writer.writeStartElement(CXXVARIABLESCOPEDNAME);
+                writer.writeCharacters(fq);
+                writer.writeEndElement(); // <cxxVariableScopedName>
+            }
+            
+            writer.writeStartElement(CXXVARIABLEPROTOTYPE);
+            writer.writeCharacters(vn->leftType() + " ");
+            //writer.writeCharacters(vn->parent()->name() + "::" + vn->name()); 
+            writer.writeCharacters(vn->name()); 
+            if (!vn->rightType().isEmpty())
+                writer.writeCharacters(vn->rightType());
+            writer.writeEndElement(); // <cxxVariablePrototype>
+
+            writer.writeStartElement(CXXVARIABLENAMELOOKUP);
+            writer.writeCharacters(vn->parent()->name() + "::" + vn->name());
+            writer.writeEndElement(); // <cxxVariableNameLookup>
+
+            writeLocation(vn);
+            writer.writeEndElement(); // <cxxVariableDefinition>
+            writer.writeStartElement(APIDESC);
+
+            if (!vn->doc().isEmpty()) {
+                generateBody(vn, marker);
+            }
+
+            writer.writeEndElement(); // </apiDesc>
+            writer.writeEndElement(); // </cxxVariableDetail>
+            writer.writeEndElement(); // </cxxVariable>
+        }
+        ++m;
+    }
+}
+
 void DitaXmlGenerator::writerFunctions(const QString& tag, const NodeList& nlist)
 {
     NodeList::const_iterator n = nlist.begin();
-- 
cgit v0.12


From 287f6e933add5dc822c484170c5fece25c7ac846 Mon Sep 17 00:00:00 2001
From: Morten Engvoldsen <morten.engvoldsen@nokia.com>
Date: Fri, 25 Jun 2010 14:08:21 +0200
Subject: Doc: fixing search bug

---
 tools/qdoc3/htmlgenerator.cpp               | 12 +++++++++++-
 tools/qdoc3/test/qt-html-templates.qdocconf |  6 ++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 339c390..9e16676 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1890,7 +1890,17 @@ void HtmlGenerator::generateFooter(const Node *node)
 		}
 		else
 		{
-			out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
+			out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";\n";
+			out() << "  <!-- <script type=\"text/javascript\">\n";
+			out() << "  var _gaq = _gaq || [];\n";
+			out() << "  _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
+			out() << "  _gaq.push(['_trackPageview']);\n";
+			out() << "  (function() {\n";
+			out() << "  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
+			out() << "  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
+			out() << "  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
+			out() << "  })();\n";
+			out() << "  </script> -->\n";
 			out() << "</body>\n";
 		}
           out() <<   "</html>\n";
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 1fb000b..b82e337 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -11,7 +11,7 @@ HTML.postheader         = " <div class=\"header\" id=\"qtdocheader\">\n" \
 			  "    <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \
 			  "		<div id=\"narrowsearch\"><form onsubmit=\"return false;\" action=\"\" id=\"qtdocsearch\">\n" \
 			  "		<fieldset>\n" \
-              "		<input type=\"text\" value=\"\" id=\"pageType\" name=\"searchstring\">\n" \
+              "		<input type=\"text\" value=\"\" id=\"pageType2\" name=\"searchstring\">\n" \
 			  "		 </fieldset>\n" \
 			  "		</form></div>\n" \
 			  "    <div id=\"nav-topright\">\n" \
@@ -160,7 +160,9 @@ HTML.footer             = "        <!-- /div -->\n" \
 			  "  <div id=\"feedbackBox\">\n" \
 			  "      <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
 			  "    <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
-			  "      <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea></p>\n" \
+			  "      <p>Thank you for giving your feedback. <div class=\"note\">Make sure it is related the page. For more general bugs and \n" \
+			  "      requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a></div></p>\n" \
+			  "      <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\"></textarea></p>\n" \
 			  "      <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
 			  "    </form>\n" \
 			  "  </div>\n" \
-- 
cgit v0.12


From ff7b6c0da57c37f39b72b9823c5b4d78c4e95cb7 Mon Sep 17 00:00:00 2001
From: Thomas Zander <t.zander@nokia.com>
Date: Fri, 25 Jun 2010 15:43:56 +0200
Subject: Change the files to camelcase as avkon now does that

In older avkon solutions all headers were lowercase in
newer they are CamelCase...

Reviewed-by: Axis
---
 mkspecs/common/symbian/header-wrappers/AknLayoutFont.h     |  2 ++
 .../header-wrappers/AknsBasicBackgroundControlContext.h    |  1 +
 mkspecs/common/symbian/header-wrappers/AknsConstants.h     |  1 +
 mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h     |  1 +
 mkspecs/common/symbian/header-wrappers/AknsItemID.h        |  1 +
 mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h  |  1 +
 mkspecs/common/symbian/header-wrappers/AknsUtils.h         |  1 +
 src/gui/styles/qs60style_s60.cpp                           | 14 +++++++-------
 8 files changed, 15 insertions(+), 7 deletions(-)
 create mode 100644 mkspecs/common/symbian/header-wrappers/AknLayoutFont.h
 create mode 100644 mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h
 create mode 100644 mkspecs/common/symbian/header-wrappers/AknsConstants.h
 create mode 100644 mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h
 create mode 100644 mkspecs/common/symbian/header-wrappers/AknsItemID.h
 create mode 100644 mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h
 create mode 100644 mkspecs/common/symbian/header-wrappers/AknsUtils.h

diff --git a/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h b/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h
new file mode 100644
index 0000000..b5954e1
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknLayoutFont.h
@@ -0,0 +1,2 @@
+#include <aknlayoutfont.h>
+
diff --git a/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h b/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h
new file mode 100644
index 0000000..d121122
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsBasicBackgroundControlContext.h
@@ -0,0 +1 @@
+#include <aknsbasicbackgroundcontrolcontext.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsConstants.h b/mkspecs/common/symbian/header-wrappers/AknsConstants.h
new file mode 100644
index 0000000..c262866
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsConstants.h
@@ -0,0 +1 @@
+#include <aknsconstants.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h b/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h
new file mode 100644
index 0000000..7d71624
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsDrawUtils.h
@@ -0,0 +1 @@
+#include <aknsdrawutils.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsItemID.h b/mkspecs/common/symbian/header-wrappers/AknsItemID.h
new file mode 100644
index 0000000..fe3b80e
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsItemID.h
@@ -0,0 +1 @@
+#include <aknsitemid.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h b/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h
new file mode 100644
index 0000000..4a9dcd8
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsSkinInstance.h
@@ -0,0 +1 @@
+#include <aknsskininstance.h>
diff --git a/mkspecs/common/symbian/header-wrappers/AknsUtils.h b/mkspecs/common/symbian/header-wrappers/AknsUtils.h
new file mode 100644
index 0000000..1b9bece
--- /dev/null
+++ b/mkspecs/common/symbian/header-wrappers/AknsUtils.h
@@ -0,0 +1 @@
+#include <aknsutils.h>
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 4bb2ea8..2527662 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -50,17 +50,17 @@
 #include "qapplication.h"
 
 #include <w32std.h>
-#include <aknsconstants.h>
+#include <AknsConstants.h>
 #include <aknconsts.h>
-#include <aknsitemid.h>
-#include <aknsutils.h>
-#include <aknsdrawutils.h>
-#include <aknsskininstance.h>
-#include <aknsbasicbackgroundcontrolcontext.h>
+#include <AknsItemID.h>
+#include <AknsUtils.h>
+#include <AknsDrawUtils.h>
+#include <AknsSkinInstance.h>
+#include <AknsBasicBackgroundControlContext.h>
 #include <avkon.mbg>
 #include <aknfontaccess.h>
 #include <aknlayoutfont.h>
-#include <aknutils.h>
+#include <AknUtils.h>
 #include <aknnavi.h>
 #include <gulicon.h>
 #include <aknbitmapanimation.h>
-- 
cgit v0.12


From 15866a4436814da5da9348a8c930ee1d826ecb9a Mon Sep 17 00:00:00 2001
From: Thomas Zander <t.zander@nokia.com>
Date: Fri, 25 Jun 2010 15:44:04 +0200
Subject: Make symbian/unix shadow builds work again.

---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 5d97405..7f6d43b 100755
--- a/configure
+++ b/configure
@@ -2340,7 +2340,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
         chmod 755 "$outpath/bin/syncqt"
     fi
 
-    for i in createpackage patch_capabilities; do
+    for i in elf2e32_qtwrapper createpackage patch_capabilities; do
         rm -f "$outpath/bin/$i"
         if [ -x "$relpath/bin/$i" ]; then
             mkdir -p "$outpath/bin"
-- 
cgit v0.12


From 075648e46650797f2b520f98513a7aed9f0ffec7 Mon Sep 17 00:00:00 2001
From: Harald Fernengel <harald.fernengel@nokia.com>
Date: Fri, 25 Jun 2010 15:47:58 +0200
Subject: Warn if surface creation fails
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Output the same warning that qegl.cpp does also in the X11
implementation.

Reviewed-by: Trond Kjernåsen <trond.kjernasen@nokia.com>
---
 src/gui/egl/qegl_x11.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gui/egl/qegl_x11.cpp b/src/gui/egl/qegl_x11.cpp
index 969acc4..fea6e8d 100644
--- a/src/gui/egl/qegl_x11.cpp
+++ b/src/gui/egl/qegl_x11.cpp
@@ -415,7 +415,10 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig config, const QEg
 
         // At this point, the widget's window should be created and have the correct visual. Now we
         // just need to create the EGL surface for it:
-        return eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), 0);
+        EGLSurface surf = eglCreateWindowSurface(QEgl::display(), config, (EGLNativeWindowType)widget->winId(), 0);
+        if (surf == EGL_NO_SURFACE)
+            qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError());
+        return surf;
     }
 
     if (x11PixmapData) {
-- 
cgit v0.12


From 860094d4e2614c0926f2af0e3538412ece31f726 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Fri, 25 Jun 2010 16:05:25 +0200
Subject: Avoid memory allocation when converting from Gbk to unicode.

This change is the equivalent of
19e1b32bdeeeb5c7865038cab97b40dbac0e6c42 and
987458462994497f764baf253baca0faabdb63cc but for the Gbk case.
It improve performance by avoiding the constructor of QChar and
by allocating the memory once instead of doing it for each
character.

This also fix QTBUG-11704.

Reviewed-by: Andreas Kling
---
 src/plugins/codecs/cn/qgb18030codec.cpp | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/plugins/codecs/cn/qgb18030codec.cpp b/src/plugins/codecs/cn/qgb18030codec.cpp
index 3f2eec7..e10c8b1 100644
--- a/src/plugins/codecs/cn/qgb18030codec.cpp
+++ b/src/plugins/codecs/cn/qgb18030codec.cpp
@@ -319,7 +319,7 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
 {
     uchar buf[2];
     int nbuf = 0;
-    QChar replacement = QChar::ReplacementCharacter;
+    ushort replacement = QChar::ReplacementCharacter;
     if (state) {
         if (state->flags & ConvertInvalidToNull)
             replacement = QChar::Null;
@@ -330,6 +330,9 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
     int invalid = 0;
 
     QString result;
+    result.resize(len);
+    int unicodeLen = 0;
+    ushort *const resultData = reinterpret_cast<ushort*>(result.data());
 
     //qDebug("QGbkDecoder::toUnicode(const char* chars = \"%s\", int len = %d)", chars, len);
     for (int i=0; i<len; i++) {
@@ -338,14 +341,16 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
         case 0:
             if (ch < 0x80) {
                 // ASCII
-                result += QLatin1Char(ch);
+                resultData[unicodeLen] = ch;
+                ++unicodeLen;
             } else if (Is1stByte(ch)) {
                 // GBK 1st byte?
                 buf[0] = ch;
                 nbuf = 1;
             } else {
                 // Invalid
-                result += replacement;
+                resultData[unicodeLen] = replacement;
+                ++unicodeLen;
                 ++invalid;
             }
             break;
@@ -356,21 +361,25 @@ QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *
                 int clen = 2;
                 uint u = qt_Gb18030ToUnicode(buf, clen);
                 if (clen == 2) {
-                    result += qValidChar(u);
+                    resultData[unicodeLen] = qValidChar(static_cast<ushort>(u));
+                    ++unicodeLen;
                 } else {
-                    result += replacement;
+                    resultData[unicodeLen] = replacement;
+                    ++unicodeLen;
                     ++invalid;
                 }
                 nbuf = 0;
             } else {
                 // Error
-                result += replacement;
+                resultData[unicodeLen] = replacement;
+                ++unicodeLen;
                 ++invalid;
                 nbuf = 0;
             }
             break;
         }
     }
+    result.resize(unicodeLen);
 
     if (state) {
         state->remainingChars = nbuf;
-- 
cgit v0.12


From a179ae5dd94d0c51ebbf7d5c5b8eef5b3099c163 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Samuel=20R=C3=B8dal?= <samuel.rodal@nokia.com>
Date: Fri, 25 Jun 2010 14:11:44 +0200
Subject: Fixed autotest failure in QPathClipper on N900.

We need to use double precision for the angle computations, as they are
crucial to build correct winged edge structures.

Reviewed-by: Trond
---
 src/gui/painting/qpathclipper.cpp | 48 +++++++++++++--------------------------
 src/gui/painting/qpathclipper_p.h |  4 ++--
 2 files changed, 18 insertions(+), 34 deletions(-)

diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp
index 78553c9..a17b7c1 100644
--- a/src/gui/painting/qpathclipper.cpp
+++ b/src/gui/painting/qpathclipper.cpp
@@ -86,9 +86,11 @@ static qreal dot(const QPointF &a, const QPointF &b)
     return a.x() * b.x() + a.y() * b.y();
 }
 
-static QPointF normalize(const QPointF &p)
+static void normalize(double &x, double &y)
 {
-    return p / qSqrt(p.x() * p.x() + p.y() * p.y());
+    double reciprocal = 1 / qSqrt(x * x + y * y);
+    x *= reciprocal;
+    y *= reciprocal;
 }
 
 struct QIntersection
@@ -1017,8 +1019,8 @@ qreal QWingedEdge::delta(int vertex, int a, int b) const
     const QPathEdge *ap = edge(a);
     const QPathEdge *bp = edge(b);
 
-    qreal a_angle = ap->angle;
-    qreal b_angle = bp->angle;
+    double a_angle = ap->angle;
+    double b_angle = bp->angle;
 
     if (vertex == ap->second)
         a_angle = ap->invAngle;
@@ -1026,7 +1028,7 @@ qreal QWingedEdge::delta(int vertex, int a, int b) const
     if (vertex == bp->second)
         b_angle = bp->invAngle;
 
-    qreal result = b_angle - a_angle;
+    double result = b_angle - a_angle;
 
     if (result >= 128.)
         return result - 128.;
@@ -1036,26 +1038,6 @@ qreal QWingedEdge::delta(int vertex, int a, int b) const
         return result;
 }
 
-static inline QPointF tangentAt(const QWingedEdge &list, int vi, int ei)
-{
-    const QPathEdge *ep = list.edge(ei);
-    Q_ASSERT(ep);
-
-    qreal sign;
-
-    if (ep->first == vi) {
-        sign = 1;
-    } else {
-        sign = -1;
-    }
-
-    const QPointF a = *list.vertex(ep->first);
-    const QPointF b = *list.vertex(ep->second);
-    QPointF normal = b - a;
-
-    return normalize(sign * normal);
-}
-
 static inline QPointF midPoint(const QWingedEdge &list, int ei)
 {
     const QPathEdge *ep = list.edge(ei);
@@ -1191,7 +1173,7 @@ static int commonEdge(const QWingedEdge &list, int a, int b)
     return -1;
 }
 
-static qreal computeAngle(const QPointF &v)
+static double computeAngle(const QPointF &v)
 {
 #if 1
     if (v.x() == 0) {
@@ -1200,15 +1182,17 @@ static qreal computeAngle(const QPointF &v)
         return v.x() <= 0 ? 32. : 96.;
     }
 
-    QPointF nv = normalize(v);
-    if (nv.y() < 0) {
-        if (nv.x() < 0) { // 0 - 32
-            return -32. * nv.x();
+    double vx = v.x();
+    double vy = v.y();
+    normalize(vx, vy);
+    if (vy < 0) {
+        if (vx < 0) { // 0 - 32
+            return -32. * vx;
         } else { // 96 - 128
-            return 128. - 32. * nv.x();
+            return 128. - 32. * vx;
         }
     } else { // 32 - 96
-        return 64. + 32 * nv.x();
+        return 64. + 32. * vx;
     }
 #else
     // doesn't seem to be robust enough
diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h
index fab618d..bdad4e1 100644
--- a/src/gui/painting/qpathclipper_p.h
+++ b/src/gui/painting/qpathclipper_p.h
@@ -148,8 +148,8 @@ public:
     int first;
     int second;
 
-    qreal angle;
-    qreal invAngle;
+    double angle;
+    double invAngle;
 
     int next(Traversal traversal, Direction direction) const;
 
-- 
cgit v0.12


From 0fa3175421a3329fe4cb3fb9f79f30807105b02f Mon Sep 17 00:00:00 2001
From: Kent Hansen <kent.hansen@nokia.com>
Date: Fri, 25 Jun 2010 14:51:12 +0200
Subject: Fix conversion between JavaScript Date and QDateTime

Use JavaScriptCore's conversion functions rather than our own
(incomplete) implementation.
Specifically, this means daylight saving time is finally
handled correctly on Windows.

Task-number: QTBUG-9770
Reviewed-by: Olivier Goffart
---
 src/script/api/qscriptengine.cpp |  47 +++++
 src/script/api/qscriptengine_p.h |  10 +-
 src/script/script.pri            |   1 -
 src/script/utils/qscriptdate.cpp | 365 ---------------------------------------
 src/script/utils/qscriptdate_p.h |  52 ------
 src/script/utils/utils.pri       |   5 -
 6 files changed, 53 insertions(+), 427 deletions(-)
 delete mode 100644 src/script/utils/qscriptdate.cpp
 delete mode 100644 src/script/utils/qscriptdate_p.h
 delete mode 100644 src/script/utils/utils.pri

diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 655026c..7bccffe 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -438,6 +438,53 @@ qsreal ToNumber(const QString &value)
 
 #endif
 
+static const qsreal MsPerSecond = 1000.0;
+
+static inline int MsFromTime(qsreal t)
+{
+    int r = int(::fmod(t, MsPerSecond));
+    return (r >= 0) ? r : r + int(MsPerSecond);
+}
+
+/*!
+  \internal
+  Converts a JS date value (milliseconds) to a QDateTime (local time).
+*/
+QDateTime MsToDateTime(JSC::ExecState *exec, qsreal t)
+{
+    if (qIsNaN(t))
+        return QDateTime();
+    JSC::GregorianDateTime tm;
+    JSC::msToGregorianDateTime(exec, t, /*output UTC=*/true, tm);
+    int ms = MsFromTime(t);
+    QDateTime convertedUTC = QDateTime(QDate(tm.year + 1900, tm.month + 1, tm.monthDay),
+                                       QTime(tm.hour, tm.minute, tm.second, ms), Qt::UTC);
+    return convertedUTC.toLocalTime();
+}
+
+/*!
+  \internal
+  Converts a QDateTime to a JS date value (milliseconds).
+*/
+qsreal DateTimeToMs(JSC::ExecState *exec, const QDateTime &dt)
+{
+    if (!dt.isValid())
+        return qSNaN();
+    QDateTime utc = dt.toUTC();
+    QDate date = utc.date();
+    QTime time = utc.time();
+    JSC::GregorianDateTime tm;
+    tm.year = date.year() - 1900;
+    tm.month = date.month() - 1;
+    tm.monthDay = date.day();
+    tm.weekDay = date.dayOfWeek();
+    tm.yearDay = date.dayOfYear();
+    tm.hour = time.hour();
+    tm.minute = time.minute();
+    tm.second = time.second();
+    return JSC::gregorianDateTimeToMS(exec, tm, time.msec(), /*inputIsUTC=*/true);
+}
+
 void GlobalClientData::mark(JSC::MarkStack& markStack)
 {
     engine->mark(markStack);
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 1b35704..c71465d 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -50,7 +50,6 @@
 #include "bridge/qscriptobject_p.h"
 #include "bridge/qscriptqobject_p.h"
 #include "bridge/qscriptvariant_p.h"
-#include "utils/qscriptdate_p.h"
 
 #include "DateConstructor.h"
 #include "DateInstance.h"
@@ -119,6 +118,9 @@ namespace QScript
     inline QString ToString(qsreal);
 #endif
 
+    QDateTime MsToDateTime(JSC::ExecState *, qsreal);
+    qsreal DateTimeToMs(JSC::ExecState *, const QDateTime &);
+
     //some conversion helper functions
     inline QScriptEnginePrivate *scriptEngineFromExec(const JSC::ExecState *exec);
     bool isFunction(JSC::JSValue value);
@@ -861,7 +863,7 @@ inline JSC::JSValue QScriptEnginePrivate::newDate(JSC::ExecState *exec, qsreal v
 
 inline JSC::JSValue QScriptEnginePrivate::newDate(JSC::ExecState *exec, const QDateTime &value)
 {
-    return newDate(exec, QScript::FromDateTime(value));
+    return newDate(exec, QScript::DateTimeToMs(exec, value));
 }
 
 inline JSC::JSValue QScriptEnginePrivate::newObject()
@@ -994,12 +996,12 @@ inline JSC::UString QScriptEnginePrivate::toString(JSC::ExecState *exec, JSC::JS
     return str;
 }
 
-inline QDateTime QScriptEnginePrivate::toDateTime(JSC::ExecState *, JSC::JSValue value)
+inline QDateTime QScriptEnginePrivate::toDateTime(JSC::ExecState *exec, JSC::JSValue value)
 {
     if (!isDate(value))
         return QDateTime();
     qsreal t = static_cast<JSC::DateInstance*>(JSC::asObject(value))->internalNumber();
-    return QScript::ToDateTime(t, Qt::LocalTime);
+    return QScript::MsToDateTime(exec, t);
 }
 
 inline QObject *QScriptEnginePrivate::toQObject(JSC::ExecState *exec, JSC::JSValue value)
diff --git a/src/script/script.pri b/src/script/script.pri
index 2ee1a82..9cd71d3 100644
--- a/src/script/script.pri
+++ b/src/script/script.pri
@@ -1,4 +1,3 @@
 include($$PWD/api/api.pri)
 include($$PWD/bridge/bridge.pri)
 include($$PWD/parser/parser.pri)
-include($$PWD/utils/utils.pri)
diff --git a/src/script/utils/qscriptdate.cpp b/src/script/utils/qscriptdate.cpp
deleted file mode 100644
index 5980256..0000000
--- a/src/script/utils/qscriptdate.cpp
+++ /dev/null
@@ -1,365 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtScript module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL-ONLY$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qscriptdate_p.h"
-
-#include <QtCore/qnumeric.h>
-#include <QtCore/qstringlist.h>
-
-#include <math.h>
-
-#ifndef Q_WS_WIN
-#   include <time.h>
-#   include <sys/time.h>
-#else
-#   include <windows.h>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-namespace QScript {
-
-qsreal ToInteger(qsreal n);
-
-static const qsreal HoursPerDay = 24.0;
-static const qsreal MinutesPerHour = 60.0;
-static const qsreal SecondsPerMinute = 60.0;
-static const qsreal msPerSecond = 1000.0;
-static const qsreal msPerMinute = 60000.0;
-static const qsreal msPerHour = 3600000.0;
-static const qsreal msPerDay = 86400000.0;
-
-static qsreal LocalTZA = 0.0; // initialized at startup
-
-static inline qsreal TimeWithinDay(qsreal t)
-{
-    qsreal r = ::fmod(t, msPerDay);
-    return (r >= 0) ? r : r + msPerDay;
-}
-
-static inline int HourFromTime(qsreal t)
-{
-    int r = int(::fmod(::floor(t / msPerHour), HoursPerDay));
-    return (r >= 0) ? r : r + int(HoursPerDay);
-}
-
-static inline int MinFromTime(qsreal t)
-{
-    int r = int(::fmod(::floor(t / msPerMinute), MinutesPerHour));
-    return (r >= 0) ? r : r + int(MinutesPerHour);
-}
-
-static inline int SecFromTime(qsreal t)
-{
-    int r = int(::fmod(::floor(t / msPerSecond), SecondsPerMinute));
-    return (r >= 0) ? r : r + int(SecondsPerMinute);
-}
-
-static inline int msFromTime(qsreal t)
-{
-    int r = int(::fmod(t, msPerSecond));
-    return (r >= 0) ? r : r + int(msPerSecond);
-}
-
-static inline qsreal Day(qsreal t)
-{
-    return ::floor(t / msPerDay);
-}
-
-static inline qsreal DaysInYear(qsreal y)
-{
-    if (::fmod(y, 4))
-        return 365;
-
-    else if (::fmod(y, 100))
-        return 366;
-
-    else if (::fmod(y, 400))
-        return 365;
-
-    return 366;
-}
-
-static inline qsreal DayFromYear(qsreal y)
-{
-    return 365 * (y - 1970)
-        + ::floor((y - 1969) / 4)
-        - ::floor((y - 1901) / 100)
-        + ::floor((y - 1601) / 400);
-}
-
-static inline qsreal TimeFromYear(qsreal y)
-{
-    return msPerDay * DayFromYear(y);
-}
-
-static inline qsreal YearFromTime(qsreal t)
-{
-    int y = 1970;
-    y += (int) ::floor(t / (msPerDay * 365.2425));
-
-    qsreal t2 = TimeFromYear(y);
-    return (t2 > t) ? y - 1 : ((t2 + msPerDay * DaysInYear(y)) <= t) ? y + 1 : y;
-}
-
-static inline bool InLeapYear(qsreal t)
-{
-    qsreal x = DaysInYear(YearFromTime(t));
-    if (x == 365)
-        return 0;
-
-    Q_ASSERT (x == 366);
-    return 1;
-}
-
-static inline qsreal DayWithinYear(qsreal t)
-{
-    return Day(t) - DayFromYear(YearFromTime(t));
-}
-
-static inline qsreal MonthFromTime(qsreal t)
-{
-    qsreal d = DayWithinYear(t);
-    qsreal l = InLeapYear(t);
-
-    if (d < 31.0)
-        return 0;
-
-    else if (d < 59.0 + l)
-        return 1;
-
-    else if (d < 90.0 + l)
-        return 2;
-
-    else if (d < 120.0 + l)
-        return 3;
-
-    else if (d < 151.0 + l)
-        return 4;
-
-    else if (d < 181.0 + l)
-        return 5;
-
-    else if (d < 212.0 + l)
-        return 6;
-
-    else if (d < 243.0 + l)
-        return 7;
-
-    else if (d < 273.0 + l)
-        return 8;
-
-    else if (d < 304.0 + l)
-        return 9;
-
-    else if (d < 334.0 + l)
-        return 10;
-
-    else if (d < 365.0 + l)
-        return 11;
-
-    return qSNaN(); // ### assert?
-}
-
-static inline qsreal DateFromTime(qsreal t)
-{
-    int m = (int) ToInteger(MonthFromTime(t));
-    qsreal d = DayWithinYear(t);
-    qsreal l = InLeapYear(t);
-
-    switch (m) {
-    case 0: return d + 1.0;
-    case 1: return d - 30.0;
-    case 2: return d - 58.0 - l;
-    case 3: return d - 89.0 - l;
-    case 4: return d - 119.0 - l;
-    case 5: return d - 150.0 - l;
-    case 6: return d - 180.0 - l;
-    case 7: return d - 211.0 - l;
-    case 8: return d - 242.0 - l;
-    case 9: return d - 272.0 - l;
-    case 10: return d - 303.0 - l;
-    case 11: return d - 333.0 - l;
-    }
-
-    return qSNaN(); // ### assert
-}
-
-static inline qsreal WeekDay(qsreal t)
-{
-    qsreal r = ::fmod (Day(t) + 4.0, 7.0);
-    return (r >= 0) ? r : r + 7.0;
-}
-
-
-static inline qsreal MakeTime(qsreal hour, qsreal min, qsreal sec, qsreal ms)
-{
-    return ((hour * MinutesPerHour + min) * SecondsPerMinute + sec) * msPerSecond + ms;
-}
-
-static inline qsreal DayFromMonth(qsreal month, qsreal leap)
-{
-    switch ((int) month) {
-    case 0: return 0;
-    case 1: return 31.0;
-    case 2: return 59.0 + leap;
-    case 3: return 90.0 + leap;
-    case 4: return 120.0 + leap;
-    case 5: return 151.0 + leap;
-    case 6: return 181.0 + leap;
-    case 7: return 212.0 + leap;
-    case 8: return 243.0 + leap;
-    case 9: return 273.0 + leap;
-    case 10: return 304.0 + leap;
-    case 11: return 334.0 + leap;
-    }
-
-    return qSNaN(); // ### assert?
-}
-
-static qsreal MakeDay(qsreal year, qsreal month, qsreal day)
-{
-    year += ::floor(month / 12.0);
-
-    month = ::fmod(month, 12.0);
-    if (month < 0)
-        month += 12.0;
-
-    qsreal t = TimeFromYear(year);
-    qsreal leap = InLeapYear(t);
-
-    day += ::floor(t / msPerDay);
-    day += DayFromMonth(month, leap);
-
-    return day - 1;
-}
-
-static inline qsreal MakeDate(qsreal day, qsreal time)
-{
-    return day * msPerDay + time;
-}
-
-static inline qsreal DaylightSavingTA(double t)
-{
-#ifndef Q_WS_WIN
-    long int tt = (long int)(t / msPerSecond);
-    struct tm *tmtm = localtime((const time_t*)&tt);
-    if (! tmtm)
-        return 0;
-    return (tmtm->tm_isdst > 0) ? msPerHour : 0;
-#else
-    Q_UNUSED(t);
-    /// ### implement me
-    return 0;
-#endif
-}
-
-static inline qsreal LocalTime(qsreal t)
-{
-    return t + LocalTZA + DaylightSavingTA(t);
-}
-
-static inline qsreal UTC(qsreal t)
-{
-    return t - LocalTZA - DaylightSavingTA(t - LocalTZA);
-}
-
-static inline qsreal TimeClip(qsreal t)
-{
-    if (! qIsFinite(t) || fabs(t) > 8.64e15)
-        return qSNaN();
-    return ToInteger(t);
-}
-
-static qsreal getLocalTZA()
-{
-#ifndef Q_WS_WIN
-    struct tm* t;
-    time_t curr;
-    time(&curr);
-    t = localtime(&curr);
-    time_t locl = mktime(t);
-    t = gmtime(&curr);
-    time_t globl = mktime(t);
-    return double(locl - globl) * 1000.0;
-#else
-    TIME_ZONE_INFORMATION tzInfo;
-    GetTimeZoneInformation(&tzInfo);
-    return -tzInfo.Bias * 60.0 * 1000.0;
-#endif
-}
-
-/*!
-  \internal
-
-  Converts the QDateTime \a dt to an ECMA Date value (in UTC form).
-*/
-qsreal FromDateTime(const QDateTime &dt)
-{
-    if (!dt.isValid())
-        return qSNaN();
-    if (!LocalTZA) // ### move
-        LocalTZA = getLocalTZA();
-    QDate date = dt.date();
-    QTime taim = dt.time();
-    int year = date.year();
-    int month = date.month() - 1;
-    int day = date.day();
-    int hours = taim.hour();
-    int mins = taim.minute();
-    int secs = taim.second();
-    int ms = taim.msec();
-    double t = MakeDate(MakeDay(year, month, day),
-                        MakeTime(hours, mins, secs, ms));
-    if (dt.timeSpec() == Qt::LocalTime)
-        t = UTC(t);
-    return TimeClip(t);
-}
-
-/*!
-  \internal
-
-  Converts the ECMA Date value \tt (in UTC form) to QDateTime
-  according to \a spec.
-*/
-QDateTime ToDateTime(qsreal t, Qt::TimeSpec spec)
-{
-    if (qIsNaN(t))
-        return QDateTime();
-    if (!LocalTZA) // ### move
-        LocalTZA = getLocalTZA();
-    if (spec == Qt::LocalTime)
-        t = LocalTime(t);
-    int year = int(YearFromTime(t));
-    int month = int(MonthFromTime(t) + 1);
-    int day = int(DateFromTime(t));
-    int hours = HourFromTime(t);
-    int mins = MinFromTime(t);
-    int secs = SecFromTime(t);
-    int ms = msFromTime(t);
-    return QDateTime(QDate(year, month, day), QTime(hours, mins, secs, ms), spec);
-}
-
-} // namespace QScript
-
-QT_END_NAMESPACE
diff --git a/src/script/utils/qscriptdate_p.h b/src/script/utils/qscriptdate_p.h
deleted file mode 100644
index b9c9fd4..0000000
--- a/src/script/utils/qscriptdate_p.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtScript module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL-ONLY$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QSCRIPTDATE_P_H
-#define QSCRIPTDATE_P_H
-
-//
-//  W A R N I N G
-//  -------------
-//
-// This file is not part of the Qt API.  It exists purely as an
-// implementation detail.  This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qdatetime.h>
-
-QT_BEGIN_NAMESPACE
-
-typedef double qsreal;
-
-namespace QScript
-{
-    qsreal FromDateTime(const QDateTime &dt);
-    QDateTime ToDateTime(qsreal t, Qt::TimeSpec spec);
-}
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/script/utils/utils.pri b/src/script/utils/utils.pri
deleted file mode 100644
index d8302d5..0000000
--- a/src/script/utils/utils.pri
+++ /dev/null
@@ -1,5 +0,0 @@
-SOURCES += \
-    $$PWD/qscriptdate.cpp
-
-HEADERS += \
-    $$PWD/qscriptdate_p.h
-- 
cgit v0.12


From 02e44e7d93dd5336ab9415af98f2021e542eff31 Mon Sep 17 00:00:00 2001
From: Michael Dominic K <mdk@codethink.co.uk>
Date: Fri, 25 Jun 2010 16:22:50 +0200
Subject: Export the QGLPixmapData so that we can override it in a custom
 graphics system.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Merge-request: 2422
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
---
 src/opengl/qpixmapdata_gl_p.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h
index c239bcb..736a28e 100644
--- a/src/opengl/qpixmapdata_gl_p.h
+++ b/src/opengl/qpixmapdata_gl_p.h
@@ -96,7 +96,7 @@ private:
 };
 
 
-class QGLPixmapData : public QPixmapData
+class Q_OPENGL_EXPORT QGLPixmapData : public QPixmapData
 {
 public:
     QGLPixmapData(PixelType type);
-- 
cgit v0.12


From 535adbb4954caff9d88dc57bdb57bd09b872ddf1 Mon Sep 17 00:00:00 2001
From: Michael Dominic K <mdk@codethink.co.uk>
Date: Fri, 25 Jun 2010 16:22:51 +0200
Subject: Export QGLWindowSurface too.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Merge-request: 2422
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
---
 src/opengl/qwindowsurface_gl_p.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/opengl/qwindowsurface_gl_p.h b/src/opengl/qwindowsurface_gl_p.h
index 8ea714c..624236c 100644
--- a/src/opengl/qwindowsurface_gl_p.h
+++ b/src/opengl/qwindowsurface_gl_p.h
@@ -77,7 +77,7 @@ public:
     QGLWindowSurfacePrivate* d;
 };
 
-class QGLWindowSurface : public QObject, public QWindowSurface // , public QPaintDevice
+class Q_OPENGL_EXPORT QGLWindowSurface : public QObject, public QWindowSurface // , public QPaintDevice
 {
     Q_OBJECT
 public:
-- 
cgit v0.12


From c5aa53243bca8261d55d81cfeb525739a68b7703 Mon Sep 17 00:00:00 2001
From: Michael Dominic K <mdk@codethink.co.uk>
Date: Fri, 25 Jun 2010 16:22:52 +0200
Subject: Need to access extensionFuncs in subclasses too.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Merge-request: 2422
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
---
 src/opengl/qgl.cpp | 7 +++++++
 src/opengl/qgl_p.h | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index b4c85ac..71db7a8 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2220,6 +2220,13 @@ static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum textu
     }
 }
 
+#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
+QGLExtensionFuncs& QGLContextPrivate::extensionFuncs(const QGLContext *)
+{
+    return qt_extensionFuncs;
+}
+#endif
+
 QImage QGLContextPrivate::convertToGLFormat(const QImage &image, bool force_premul,
                                             GLenum texture_format)
 {
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 1727a41..c7fd111 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -415,7 +415,7 @@ public:
 
 #if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
     static QGLExtensionFuncs qt_extensionFuncs;
-    static inline QGLExtensionFuncs& extensionFuncs(const QGLContext *) { return qt_extensionFuncs; }
+    static QGLExtensionFuncs& extensionFuncs(const QGLContext *);
 #endif
 
     static void setCurrentContext(QGLContext *context);
-- 
cgit v0.12


From ea2ec1a4621bd80b3279ddc67e52cd16084a409b Mon Sep 17 00:00:00 2001
From: Harald Fernengel <harald.fernengel@nokia.com>
Date: Fri, 25 Jun 2010 16:23:41 +0200
Subject: Add qDebug() operator for QGLFormat
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Very handy to trace GL issues on a device with broken gdb

Reviewed-by: Trond Kjernåsen <trond.kjernasen@nokia.com>
---
 src/opengl/qgl.cpp | 26 ++++++++++++++++++++++++++
 src/opengl/qgl.h   |  7 +++++++
 2 files changed, 33 insertions(+)

diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index b4c85ac..9effb34 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1521,6 +1521,32 @@ bool operator==(const QGLFormat& a, const QGLFormat& b)
         && a.d->profile == b.d->profile);
 }
 
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QGLFormat &f)
+{
+    const QGLFormatPrivate * const d = f.d;
+
+    dbg.nospace() << "QGLFormat("
+                  << "options " << d->opts
+                  << ", plane " << d->pln
+                  << ", depthBufferSize " << d->depthSize
+                  << ", accumBufferSize " << d->accumSize
+                  << ", stencilBufferSize " << d->stencilSize
+                  << ", redBufferSize " << d->redSize
+                  << ", greenBufferSize " << d->greenSize
+                  << ", blueBufferSize " << d->blueSize
+                  << ", alphaBufferSize " << d->alphaSize
+                  << ", samples " << d->numSamples
+                  << ", swapInterval " << d->swapInterval
+                  << ", majorVersion " << d->majorVersion
+                  << ", minorVersion " << d->minorVersion
+                  << ", profile " << d->profile
+                  << ')';
+
+    return dbg.space();
+}
+#endif
+
 
 /*!
     Returns false if all the options of the two QGLFormat objects
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index f0b36f7..f85cad5 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -281,6 +281,9 @@ private:
 
     friend Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&);
     friend Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
+#ifndef QT_NO_DEBUG_STREAM
+    friend Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &);
+#endif
 };
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFormat::OpenGLVersionFlags)
@@ -288,6 +291,10 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFormat::OpenGLVersionFlags)
 Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&);
 Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&);
 
+#ifndef QT_NO_DEBUG_STREAM
+Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &);
+#endif
+
 class Q_OPENGL_EXPORT QGLContext
 {
     Q_DECLARE_PRIVATE(QGLContext)
-- 
cgit v0.12


From cc75093e3b300a37d05a81921d7811caabbfb449 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= <trond.kjernasen@nokia.com>
Date: Fri, 25 Jun 2010 17:21:26 +0200
Subject: EGL plane levels are the same as all other GL backends.

Qt has never used level 1 for the main plane, it's always been 0 and
will always be 0.

Reviewed-by: Harald Fernengel
---
 src/opengl/qgl_egl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/opengl/qgl_egl.cpp b/src/opengl/qgl_egl.cpp
index 0a19531..58d3b0a 100644
--- a/src/opengl/qgl_egl.cpp
+++ b/src/opengl/qgl_egl.cpp
@@ -138,7 +138,7 @@ void qt_glformat_from_eglconfig(QGLFormat& format, const EGLConfig config)
     format.setDepthBufferSize(depthSize);
     format.setStencilBufferSize(stencilSize);
     format.setSamples(sampleCount);
-    format.setPlane(level + 1);      // EGL calls level 0 "normal" whereas Qt calls 1 "normal"
+    format.setPlane(level);
     format.setDirectRendering(true); // All EGL contexts are direct-rendered
     format.setRgba(true);            // EGL doesn't support colour index rendering
     format.setStereo(false);         // EGL doesn't support stereo buffers
-- 
cgit v0.12


From 8c39d25f58dbf5b401e102d73eb2371c68be141e Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Sat, 26 Jun 2010 21:25:15 +0200
Subject: Corrected filename case for wincrypt.h

The case doesn't matter when building on Windows, but does
when cross-compiling on Unix.

Merge-request: 709
Reviewed-by: Andreas Kling <andreas.kling@nokia.com>
---
 src/network/ssl/qsslsocket_p.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 42ae98f..d3c3858 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
     typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*);
     typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*);
 #elif defined(Q_OS_WIN)
-#include <Wincrypt.h>
+#include <wincrypt.h>
 #ifndef HCRYPTPROV_LEGACY
 #define HCRYPTPROV_LEGACY HCRYPTPROV
 #endif
-- 
cgit v0.12


From 1a72f98a15ef78004894dc6636b8a5d969d66fde Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Sun, 27 Jun 2010 09:28:54 +1000
Subject: Fixed copy-paste error in htmlgenerator.cpp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes:

 htmlgenerator.cpp:1893: error: stray ‘\’ in program
---
 tools/qdoc3/htmlgenerator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 9e16676..b93db4f 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -1890,7 +1890,7 @@ void HtmlGenerator::generateFooter(const Node *node)
 		}
 		else
 		{
-			out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";\n";
+			out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
 			out() << "  <!-- <script type=\"text/javascript\">\n";
 			out() << "  var _gaq = _gaq || [];\n";
 			out() << "  _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
-- 
cgit v0.12


From ace98f68883acde733e79ca849d379f5ee67a87b Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Mon, 28 Jun 2010 09:46:09 +0200
Subject: doc: Added more DITA output to the XML generator

Added cxxVariableStorageClassSpecifierStatic.

Task-number:  	 QTBUG-11391
---
 tools/qdoc3/ditaxmlgenerator.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index 0135983..d48a578 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -1,3 +1,4 @@
+
 /****************************************************************************
 **
 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
@@ -5009,6 +5010,13 @@ void DitaXmlGenerator::writeDataMembers(const Section& s,
             writer.writeAttribute("value",vn->accessString());
             writer.writeEndElement(); // <cxxVariableAccessSpecifier>
 
+            if (vn->isStatic()) {
+                writer.writeStartElement(CXXVARIABLESTORAGECLASSSPECIFIERSTATIC);
+                writer.writeAttribute("name","static");
+                writer.writeAttribute("value","static");
+                writer.writeEndElement(); // <cxxVariableStorageClassSpecifierStatic>
+            }
+
             writer.writeStartElement(CXXVARIABLEDECLAREDTYPE);
             writer.writeCharacters(vn->leftType());
             if (!vn->rightType().isEmpty())
-- 
cgit v0.12


From 2e84a4d227818df8f4aa52e0e709cc161d25b528 Mon Sep 17 00:00:00 2001
From: Kent Hansen <kent.hansen@nokia.com>
Date: Mon, 28 Jun 2010 10:18:07 +0200
Subject: Updated JavaScriptCore from
 /home/khansen/dev/qtwebkit-qtscript-integration to
 javascriptcore-snapshot-28062010 ( f483443ccd7d21f2a57a794c4d00a63505d2f5d9 )

Revert our workaround for Mac OS VM tags issue, since it was fixed
properly in r57583 (cherry-picked in 528ffd602cc5a501713cd768df0cf6870a36ddad)
---
 src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp | 8 ++------
 src/3rdparty/javascriptcore/VERSION                              | 4 ++--
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
index eafcc23..24873c8 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp
@@ -217,9 +217,7 @@ void Heap::destroy()
 
 NEVER_INLINE CollectorBlock* Heap::allocateBlock()
 {
-    // Disable the use of vm_map for the Qt build on Darwin, because when compiled on 10.4
-    // it crashes on 10.5
-#if OS(DARWIN) && !PLATFORM(QT)
+#if OS(DARWIN)
     vm_address_t address = 0;
     vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE | VM_TAG_FOR_COLLECTOR_MEMORY, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT);
 #elif OS(SYMBIAN)
@@ -315,9 +313,7 @@ NEVER_INLINE void Heap::freeBlock(size_t block)
 
 NEVER_INLINE void Heap::freeBlockPtr(CollectorBlock* block)
 {
-    // Disable the use of vm_deallocate for the Qt build on Darwin, because when compiled on 10.4
-    // it crashes on 10.5
-#if OS(DARWIN) && !PLATFORM(QT)
+#if OS(DARWIN)    
     vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE);
 #elif OS(SYMBIAN)
     userChunk->Free(reinterpret_cast<TAny*>(block));
diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION
index daecc37..4e01d20 100644
--- a/src/3rdparty/javascriptcore/VERSION
+++ b/src/3rdparty/javascriptcore/VERSION
@@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from
 
 The commit imported was from the
 
-        javascriptcore-snapshot-16062010 branch/tag
+        javascriptcore-snapshot-28062010 branch/tag
 
 and has the sha1 checksum
 
-        8b2d3443afca194f8ac50a63151dc9d19a150582
+        f483443ccd7d21f2a57a794c4d00a63505d2f5d9
-- 
cgit v0.12


From 5b90f7c27e7e4a95c75421fa42345b3268707794 Mon Sep 17 00:00:00 2001
From: Kent Hansen <kent.hansen@nokia.com>
Date: Mon, 28 Jun 2010 11:43:01 +0200
Subject: doc: update the ECMAScript reference

Added functions introduced in the 5th edition that are supported
by JavaScriptCore, most notably the JSON object and "Array extras"
(map, filter, etc.).

Task-number: QTBUG-11735
---
 doc/src/scripting/ecmascript.qdoc | 50 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 47 insertions(+), 3 deletions(-)

diff --git a/doc/src/scripting/ecmascript.qdoc b/doc/src/scripting/ecmascript.qdoc
index 4497a0b..508bf3b 100644
--- a/doc/src/scripting/ecmascript.qdoc
+++ b/doc/src/scripting/ecmascript.qdoc
@@ -30,8 +30,9 @@
     \title ECMAScript Reference
     \brief A list of objects, functions and properties supported by QtScript.
 
-    This reference contains a list of objects, functions and
-    properties supported by QtScript.
+    This reference contains a list of built-in objects, functions and
+    properties supported by QtScript. For a detailed description, see
+    the \l{ECMA-262} specification.
 
     \tableofcontents
 
@@ -43,7 +44,6 @@
     \o NaN
     \o Infinity
     \o undefined
-    \o Math
     \endlist
 
     \section2 Function Properties
@@ -80,10 +80,33 @@
     \o URIError
     \endlist
 
+    \section2 Other Properties
+
+    \list
+    \o Math
+    \o JSON
+    \endlist
+
     \section1 Object Objects
 
+    \section2 Object Constructor
+
+    \section3 Function Properties
+
+    \list
+    \o getPrototypeOf(O)
+    \o getOwnPropertyDescriptor(O, P)
+    \o getOwnPropertyNames(O)
+    \o create(O [, Properties])
+    \o defineProperty(O, P, Attributes)
+    \o defineProperties(O, Properties)
+    \o keys(O)
+    \endlist
+
     \section2 Object Prototype Object
 
+    \section3 Function Properties
+
     \list
     \o toString()
     \o toLocaleString()
@@ -124,6 +147,15 @@
     \o sort(comparefn)
     \o splice(start, deleteCount[, item1 [, item2 [, ...]]])
     \o unshift([item1 [, item2 [, ...]]])
+    \o indexOf(searchElement [, fromIndex])
+    \o lastIndexOf(searchElement [, fromIndex])
+    \o every(callbackfn [, thisArg])
+    \o some(callbackfn [, thisArg])
+    \o forEach(callbackfn [, thisArg])
+    \o map(callbackfn [, thisArg])
+    \o filter(callbackfn [, thisArg])
+    \o reduce(callbackfn [, initialValue])
+    \o reduceRight(callbackfn [, initialValue])
     \endlist
 
     \section1 String Objects
@@ -151,6 +183,7 @@
     \o toLocaleLowerCase()
     \o toUpperCase()
     \o toLocaleUpperCase()
+    \o trim()
     \endlist
 
     \section1 Boolean Objects
@@ -264,6 +297,8 @@
     \o setFullYear(year [, month [, date]])
     \o setUTCFullYear(year [, month [, date]])
     \o toUTCString()
+    \o toISOString()
+    \o toJSON()
     \endlist
 
     \section1 RegExp Objects
@@ -295,4 +330,13 @@
     \o toString()
     \endlist
 
+    \section1 The JSON Object
+
+    \section2 Function Properties
+
+    \list
+    \o parse(text [, reviver])
+    \o stringify(value [, replacer [, space]])
+    \endlist
+
 */
-- 
cgit v0.12


From 5af99fdd3807c80932f1df08bb5a989817367716 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <ext-gareth.stockwell@nokia.com>
Date: Mon, 28 Jun 2010 11:08:38 +0100
Subject: Build fix for src/plugins/phonon/mmf

447f2b41 broke src/plugins/phonon/mmf/mmf.pro
---
 src/plugins/phonon/mmf/mmf.pro | 214 +++++++++++++++++++++++------------------
 1 file changed, 121 insertions(+), 93 deletions(-)

diff --git a/src/plugins/phonon/mmf/mmf.pro b/src/plugins/phonon/mmf/mmf.pro
index 2c0a305..7a6fdf8 100644
--- a/src/plugins/phonon/mmf/mmf.pro
+++ b/src/plugins/phonon/mmf/mmf.pro
@@ -1,99 +1,127 @@
 # MMF Phonon backend
+symbian {
+	QT += phonon
+	TARGET = phonon_mmf
+	PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf
 
-QT += phonon
-TARGET = phonon_mmf
-PHONON_MMF_DIR = $$QT_SOURCE_TREE/src/3rdparty/phonon/mmf
+	# Uncomment the following line in order to use the CDrmPlayerUtility client
+	# API for audio playback, rather than CMdaAudioPlayerUtility.
+	#CONFIG += phonon_mmf_audio_drm
 
-# Uncomment the following line in order to use the CDrmPlayerUtility client
-# API for audio playback, rather than CMdaAudioPlayerUtility.
-#CONFIG += phonon_mmf_audio_drm
+	phonon_mmf_audio_drm {
+		LIBS += -lDrmAudioPlayUtility
+		DEFINES += QT_PHONON_MMF_AUDIO_DRM
+	} else {
+		LIBS += -lmediaclientaudio
+	}
 
-phonon_mmf_audio_drm {
-    LIBS += -lDrmAudioPlayUtility
-    DEFINES += QT_PHONON_MMF_AUDIO_DRM
-} else {
-    LIBS += -lmediaclientaudio
-}
+	# This is necessary because both epoc32/include and Phonon contain videoplayer.h.
+	# By making /epoc32/include the first SYSTEMINCLUDE, we ensure that
+	# '#include <videoplayer.h>' picks up the Symbian header, as intended.
+	PREPEND_INCLUDEPATH = /epoc32/include
 
-# This is necessary because both epoc32/include and Phonon contain videoplayer.h.
-# By making /epoc32/include the first SYSTEMINCLUDE, we ensure that
-# '#include <videoplayer.h>' picks up the Symbian header, as intended.
-PREPEND_INCLUDEPATH = /epoc32/include
-
-PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty
-
-INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
-
-HEADERS +=                                           \
-           $$PHONON_MMF_DIR/abstractaudioeffect.h    \
-           $$PHONON_MMF_DIR/abstractmediaplayer.h    \
-           $$PHONON_MMF_DIR/abstractplayer.h         \
-           $$PHONON_MMF_DIR/abstractvideooutput.h    \
-           $$PHONON_MMF_DIR/abstractvideoplayer.h    \
-           $$PHONON_MMF_DIR/audioequalizer.h         \
-           $$PHONON_MMF_DIR/audiooutput.h            \
-           $$PHONON_MMF_DIR/audioplayer.h            \
-           $$PHONON_MMF_DIR/backend.h                \
-           $$PHONON_MMF_DIR/bassboost.h              \
-           $$PHONON_MMF_DIR/defs.h                   \
-           $$PHONON_MMF_DIR/dummyplayer.h            \
-           $$PHONON_MMF_DIR/effectfactory.h          \
-           $$PHONON_MMF_DIR/effectparameter.h        \
-           $$PHONON_MMF_DIR/environmentalreverb.h    \
-           $$PHONON_MMF_DIR/loudness.h               \
-           $$PHONON_MMF_DIR/mediaobject.h            \
-           $$PHONON_MMF_DIR/mmf_medianode.h          \
-           $$PHONON_MMF_DIR/stereowidening.h         \
-           $$PHONON_MMF_DIR/objectdump.h             \
-           $$PHONON_MMF_DIR/objectdump_symbian.h     \
-           $$PHONON_MMF_DIR/objecttree.h             \
-           $$PHONON_MMF_DIR/utils.h                  \
-           $$PHONON_MMF_DIR/videowidget.h
-
-SOURCES +=                                           \
-           $$PHONON_MMF_DIR/abstractaudioeffect.cpp  \
-           $$PHONON_MMF_DIR/abstractmediaplayer.cpp  \
-           $$PHONON_MMF_DIR/abstractplayer.cpp       \
-           $$PHONON_MMF_DIR/audioequalizer.cpp       \
-           $$PHONON_MMF_DIR/audiooutput.cpp          \
-           $$PHONON_MMF_DIR/audioplayer.cpp          \
-           $$PHONON_MMF_DIR/abstractvideooutput.cpp  \
-           $$PHONON_MMF_DIR/abstractvideoplayer.cpp  \
-           $$PHONON_MMF_DIR/backend.cpp              \
-           $$PHONON_MMF_DIR/bassboost.cpp            \
-           $$PHONON_MMF_DIR/dummyplayer.cpp          \
-           $$PHONON_MMF_DIR/effectfactory.cpp        \
-           $$PHONON_MMF_DIR/effectparameter.cpp      \
-           $$PHONON_MMF_DIR/environmentalreverb.cpp  \
-           $$PHONON_MMF_DIR/loudness.cpp             \
-           $$PHONON_MMF_DIR/mediaobject.cpp          \
-           $$PHONON_MMF_DIR/mmf_medianode.cpp        \
-           $$PHONON_MMF_DIR/stereowidening.cpp       \
-           $$PHONON_MMF_DIR/objectdump.cpp           \
-           $$PHONON_MMF_DIR/objectdump_symbian.cpp   \
-           $$PHONON_MMF_DIR/objecttree.cpp           \
-           $$PHONON_MMF_DIR/utils.cpp                \
-           $$PHONON_MMF_DIR/videowidget.cpp
-
-# Test for whether the build environment supports video rendering to graphics
-# surfaces.
-symbian {
-    exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) {
-        HEADERS +=                                       \
-               $$PHONON_MMF_DIR/videooutput_surface.h    \
-               $$PHONON_MMF_DIR/videoplayer_surface.h
-        SOURCES +=                                       \
-               $$PHONON_MMF_DIR/videooutput_surface.cpp  \
-               $$PHONON_MMF_DIR/videoplayer_surface.cpp
-        DEFINES += PHONON_MMF_VIDEO_SURFACES
-    } else {
-        HEADERS +=                                       \
-               $$PHONON_MMF_DIR/ancestormovemonitor.h    \
-               $$PHONON_MMF_DIR/videooutput_dsa.h        \
-               $$PHONON_MMF_DIR/videoplayer_dsa.h
-        SOURCES +=                                       \
-               $$PHONON_MMF_DIR/ancestormovemonitor.cpp  \
-               $$PHONON_MMF_DIR/videooutput_dsa.cpp      \
-               $$PHONON_MMF_DIR/videoplayer_dsa.cpp      \
-    }
+	PREPEND_INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty
+
+	INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+
+	HEADERS +=                                           \
+			   $$PHONON_MMF_DIR/abstractaudioeffect.h    \
+			   $$PHONON_MMF_DIR/abstractmediaplayer.h    \
+			   $$PHONON_MMF_DIR/abstractplayer.h         \
+			   $$PHONON_MMF_DIR/abstractvideooutput.h    \
+			   $$PHONON_MMF_DIR/abstractvideoplayer.h    \
+			   $$PHONON_MMF_DIR/audioequalizer.h         \
+			   $$PHONON_MMF_DIR/audiooutput.h            \
+			   $$PHONON_MMF_DIR/audioplayer.h            \
+			   $$PHONON_MMF_DIR/backend.h                \
+			   $$PHONON_MMF_DIR/bassboost.h              \
+			   $$PHONON_MMF_DIR/defs.h                   \
+			   $$PHONON_MMF_DIR/dummyplayer.h            \
+			   $$PHONON_MMF_DIR/effectfactory.h          \
+			   $$PHONON_MMF_DIR/effectparameter.h        \
+			   $$PHONON_MMF_DIR/environmentalreverb.h    \
+			   $$PHONON_MMF_DIR/loudness.h               \
+			   $$PHONON_MMF_DIR/mediaobject.h            \
+			   $$PHONON_MMF_DIR/mmf_medianode.h          \
+			   $$PHONON_MMF_DIR/stereowidening.h         \
+			   $$PHONON_MMF_DIR/objectdump.h             \
+			   $$PHONON_MMF_DIR/objectdump_symbian.h     \
+			   $$PHONON_MMF_DIR/objecttree.h             \
+			   $$PHONON_MMF_DIR/utils.h                  \
+			   $$PHONON_MMF_DIR/videowidget.h
+
+	SOURCES +=                                           \
+			   $$PHONON_MMF_DIR/abstractaudioeffect.cpp  \
+			   $$PHONON_MMF_DIR/abstractmediaplayer.cpp  \
+			   $$PHONON_MMF_DIR/abstractplayer.cpp       \
+			   $$PHONON_MMF_DIR/audioequalizer.cpp       \
+			   $$PHONON_MMF_DIR/audiooutput.cpp          \
+			   $$PHONON_MMF_DIR/audioplayer.cpp          \
+			   $$PHONON_MMF_DIR/abstractvideooutput.cpp  \
+			   $$PHONON_MMF_DIR/abstractvideoplayer.cpp  \
+			   $$PHONON_MMF_DIR/backend.cpp              \
+			   $$PHONON_MMF_DIR/bassboost.cpp            \
+			   $$PHONON_MMF_DIR/dummyplayer.cpp          \
+			   $$PHONON_MMF_DIR/effectfactory.cpp        \
+			   $$PHONON_MMF_DIR/effectparameter.cpp      \
+			   $$PHONON_MMF_DIR/environmentalreverb.cpp  \
+			   $$PHONON_MMF_DIR/loudness.cpp             \
+			   $$PHONON_MMF_DIR/mediaobject.cpp          \
+			   $$PHONON_MMF_DIR/mmf_medianode.cpp        \
+			   $$PHONON_MMF_DIR/stereowidening.cpp       \
+			   $$PHONON_MMF_DIR/objectdump.cpp           \
+			   $$PHONON_MMF_DIR/objectdump_symbian.cpp   \
+			   $$PHONON_MMF_DIR/objecttree.cpp           \
+			   $$PHONON_MMF_DIR/utils.cpp                \
+			   $$PHONON_MMF_DIR/videowidget.cpp
+
+	# Test for whether the build environment supports video rendering to graphics
+	# surfaces.
+	symbian:exists($${EPOCROOT}epoc32/include/platform/videoplayer2.h) {
+		HEADERS +=                                       \
+			   $$PHONON_MMF_DIR/videooutput_surface.h    \
+			   $$PHONON_MMF_DIR/videoplayer_surface.h
+		SOURCES +=                                       \
+			   $$PHONON_MMF_DIR/videooutput_surface.cpp  \
+			   $$PHONON_MMF_DIR/videoplayer_surface.cpp
+		DEFINES += PHONON_MMF_VIDEO_SURFACES
+	} else {
+		HEADERS +=                                       \
+			   $$PHONON_MMF_DIR/ancestormovemonitor.h    \
+			   $$PHONON_MMF_DIR/videooutput_dsa.h        \
+			   $$PHONON_MMF_DIR/videoplayer_dsa.h
+		SOURCES +=                                       \
+			   $$PHONON_MMF_DIR/ancestormovemonitor.cpp  \
+			   $$PHONON_MMF_DIR/videooutput_dsa.cpp      \
+			   $$PHONON_MMF_DIR/videoplayer_dsa.cpp      \
+	}
+
+	LIBS += -lcone
+	LIBS += -lws32
+
+	# This is only needed for debug builds, but is always linked against.
+	LIBS += -lhal
+
+	TARGET.CAPABILITY = all -tcb
+
+	LIBS += -lmediaclientvideo        # For CVideoPlayerUtility
+	LIBS += -lcone                    # For CCoeEnv
+	LIBS += -lws32                    # For RWindow
+	LIBS += -lefsrv                   # For file server
+	LIBS += -lapgrfx -lapmime         # For recognizer
+	LIBS += -lmmfcontrollerframework  # For CMMFMetaDataEntry
+	LIBS += -lmediaclientaudiostream  # For CMdaAudioOutputStream
+
+	# These are for effects.
+	LIBS += -lAudioEqualizerEffect -lBassBoostEffect -lDistanceAttenuationEffect -lDopplerBase -lEffectBase -lEnvironmentalReverbEffect -lListenerDopplerEffect -lListenerLocationEffect -lListenerOrientationEffect -lLocationBase -lLoudnessEffect -lOrientationBase -lSourceDopplerEffect -lSourceLocationEffect -lSourceOrientationEffect -lStereoWideningEffect
+
+	# This is needed for having the .qtplugin file properly created on Symbian.
+	QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/phonon_backend
+
+	target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend
+	INSTALLS += target
+
+	include(../../qpluginbase.pri)
+
+	TARGET.UID3=0x2001E629
 }
-- 
cgit v0.12


From 07f5dd83dcb5430433fa6d7139298d5a9cd11276 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Mon, 28 Jun 2010 12:41:58 +0200
Subject: Fix build with def files on arm

Added missing exports for new functionality used by QtDeclarative
---
 src/s60installs/eabi/QtScriptu.def | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/s60installs/eabi/QtScriptu.def b/src/s60installs/eabi/QtScriptu.def
index 3269d97..288b3ab 100644
--- a/src/s60installs/eabi/QtScriptu.def
+++ b/src/s60installs/eabi/QtScriptu.def
@@ -439,4 +439,6 @@ EXPORTS
 	_ZN23QScriptDeclarativeClass7compareEPNS_6ObjectES1_ @ 438 NONAME
 	_ZN25QScriptEngineAgentPrivate11atStatementERKN5QTJSC17DebuggerCallFrameEii @ 439 NONAME
 	_ZN25QScriptEngineAgentPrivate18didReachBreakpointERKN5QTJSC17DebuggerCallFrameEii @ 440 NONAME
+	_ZN23QScriptDeclarativeClass20newStaticScopeObjectEP13QScriptEngine @ 441 NONAME
+	_ZN23QScriptDeclarativeClass20newStaticScopeObjectEP13QScriptEngineiPK7QStringPK12QScriptValuePK6QFlagsINS5_12PropertyFlagEE @ 442 NONAME
 
-- 
cgit v0.12


From fd8e9eadd087d11b0a01d598132ccbb19667fa5a Mon Sep 17 00:00:00 2001
From: Michael Dominic K <mdk@codethink.co.uk>
Date: Mon, 28 Jun 2010 12:55:02 +0200
Subject: New variant of ::createPixmapData with origin for QGraphicsSystem.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Merge-request: 705
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
---
 src/gui/painting/qgraphicssystem.cpp         | 4 ++++
 src/gui/painting/qgraphicssystem_p.h         | 1 +
 src/gui/painting/qgraphicssystem_runtime.cpp | 2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp
index 2ea3d33..69ce47e 100644
--- a/src/gui/painting/qgraphicssystem.cpp
+++ b/src/gui/painting/qgraphicssystem.cpp
@@ -79,5 +79,9 @@ QPixmapData *QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixelType typ
     return 0;
 }
 
+QPixmapData *QGraphicsSystem::createPixmapData(QPixmapData *origin)
+{
+    return createPixmapData(origin->pixelType());
+}
 
 QT_END_NAMESPACE
diff --git a/src/gui/painting/qgraphicssystem_p.h b/src/gui/painting/qgraphicssystem_p.h
index ddca788..1211505 100644
--- a/src/gui/painting/qgraphicssystem_p.h
+++ b/src/gui/painting/qgraphicssystem_p.h
@@ -64,6 +64,7 @@ class Q_GUI_EXPORT QGraphicsSystem
 {
 public:
     virtual QPixmapData *createPixmapData(QPixmapData::PixelType type) const = 0;
+    virtual QPixmapData *createPixmapData(QPixmapData *origin);
     virtual QWindowSurface *createWindowSurface(QWidget *widget) const = 0;
 
     virtual ~QGraphicsSystem() = 0;
diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp
index 32a8578..1c3ae10 100644
--- a/src/gui/painting/qgraphicssystem_runtime.cpp
+++ b/src/gui/painting/qgraphicssystem_runtime.cpp
@@ -416,7 +416,7 @@ void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name)
 
     for (int i = 0; i < m_pixmapDatas.size(); ++i) {
         QRuntimePixmapData *proxy = m_pixmapDatas.at(i);
-        QPixmapData *newData = m_graphicsSystem->createPixmapData(proxy->m_data->pixelType());
+        QPixmapData *newData = m_graphicsSystem->createPixmapData(proxy->m_data);
         // ### TODO Optimize. Openvg and s60raster graphics systems could switch internal ARGB32_PRE QImage buffers.
         newData->fromImage(proxy->m_data->toImage(), Qt::AutoColor | Qt::OrderedAlphaDither);
         delete proxy->m_data;
-- 
cgit v0.12


From 8e42bd0f273f5e0ae10fbc04ad49dc8d2e5b4655 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Mon, 28 Jun 2010 13:17:22 +0200
Subject: Updated WebKit to 38d650efc92427cd6452f6685d3c40d22428cdb7

|| <https://webkit.org/b/40000> || [Qt] QGraphicsWebView crash when calling setScale() before setUrl() ||
|| <https://webkit.org/b/38597> || [Qt] QtTestBrowser does not have a "Load" button ; therefore, unable to load pages on touch only symbian devices (portrait mode). ||
---
 src/3rdparty/webkit/.tag                                  |  2 +-
 src/3rdparty/webkit/VERSION                               |  2 +-
 src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp    |  2 ++
 src/3rdparty/webkit/WebKit/qt/ChangeLog                   | 15 +++++++++++++++
 .../qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp    |  8 ++++++++
 5 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag
index 24cf142..aa30784 100644
--- a/src/3rdparty/webkit/.tag
+++ b/src/3rdparty/webkit/.tag
@@ -1 +1 @@
-2f598e9b7b376d851fe089bc1dc729bcf0393a06
+38d650efc92427cd6452f6685d3c40d22428cdb7
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 924b120..980e01a 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,4 +4,4 @@ This is a snapshot of the Qt port of WebKit from
 
 and has the sha1 checksum
 
-        2f598e9b7b376d851fe089bc1dc729bcf0393a06
+        38d650efc92427cd6452f6685d3c40d22428cdb7
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index 7a25646..c4d240c 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -442,6 +442,8 @@ QRectF QGraphicsWebViewPrivate::graphicsItemVisibleRect() const
 #if ENABLE(TILED_BACKING_STORE)
 void QGraphicsWebViewPrivate::updateTiledBackingStoreScale()
 {
+    if (!page)
+        return;
     WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page->mainFrame())->tiledBackingStore();
     if (!backingStore)
         return;
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index 69a431f..8fb929e 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,18 @@
+2010-06-28  Andreas Kling  <andreas.kling@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] QGraphicsWebView crash when calling setScale() before setUrl()
+        https://bugs.webkit.org/show_bug.cgi?id=40000
+
+        Check 'page' before dereference in _q_scaleChanged()
+        Autotest included.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebViewPrivate::_q_scaleChanged):
+        * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+        (tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl):
+
 2010-06-24  Simon Hausmann  <simon.hausmann@nokia.com>
 
         Unreviewed Symbian build fix.
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index e06524d..a04ff17 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -34,6 +34,7 @@ private slots:
     void crashOnViewlessWebPages();
     void microFocusCoordinates();
     void focusInputTypes();
+    void crashOnSetScaleBeforeSetUrl();
 };
 
 void tst_QGraphicsWebView::qgraphicswebview()
@@ -132,6 +133,13 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
     delete page;
 }
 
+void tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl()
+{
+    QGraphicsWebView* webView = new QGraphicsWebView;
+    webView->setScale(2.0);
+    delete webView;
+}
+
 void tst_QGraphicsWebView::microFocusCoordinates()
 {
     QWebPage* page = new QWebPage;
-- 
cgit v0.12


From 94e7b873ed5c04d4850a9e36970906113f12cd55 Mon Sep 17 00:00:00 2001
From: Andreas Kling <andreas.kling@nokia.com>
Date: Mon, 28 Jun 2010 13:00:56 +0200
Subject: Don't load ciphers and system certificates for
 QSslSocket::supportsSsl()

Loading these uses about 1 MB of memory and can be be deferred until
it's actually needed.

Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
---
 src/network/ssl/qsslsocket.cpp         |  2 +-
 src/network/ssl/qsslsocket_openssl.cpp | 50 +++++++++++++++++++++++++++-------
 src/network/ssl/qsslsocket_p.h         | 10 ++++++-
 3 files changed, 50 insertions(+), 12 deletions(-)

diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index a8c602a..f85fa84 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1556,7 +1556,7 @@ QList<QSslError> QSslSocket::sslErrors() const
 */
 bool QSslSocket::supportsSsl()
 {
-    return QSslSocketPrivate::ensureInitialized();
+    return QSslSocketPrivate::supportsSsl();
 }
 
 /*!
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 9bd93a2..fa26fe8 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -72,6 +72,9 @@
 
 QT_BEGIN_NAMESPACE
 
+bool QSslSocketPrivate::s_libraryLoaded = false;
+bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
+
 // Useful defines
 #define SSL_ERRORSTR() QString::fromLocal8Bit(q_ERR_error_string(q_ERR_get_error(), NULL))
 
@@ -398,19 +401,24 @@ void QSslSocketPrivate::deinitialize()
 /*!
     \internal
 
-    Declared static in QSslSocketPrivate, makes sure the SSL libraries have
-    been initialized.
+    Does the minimum amount of initialization to determine whether SSL
+    is supported or not.
 */
-bool QSslSocketPrivate::ensureInitialized()
+
+bool QSslSocketPrivate::supportsSsl()
+{
+    return ensureLibraryLoaded();
+}
+
+bool QSslSocketPrivate::ensureLibraryLoaded()
 {
     if (!q_resolveOpenSslSymbols())
         return false;
 
     // Check if the library itself needs to be initialized.
     QMutexLocker locker(openssl_locks()->initLock());
-    static int q_initialized = false;
-    if (!q_initialized) {
-        q_initialized = true;
+    if (!s_libraryLoaded) {
+        s_libraryLoaded = true;
 
         // Initialize OpenSSL.
         q_CRYPTO_set_id_callback(id_function);
@@ -447,10 +455,33 @@ bool QSslSocketPrivate::ensureInitialized()
             if (!attempts)
                 return false;
         }
-
-        resetDefaultCiphers();
-        setDefaultCaCertificates(systemCaCertificates());
     }
+    return true;
+}
+
+void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
+{
+    if (s_loadedCiphersAndCerts)
+        return;
+    s_loadedCiphersAndCerts = true;
+
+    resetDefaultCiphers();
+    setDefaultCaCertificates(systemCaCertificates());
+}
+
+/*!
+    \internal
+
+    Declared static in QSslSocketPrivate, makes sure the SSL libraries have
+    been initialized.
+*/
+
+void QSslSocketPrivate::ensureInitialized()
+{
+    if (!supportsSsl())
+        return;
+
+    ensureCiphersAndCertsLoaded();
 
     //load symbols needed to receive certificates from system store
 #if defined(Q_OS_MAC)
@@ -481,7 +512,6 @@ bool QSslSocketPrivate::ensureInitialized()
         qWarning("could not load crypt32 library"); // should never happen
     }
 #endif
-    return true;
 }
 
 /*!
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index d3c3858..09775bc 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -108,7 +108,8 @@ public:
     // that was used for connecting to.
     QString verificationPeerName;
 
-    static bool ensureInitialized();
+    static bool supportsSsl();
+    static void ensureInitialized();
     static void deinitialize();
     static QList<QSslCipher> defaultCiphers();
     static QList<QSslCipher> supportedCiphers();
@@ -154,6 +155,13 @@ public:
     virtual void disconnectFromHost() = 0;
     virtual void disconnected() = 0;
     virtual QSslCipher sessionCipher() const = 0;
+
+private:
+    static bool ensureLibraryLoaded();
+    static void ensureCiphersAndCertsLoaded();
+
+    static bool s_libraryLoaded;
+    static bool s_loadedCiphersAndCerts;
 };
 
 QT_END_NAMESPACE
-- 
cgit v0.12


From 3aa8ae52ebb7a3395328f52fe2cbae0a44ae7198 Mon Sep 17 00:00:00 2001
From: Martin Smith <martin.smith@nokia.com>
Date: Mon, 28 Jun 2010 14:03:59 +0200
Subject: doc: Added more DITA output to the XML generator

Added cxxDefine for macros.

Task-number:  	 QTBUG-11391
---
 tools/qdoc3/ditaxmlgenerator.cpp | 105 ++++++++++++++++++++++++++++++++++-----
 tools/qdoc3/ditaxmlgenerator.h   |   8 +--
 2 files changed, 97 insertions(+), 16 deletions(-)

diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index d48a578..d7a9c9e 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -1466,7 +1466,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
                 writeFunctions((*s),cn,marker);
             }
             else if ((*s).name == "Member Type Documentation") {
-                writeNestedClasses((*s),cn,marker);
                 writeEnumerations((*s),cn,marker);
                 writeTypedefs((*s),cn,marker);
             }
@@ -1476,6 +1475,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
             else if ((*s).name == "Property Documentation") {
                 writeProperties((*s),cn,marker);
             }
+            else if ((*s).name == "Macro Documentation") {
+                writeMacros((*s),cn,marker);
+            }
             ++s;
         }
         writer.writeEndElement(); // </cxxClass>
@@ -4736,12 +4738,6 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke
     }
 }
 
-void DitaXmlGenerator::writeNestedClasses(const Section& s, 
-                                          const ClassNode* cn, 
-                                          CodeMarker* marker)
-{
-}
-
 void DitaXmlGenerator::writeEnumerations(const Section& s, 
                                          const ClassNode* cn, 
                                          CodeMarker* marker)
@@ -4929,10 +4925,10 @@ void DitaXmlGenerator::writeProperties(const Section& s,
             writer.writeCharacters(pn->qualifiedDataType());
             writer.writeCharacters(" ");
             writer.writeCharacters(pn->name());
-            writerFunctions("READ",pn->getters());
-            writerFunctions("WRITE",pn->setters());
-            writerFunctions("RESET",pn->resetters());
-            writerFunctions("NOTIFY",pn->notifiers());
+            writePropParams("READ",pn->getters());
+            writePropParams("WRITE",pn->setters());
+            writePropParams("RESET",pn->resetters());
+            writePropParams("NOTIFY",pn->notifiers());
             if (pn->isDesignable() != pn->designableDefault()) {
                 writer.writeCharacters(" DESIGNABLE ");
                 if (!pn->runtimeDesignabilityFunction().isEmpty())
@@ -5058,7 +5054,92 @@ void DitaXmlGenerator::writeDataMembers(const Section& s,
     }
 }
 
-void DitaXmlGenerator::writerFunctions(const QString& tag, const NodeList& nlist)
+void DitaXmlGenerator::writeMacros(const Section& s, 
+                                   const ClassNode* cn, 
+                                   CodeMarker* marker)
+{
+    NodeList::ConstIterator m = s.members.begin();
+    while (m != s.members.end()) {
+        if ((*m)->type() == Node::Function) {
+            const FunctionNode* fn = static_cast<const FunctionNode*>(*m);
+            if (fn->isMacro()) {
+                writer.writeStartElement(CXXDEFINE);
+                writer.writeAttribute("id",fn->guid());
+                writer.writeStartElement(APINAME);
+                writer.writeCharacters(fn->name());
+                writer.writeEndElement(); // </apiName>
+                generateBrief(fn,marker);
+                writer.writeStartElement(CXXDEFINEDETAIL);
+                writer.writeStartElement(CXXDEFINEDEFINITION);
+                writer.writeStartElement(CXXDEFINEACCESSSPECIFIER);
+                writer.writeAttribute("value",fn->accessString());
+                writer.writeEndElement(); // <cxxDefineAccessSpecifier>
+            
+                writer.writeStartElement(CXXDEFINEPROTOTYPE);
+                writer.writeCharacters("#define ");
+                writer.writeCharacters(fn->name());
+                if (fn->metaness() == FunctionNode::MacroWithParams) {
+                    QStringList params = fn->parameterNames();
+                    if (!params.isEmpty()) {
+                        writer.writeCharacters("(");
+                        for (int i = 0; i < params.size(); ++i) {
+                            if (params[i].isEmpty())
+                                writer.writeCharacters("...");
+                            else
+                                writer.writeCharacters(params[i]);
+                            if ((i+1) < params.size()) 
+                                writer.writeCharacters(", ");
+                        }
+                        writer.writeCharacters(")");
+                    }
+                }
+                writer.writeEndElement(); // <cxxDefinePrototype>
+
+                writer.writeStartElement(CXXDEFINENAMELOOKUP);
+                writer.writeCharacters(fn->name());
+                writer.writeEndElement(); // <cxxDefineNameLookup>
+
+                if (fn->reimplementedFrom() != 0) {
+                    FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom();
+                    writer.writeStartElement(CXXDEFINEREIMPLEMENTED);
+                    writer.writeAttribute("href",rfn->ditaXmlHref());
+                    writer.writeCharacters(marker->plainFullName(rfn));
+                    writer.writeEndElement(); // </cxxDefineReimplemented>
+                }
+
+                if (fn->metaness() == FunctionNode::MacroWithParams) {
+                    QStringList params = fn->parameterNames();
+                    if (!params.isEmpty()) {
+                        writer.writeStartElement(CXXDEFINEPARAMETERS);
+                        for (int i = 0; i < params.size(); ++i) {
+                            writer.writeStartElement(CXXDEFINEPARAMETER);
+                            writer.writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME);
+                            writer.writeCharacters(params[i]);
+                            writer.writeEndElement(); // <cxxDefineParameterDeclarationName>
+                            writer.writeEndElement(); // <cxxDefineParameter>
+                        }
+                        writer.writeEndElement(); // <cxxDefineParameters>
+                    }
+                }
+
+                writeLocation(fn);
+                writer.writeEndElement(); // <cxxDefineDefinition>
+                writer.writeStartElement(APIDESC);
+
+                if (!fn->doc().isEmpty()) {
+                    generateBody(fn, marker);
+                }
+
+                writer.writeEndElement(); // </apiDesc>
+                writer.writeEndElement(); // </cxxDefineDetail>
+                writer.writeEndElement(); // </cxxDefine>
+            }
+        }
+        ++m;
+    }
+}
+
+void DitaXmlGenerator::writePropParams(const QString& tag, const NodeList& nlist)
 {
     NodeList::const_iterator n = nlist.begin();
     while (n != nlist.end()) {
diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h
index 26788d7..446f735 100644
--- a/tools/qdoc3/ditaxmlgenerator.h
+++ b/tools/qdoc3/ditaxmlgenerator.h
@@ -118,9 +118,6 @@ class DitaXmlGenerator : public PageGenerator
                         const ClassNode* cn, 
                         CodeMarker* marker);
     void writeParameters(const FunctionNode* fn, CodeMarker* marker);
-    void writeNestedClasses(const Section& s, 
-                            const ClassNode* cn, 
-                            CodeMarker* marker);
     void writeEnumerations(const Section& s, 
                            const ClassNode* cn, 
                            CodeMarker* marker);
@@ -133,7 +130,10 @@ class DitaXmlGenerator : public PageGenerator
     void writeProperties(const Section& s, 
                          const ClassNode* cn, 
                          CodeMarker* marker);
-    void writerFunctions(const QString& tag, const NodeList& nlist);
+    void writeMacros(const Section& s, 
+                     const ClassNode* cn, 
+                     CodeMarker* marker);
+    void writePropParams(const QString& tag, const NodeList& nlist);
 
  private:
     enum SubTitleSize { SmallSubTitle, LargeSubTitle };
-- 
cgit v0.12


From 7d0f824e023e8b4b45d67c1d3556c73d296bb5bd Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Mon, 28 Jun 2010 14:31:57 +0200
Subject: Add a manual test for regular widget interaction with the table.

The code paths are different if the tablet event is accepted or not.
This manuel test show the events received from tablet and mouse to
make sure we get the right events in the right order.
---
 tests/manual/qtabletevent/regular_widgets/main.cpp | 109 +++++++++++++++++++++
 .../regular_widgets/regular_widgets.pro            |   3 +
 2 files changed, 112 insertions(+)
 create mode 100644 tests/manual/qtabletevent/regular_widgets/main.cpp
 create mode 100644 tests/manual/qtabletevent/regular_widgets/regular_widgets.pro

diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp
new file mode 100644
index 0000000..e0c53f5
--- /dev/null
+++ b/tests/manual/qtabletevent/regular_widgets/main.cpp
@@ -0,0 +1,109 @@
+#include <QApplication>
+#include <QDebug>
+#include <QMouseEvent>
+#include <QTabletEvent>
+#include <QWidget>
+
+class EventReportWidget : public QWidget
+{
+public:
+    EventReportWidget();
+protected:
+    void mouseDoubleClickEvent(QMouseEvent *event) { outputMouseEvent(event); }
+    void mouseMoveEvent(QMouseEvent *event) { outputMouseEvent(event); }
+    void mousePressEvent(QMouseEvent *event) { outputMouseEvent(event); }
+    void mouseReleaseEvent(QMouseEvent *event) { outputMouseEvent(event); }
+
+    void tabletEvent(QTabletEvent *);
+
+private:
+    void outputMouseEvent(QMouseEvent *event);
+
+    bool m_lastIsMouseMove;
+    bool m_lastIsTabletMove;
+};
+
+EventReportWidget::EventReportWidget()
+    : m_lastIsMouseMove(false)
+    , m_lastIsTabletMove(false)
+{ }
+
+void EventReportWidget::tabletEvent(QTabletEvent *event)
+{
+    QWidget::tabletEvent(event);
+
+    QString type;
+    switch (event->type()) {
+    case QEvent::TabletEnterProximity:
+        m_lastIsTabletMove = false;
+        type = QString::fromLatin1("TabletEnterProximity");
+        break;
+    case QEvent::TabletLeaveProximity:
+        m_lastIsTabletMove = false;
+        type = QString::fromLatin1("TabletLeaveProximity");
+        break;
+    case QEvent::TabletMove:
+        if (m_lastIsTabletMove)
+            return;
+
+        m_lastIsTabletMove = true;
+        type = QString::fromLatin1("TabletMove");
+        break;
+    case QEvent::TabletPress:
+        m_lastIsTabletMove = false;
+        type = QString::fromLatin1("TabletPress");
+        break;
+    case QEvent::TabletRelease:
+        m_lastIsTabletMove = false;
+        type = QString::fromLatin1("TabletRelease");
+        break;
+    default:
+        Q_ASSERT(false);
+        break;
+    }
+
+    qDebug() << "Tablet event, type = " << type
+             << " position = " << event->pos()
+             << " global position = " << event->globalPos();
+}
+
+void EventReportWidget::outputMouseEvent(QMouseEvent *event)
+{
+    QString type;
+    switch (event->type()) {
+    case QEvent::MouseButtonDblClick:
+        m_lastIsMouseMove = false;
+        type = QString::fromLatin1("MouseButtonDblClick");
+        break;
+    case QEvent::MouseButtonPress:
+        m_lastIsMouseMove = false;
+        type = QString::fromLatin1("MouseButtonPress");
+        break;
+    case QEvent::MouseButtonRelease:
+        m_lastIsMouseMove = false;
+        type = QString::fromLatin1("MouseButtonRelease");
+        break;
+    case QEvent::MouseMove:
+        if (m_lastIsMouseMove)
+            return; // only show one move to keep things readable
+
+        m_lastIsMouseMove = true;
+        type = QString::fromLatin1("MouseMove");
+        break;
+    default:
+        Q_ASSERT(false);
+        break;
+    }
+
+    qDebug() << "Mouse event, type = " << type
+             << " position = " << event->pos()
+             << " global position = " << event->globalPos();
+}
+
+int main(int argc, char *argv[])
+{
+    QApplication app(argc, argv);
+    EventReportWidget widget;
+    widget.show();
+    return app.exec();
+}
diff --git a/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro
new file mode 100644
index 0000000..9f0da76
--- /dev/null
+++ b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro
@@ -0,0 +1,3 @@
+TEMPLATE = app
+
+SOURCES += main.cpp
-- 
cgit v0.12


From 163c46079e60d346142abc383dd8c237690f3fd2 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Mon, 28 Jun 2010 15:07:23 +0200
Subject: ignore *.vcxproj.user

---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index f187b23..fdb6843 100644
--- a/.gitignore
+++ b/.gitignore
@@ -134,6 +134,7 @@ qrc_*.cpp
 *.ncb
 *.vcxproj
 *.vcxproj.filters
+*.vcxproj.user
 
 # MinGW generated files
 *.Debug
-- 
cgit v0.12


From 2bf44ff6edc32eafa6d9ecd15c7c17eccc6a2ff8 Mon Sep 17 00:00:00 2001
From: Kent Hansen <kent.hansen@nokia.com>
Date: Mon, 28 Jun 2010 15:20:57 +0200
Subject: Updated JavaScriptCore from
 /home/khansen/dev/qtwebkit-qtscript-integration to
 javascriptcore-snapshot-28062010 ( 0fccd26d3624e80cf68873701ef70ad72ca66bec )

Changes in this update:

- Fix Mac OS SnowLeopard-vs-Leopard deployment issue
- Fix compilation with Intel compiler
---
 .../javascriptcore/JavaScriptCore/ChangeLog        | 46 ++++++++++++++++++++++
 .../JavaScriptCore/bytecode/Opcode.h               |  2 +-
 .../javascriptcore/JavaScriptCore/wtf/Platform.h   |  9 ++++-
 .../javascriptcore/JavaScriptCore/wtf/Vector.h     |  2 +-
 src/3rdparty/javascriptcore/VERSION                |  2 +-
 5 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
index b0873ab..93431df 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog
@@ -1,3 +1,49 @@
+2010-06-19  Thiago Macieira <thiago.macieira@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Don't use __attribute__((may_alias)) with the Intel compiler,
+        as it doesn't understand it.
+
+        * wtf/Vector.h:
+
+2010-06-19  Thiago Macieira <thiago.macieira@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix compilation with the Intel C++ compiler (11.1.072).
+
+        Like RVCT, label pointers must be void*, not const void*.
+
+        * bytecode/Opcode.h:
+
+2010-06-19  Thiago Macieira <thiago.macieira@nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add the WTF_COMPILER_INTEL for when the Intel compiler is used
+        for building. Usually, the Intel compiler masquerades as
+        another compiler in the system and gets away with it, but some
+        times specific fixes are required (such as when using language
+        extensions).
+
+        * wtf/Platform.h:
+
+2010-06-07  Benjamin Poulain  <benjamin.poulain@nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Crash when compiling on Snow Leopard and running on Leopard
+        https://bugs.webkit.org/show_bug.cgi?id=31403
+
+        Disable the use of pthread_setname_np and other symbols
+        when targetting Leopard.
+
+        Use the defines TARGETING_XX instead of BUILDING_ON_XX 
+        for features that cannot be used before Snow Leopard.
+
+        * wtf/Platform.h:
+
 2010-05-10  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
 
         Reviewed by Darin Adler.
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
index d9b2153..9ac17ec 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/bytecode/Opcode.h
@@ -196,7 +196,7 @@ namespace JSC {
     #undef VERIFY_OPCODE_ID
 
 #if HAVE(COMPUTED_GOTO)
-#if COMPILER(RVCT)
+#if COMPILER(RVCT) || COMPILER(INTEL)
     typedef void* Opcode;
 #else
     typedef const void* Opcode;
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
index be5f51b..5abe9a1 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
@@ -98,6 +98,11 @@
 #define WTF_COMPILER_WINSCW 1
 #endif
 
+/* COMPILER(INTEL) - Intel C++ Compiler */
+#if defined(__INTEL_COMPILER)
+#define WTF_COMPILER_INTEL 1
+#endif
+
 /* COMPILER(ACC) - HP aCC */
 #if defined(__HP_aCC)
 #define WTF_COMPILER_ACC 1
@@ -703,11 +708,11 @@
 #define HAVE_SYS_TIME_H 1
 #define HAVE_SYS_TIMEB_H 1
 
-#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
 
 #define HAVE_DISPATCH_H 1
 
-#if !PLATFORM(IPHONE) && !PLATFORM(QT)
+#if !PLATFORM(IPHONE)
 #define HAVE_MADV_FREE_REUSE 1
 #define HAVE_MADV_FREE 1
 #define HAVE_PTHREAD_SETNAME_NP 1
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
index 8a4ffba..156ff1a 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h
@@ -48,7 +48,7 @@ namespace WTF {
         #define WTF_ALIGN_OF(type)   0
     #endif
 
-    #if COMPILER(GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
+    #if COMPILER(GCC) && !COMPILER(INTEL) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
         typedef char __attribute__((__may_alias__)) AlignedBufferChar; 
     #else
         typedef char AlignedBufferChar; 
diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION
index 4e01d20..6f5fb7c 100644
--- a/src/3rdparty/javascriptcore/VERSION
+++ b/src/3rdparty/javascriptcore/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
 
 and has the sha1 checksum
 
-        f483443ccd7d21f2a57a794c4d00a63505d2f5d9
+        0fccd26d3624e80cf68873701ef70ad72ca66bec
-- 
cgit v0.12


From b1b46a21ea4aae5711130850e1bb19b0728a22ec Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Mon, 28 Jun 2010 15:42:20 +0200
Subject: Fix an assertion in comp_func_SourceOver_sse2() if const_alpha == 0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Const_alpha == 0 is a corner case that can happen if the painter draw
with zero opacity or if the multiplication of alphas is below 1.

The assertion was failing for one of the test of QPainter.

Reviewed-by: Samuel Rødal
---
 src/gui/painting/qdrawhelper_sse2.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index 04fe825..6cd8688 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -299,7 +299,7 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
 
 void QT_FASTCALL comp_func_SourceOver_sse2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha)
 {
-    Q_ASSERT(const_alpha > 0); // if const_alpha == 0, this should never be called
+    Q_ASSERT(const_alpha >= 0);
     Q_ASSERT(const_alpha < 256);
 
     const quint32 *src = (const quint32 *) srcPixels;
-- 
cgit v0.12


From 2b599833c61de7bb164b0dffb5e28194d311972b Mon Sep 17 00:00:00 2001
From: John Brooks <special@dereferenced.net>
Date: Mon, 28 Jun 2010 20:13:50 +0200
Subject: Enable SSE2 for MSVC x64 builds, as it was incorrectly disabled

Merge-request: 718
Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
---
 src/corelib/global/qglobal.h | 6 ++----
 src/corelib/tools/qsimd_p.h  | 3 ++-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1eab394..76f35ac 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -412,15 +412,13 @@ namespace QT_NAMESPACE {}
 #  if defined(__INTEL_COMPILER)
 #    define Q_CC_INTEL
 #  endif
-/* x64 does not support mmx intrinsics on windows */
-#  if (defined(Q_OS_WIN64) && defined(_M_X64))
+/* MSVC does not support SSE/MMX on x64 */
+#  if (defined(Q_CC_MSVC) && defined(_M_X64))
 #    undef QT_HAVE_SSE
-#    undef QT_HAVE_SSE2
 #    undef QT_HAVE_MMX
 #    undef QT_HAVE_3DNOW
 #  endif
 
-
 #elif defined(__BORLANDC__) || defined(__TURBOC__)
 #  define Q_CC_BOR
 #  define Q_INLINE_TEMPLATE
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index cbe6146..58d2dcb 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -58,7 +58,8 @@ QT_BEGIN_HEADER
 #endif
 
 // SSE intrinsics
-#if defined(__SSE2__) && defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED)
+#if defined(QT_HAVE_SSE2) && !defined(QT_BOOTSTRAPPED) && (defined(__SSE2__) \
+    || (defined(Q_CC_MSVC) && (defined(_M_X64) || _M_IX86_FP == 2)))
 #if defined(QT_LINUXBASE)
 /// this is an evil hack - the posix_memalign declaration in LSB
 /// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431
-- 
cgit v0.12


From c1f7b33016db39f8e2d24d9a3dcd2df57e27c6e9 Mon Sep 17 00:00:00 2001
From: Jukka Rissanen <jukka.rissanen@nokia.com>
Date: Mon, 28 Jun 2010 12:03:13 +0300
Subject: When application calls QNetworkSession::close() or
 QNetworkSession::stop(), make sure the disconnected signal is sent even if
 the actual network connection is not closed.

Fixes: NB#175064 - QNetworkSession signals wrong state after calling stop()
---
 src/plugins/bearer/icd/qnetworksession_impl.cpp | 55 +++++++++++++++----------
 1 file changed, 33 insertions(+), 22 deletions(-)

diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index a6acce0..e375b4f 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -879,9 +879,28 @@ void QNetworkSessionPrivateImpl::close()
         lastError = QNetworkSession::OperationNotSupportedError;
         emit QNetworkSessionPrivate::error(lastError);
     } else if (isOpen) {
-        opened = false;
-        isOpen = false;
-        emit closed();
+        if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
+	    // We will not wait any disconnect from icd as it might never come
+	    Maemo::Icd icd;
+#ifdef BEARER_MANAGEMENT_DEBUG
+	    qDebug() << "closing session" << publicConfig.identifier();
+#endif
+	    state = QNetworkSession::Closing;
+	    emit stateChanged(state);
+
+	    opened = false;
+	    isOpen = false;
+
+	    // we fake a disconnection, session error is not sent
+	    updateState(QNetworkSession::Disconnected);
+
+	    icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
+	    startTime = QDateTime();
+        } else {
+	    opened = false;
+	    isOpen = false;
+	    emit closed();
+	}
     }
 }
 
@@ -896,33 +915,25 @@ void QNetworkSessionPrivateImpl::stop()
         emit QNetworkSessionPrivate::error(lastError);
     } else {
         if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
-            if (!m_stopTimer.isActive()) {
-                Maemo::Icd icd;
+	    Maemo::Icd icd;
 #ifdef BEARER_MANAGEMENT_DEBUG
-                qDebug() << "stopping session" << publicConfig.identifier();
+	    qDebug() << "stopping session" << publicConfig.identifier();
 #endif
-                state = QNetworkSession::Closing;
-                emit stateChanged(state);
-
-                opened = false;
-                isOpen = false;
+	    state = QNetworkSession::Closing;
+	    emit stateChanged(state);
 
-                icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
-                startTime = QDateTime();
+	    // we fake a disconnection, a session error is sent also
+	    updateState(QNetworkSession::Disconnected);
 
-                /* Note: Session state will change to disconnected
-                 *       as soon as QNetworkConfigurationManager sends
-                 *       corresponding iapStateChanged signal.
-                 */
+	    opened = false;
+	    isOpen = false;
 
-                // Make sure that this Session will send closed signal
-                // even though ICD connection will not ever get closed
-                m_stopTimer.start(ICD_SHORT_CONNECT_TIMEOUT); // 10 seconds wait
-            }
+	    icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
+	    startTime = QDateTime();
         } else {
 	    opened = false;
 	    isOpen = false;
-        emit closed();
+	    emit closed();
 	}
     }
 }
-- 
cgit v0.12


From 8df35c03963dccc5a24caa8f5ab4c956ba87bcfd Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Fri, 25 Jun 2010 11:32:06 +0200
Subject: Removed useless comments.

Not relevant anymore after 5b5ae51b22b.
---
 mkspecs/features/symbian/symbian_building.prf | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 08ab3e7..1a691a9 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -104,9 +104,6 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
 
     contains(CONFIG, plugin):QMAKE_ELF2E32_FLAGS += --definput=plugin_commonu.def
 
-    # The tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error.
-    # The comparison of dso files is to avoid extra building of modules that depend on this dso, in
-    # case it has not changed.
     QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET}.dll $$symbianDestdir/$${TARGET}.sym \
                       && elf2e32_qtwrapper  --version=$$decVersion \
                       --sid=$$TARGET.SID \
@@ -155,7 +152,6 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
         QMAKE_POST_LINK = $$replace(QMAKE_POST_LINK, "^@", "")
         QMAKE_POST_LINK = && $$QMAKE_POST_LINK
     }
-    # the tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error
     QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym \
                       && elf2e32_qtwrapper  --version $$decVersion \
                       --sid=$$TARGET.SID \
-- 
cgit v0.12


From d3f6e14066219a957f48d24e9f39d3d0c5a61f53 Mon Sep 17 00:00:00 2001
From: Zeno Albisser <zeno.albisser@nokia.com>
Date: Tue, 29 Jun 2010 10:33:03 +0200
Subject: added a comment for QByteArray::replace(..)

Reviewed-by: Thomas Zander
Task-number: QTBUG-8370
---
 src/corelib/tools/qbytearray.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 05d38f6..b46af1f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1805,6 +1805,11 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after)
 /*! \fn QByteArray &QByteArray::replace(int pos, int len, const char *after)
 
     \overload
+
+    Replaces \a len bytes from index position \a pos with the zero terminated
+    string \a after.
+
+    Notice: this can change the lenght of the byte array.
 */
 QByteArray &QByteArray::replace(int pos, int len, const char *after)
 {
-- 
cgit v0.12


From 1209a398c3b59b21b38036fffd4fb2442320e5c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Samuel=20R=C3=B8dal?= <samuel.rodal@nokia.com>
Date: Tue, 29 Jun 2010 12:51:53 +0200
Subject: Made -graphicssystem trace work with Qt::TextBypassShaping flag.

The QPaintBuffer gets the text from the text item in order to stream it.

Reviewed-by: Jocelyn Turcotte
---
 src/gui/painting/qpainter.cpp | 2 +-
 src/gui/text/qtextengine.cpp  | 4 ++--
 src/gui/text/qtextengine_p.h  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 71bc990..2ea6673 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5958,7 +5958,7 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif
                 Q_ASSERT_X(false, Q_FUNC_INFO, "stringToCMap shouldn't fail twice");
         }
 
-        QTextItemInt gf(glyphs, &d->state->font, fontEngine);
+        QTextItemInt gf(glyphs, &d->state->font, str.data(), len, fontEngine);
         drawTextItem(p, gf);
         return;
     }
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 60195a8..439f2a4 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2668,9 +2668,9 @@ QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFo
         flags |= QTextItem::StrikeOut;
 }
 
-QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, QFontEngine *fe)
+QTextItemInt::QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars_, int numChars, QFontEngine *fe)
     : flags(0), justified(false), underlineStyle(QTextCharFormat::NoUnderline),
-      num_chars(0), chars(0), logClusters(0), f(font),  glyphs(g), fontEngine(fe)
+      num_chars(numChars), chars(chars_), logClusters(0), f(font),  glyphs(g), fontEngine(fe)
 {
 }
 
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index 908a0ec..e623fa5 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -311,7 +311,7 @@ public:
           logClusters(0), f(0), fontEngine(0)
     {}
     QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
-    QTextItemInt(const QGlyphLayout &g, QFont *font, QFontEngine *fe);
+    QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe);
 
     /// copy the structure items, adjusting the glyphs arrays to the right subarrays.
     /// the width of the returned QTextItemInt is not adjusted, for speed reasons
-- 
cgit v0.12


From 704f8c2ccde7a01d5ecc6c13ff5cc1d5f5b09519 Mon Sep 17 00:00:00 2001
From: Arvid Picciani <aep@hereticlinux.org>
Date: Tue, 29 Jun 2010 13:48:35 +0200
Subject: syncqt: abort on permission error writing to include/Qt

Merge-request: 707
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
---
 bin/syncqt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/syncqt b/bin/syncqt
index f499bbc..11b1d72 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -834,12 +834,12 @@ foreach (@modules_to_sync) {
                             # write forwarding headers to include/Qt
                             if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/) {
                                 my $file_name = "$out_basedir/include/Qt/$header";
+                                my $file_op = '>';
                                 my $header_content = '';
                                 if (exists $colliding_headers{$file_name}) {
-                                    $file_name = ">>$file_name";
+                                    $file_op = '>>';
                                 } else {
                                     $colliding_headers{$file_name} = 1;
-                                    $file_name = ">$file_name";
                                     my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.';
                                     $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" .
                                                       "    #if defined(__GNUC__)\n" .
@@ -850,7 +850,7 @@ foreach (@modules_to_sync) {
                                                       "#endif\n\n";
                                 }
                                 $header_content .= '#include "' . "../$lib/$header" . "\"\n";
-                                open HEADERFILE, $file_name;
+                                open HEADERFILE, $file_op, $file_name or die "unable to open '$file_name' : $!\n";
                                 print HEADERFILE $header_content;
                                 close HEADERFILE;
                             }
-- 
cgit v0.12


From 43498a0994eb949e94e9635be68b88567e55831c Mon Sep 17 00:00:00 2001
From: John Brooks <special@dereferenced.net>
Date: Tue, 29 Jun 2010 14:01:38 +0200
Subject: Improved QCommandLinkButton's vertical spacing

When no description is present, the text is centered alongside the
icon. The top and bottom margins are now an equal 10px.

Merge-request: 2424
Reviewed-by: Jens Bache-Wiig <jbache@trolltech.com>
---
 src/gui/widgets/qcommandlinkbutton.cpp | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp
index e8fe299..d3b5869 100644
--- a/src/gui/widgets/qcommandlinkbutton.cpp
+++ b/src/gui/widgets/qcommandlinkbutton.cpp
@@ -118,7 +118,7 @@ public:
     int topMargin() const { return 10; }
     int leftMargin() const { return 7; }
     int rightMargin() const { return 4; }
-    int bottomMargin() const { return 4; }
+    int bottomMargin() const { return 10; }
 
     QString description;
     QColor currentColor;
@@ -174,8 +174,15 @@ QFont QCommandLinkButtonPrivate::descriptionFont() const
 QRect QCommandLinkButtonPrivate::titleRect() const
 {
     Q_Q(const QCommandLinkButton);
-    return q->rect().adjusted(textOffset(), topMargin(),
-                              -rightMargin(), 0);
+    QRect r = q->rect().adjusted(textOffset(), topMargin(), -rightMargin(), 0);
+    if (description.isEmpty())
+    {
+        QFontMetrics fm(titleFont());
+        r.setTop(r.top() + qMax(0, (q->icon().actualSize(q->iconSize()).height()
+                 - fm.height()) / 2));
+    }
+
+    return r;
 }
 
 QRect QCommandLinkButtonPrivate::descriptionRect() const
@@ -254,7 +261,7 @@ QSize QCommandLinkButton::minimumSizeHint() const
     Q_D(const QCommandLinkButton);
     QSize size = sizeHint();
     int minimumHeight = qMax(d->descriptionOffset() + d->bottomMargin(),
-                             iconSize().height() + d->topMargin());
+                             icon().actualSize(iconSize()).height() + d->topMargin());
     size.setHeight(minimumHeight);
     return size;
 }
@@ -328,7 +335,8 @@ int QCommandLinkButton::heightForWidth(int width) const
     int heightWithoutDescription = d->descriptionOffset() + d->bottomMargin();
     // find the width available for the description area
     return qMax(heightWithoutDescription + d->descriptionHeight(width),
-                iconSize().height() + d->topMargin() + d->bottomMargin());
+                icon().actualSize(iconSize()).height() + d->topMargin() +
+                d->bottomMargin());
 }
 
 /*! \reimp */
-- 
cgit v0.12


From 99c408a8efdaa16363f29c0e67fe97b3c8a7f1c4 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Fri, 25 Jun 2010 14:57:37 +0200
Subject: Fixed Symbian resources not honoring TARGET with a path.

Task:     QT-3540
RevBy:    Thomas Zander
---
 mkspecs/features/sis_targets.prf              |  25 ++++---
 mkspecs/features/symbian/symbian_building.prf | 104 +++++++++++++-------------
 2 files changed, 66 insertions(+), 63 deletions(-)

diff --git a/mkspecs/features/sis_targets.prf b/mkspecs/features/sis_targets.prf
index 4207e0b..c31e38f 100644
--- a/mkspecs/features/sis_targets.prf
+++ b/mkspecs/features/sis_targets.prf
@@ -126,35 +126,38 @@ equals(GENERATE_SIS_TARGETS, true) {
         }
     } else {
         sis_destdir = $$DESTDIR
-        !isEmpty(sis_destdir):!contains(sis_destdir, "[/\\\\]$"):sis_destdir = $${sis_destdir}/
-        contains(QMAKE_HOST.os, "Windows"):sis_destdir = $$replace(sis_destdir, "/", "\\")
+        isEmpty(sis_destdir):sis_destdir = .
+        baseTarget = $$basename(TARGET)
+        !equals(TARGET, "$$baseTarget"):sis_destdir = $$sis_destdir/$$dirname(TARGET)
 
         sis_target.target = sis
-        sis_target.commands = createpackage $(QT_SIS_OPTIONS) $$basename(TARGET)_template.pkg \
+        sis_target.commands = createpackage $(QT_SIS_OPTIONS) $${baseTarget}_template.pkg \
                                   - $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
         sis_target.depends = first
 
         unsigned_sis_target.target = unsigned_sis
-        unsigned_sis_target.commands = createpackage $(QT_SIS_OPTIONS) -o $$basename(TARGET)_template.pkg
+        unsigned_sis_target.commands = createpackage $(QT_SIS_OPTIONS) -o $${baseTarget}_template.pkg
         unsigned_sis_target.depends = first
 
-        target_sis_target.target = $${sis_destdir}$${TARGET}.sis
+        target_sis_target.target = $${sis_destdir}/$${baseTarget}.sis
         target_sis_target.commands = $(MAKE) -f $(MAKEFILE) sis
 
         installer_sis_target.target = installer_sis
-        installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) $$basename(TARGET)_installer.pkg - \
+        installer_sis_target.commands = createpackage $(QT_SIS_OPTIONS) $${baseTarget}_installer.pkg - \
                                             $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)
-        installer_sis_target.depends = $${sis_destdir}$${TARGET}.sis
+        installer_sis_target.depends = $${sis_destdir}/$${baseTarget}.sis
 
-        !isEmpty(DESTDIR) {
-            sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR
-            installer_sis_target.commands += && $$QMAKE_MOVE $$basename(TARGET).sis $$DESTDIR
+        !isEmpty(sis_destdir):!equals(sis_destdir, "."):!equals(sis_destdir, "./") {
+            sis_target.commands += && $$QMAKE_MOVE $${baseTarget}.sis $$sis_destdir
+            installer_sis_target.commands += && $$QMAKE_MOVE $${baseTarget}.sis $$sis_destdir
         }
 
         QMAKE_EXTRA_TARGETS += sis_target \
                                unsigned_sis_target \
                                target_sis_target \
                                installer_sis_target
+
+        QMAKE_DISTCLEAN += $${sis_destdir}/$${baseTarget}.sis
     }
 } else {
     contains(TEMPLATE, subdirs) {
@@ -177,5 +180,3 @@ equals(GENERATE_SIS_TARGETS, true) {
         QMAKE_EXTRA_TARGETS += store_build_target
     }
 }
-
-QMAKE_DISTCLEAN += $${sis_destdir}$${TARGET}.sis
diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf
index 08ab3e7..744580f 100644
--- a/mkspecs/features/symbian/symbian_building.prf
+++ b/mkspecs/features/symbian/symbian_building.prf
@@ -21,6 +21,8 @@ symbianDestdir=$$DESTDIR
 isEmpty(symbianDestdir) {
     symbianDestdir = .
 }
+baseTarget = $$basename(TARGET)
+!equals(TARGET, "$$baseTarget"):symbianDestdir = $$symbianDestdir/$$dirname(TARGET)
 
 contains(QMAKE_CFLAGS, "--thumb")|contains(QMAKE_CXXFLAGS, "--thumb")|contains(QMAKE_CFLAGS, "-mthumb")|contains(QMAKE_CXXFLAGS, "-mthumb") {
     DEFINES += __MARM_THUMB__
@@ -107,29 +109,29 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
     # The tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error.
     # The comparison of dso files is to avoid extra building of modules that depend on this dso, in
     # case it has not changed.
-    QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET}.dll $$symbianDestdir/$${TARGET}.sym \
+    QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget}.dll $$symbianDestdir/$${baseTarget}.sym \
                       && elf2e32_qtwrapper  --version=$$decVersion \
                       --sid=$$TARGET.SID \
                       --uid1=0x10000079 \
                       --uid2=$$TARGET.UID2 \
                       --uid3=$$TARGET.UID3 \
                       --targettype=DLL \
-                      --elfinput=$${symbianDestdir}/$${TARGET}.sym \
-                      --output=$${symbianDestdir}/$${TARGET}.dll \
-                      --tmpdso=$${symbianObjdir}/$${TARGET}.dso \
-                      --dso=$${symbianDestdir}/$${TARGET}.dso \
-                      --defoutput=$$symbianObjdir/$${TARGET}.def \
-                      --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
+                      --elfinput=$${symbianDestdir}/$${baseTarget}.sym \
+                      --output=$${symbianDestdir}/$${baseTarget}.dll \
+                      --tmpdso=$${symbianObjdir}/$${baseTarget}.dso \
+                      --dso=$${symbianDestdir}/$${baseTarget}.dso \
+                      --defoutput=$$symbianObjdir/$${baseTarget}.def \
+                      --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll \
                       --heap=$$epoc_heap_size \
                       --stack=$$TARGET.EPOCSTACKSIZE \
                       $$elf2e32_LIBPATH \
                       $$capability \
                       $$QMAKE_ELF2E32_FLAGS \
                       $$QMAKE_POST_LINK
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.dso
-    QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.dso
-    QMAKE_CLEAN += $${symbianObjdir}/$${TARGET}.def
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.dso
+    QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.dso
+    QMAKE_CLEAN += $${symbianObjdir}/$${baseTarget}.def
 
     linux-armcc: {
         LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
@@ -145,7 +147,7 @@ contains(TEMPLATE, lib):!contains(CONFIG, static):!contains(CONFIG, staticlib) {
             -lgcc
     }
 
-    QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
+    QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].dll
     DEFINES += __DLL__
 }
 
@@ -156,26 +158,26 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
         QMAKE_POST_LINK = && $$QMAKE_POST_LINK
     }
     # the tee and grep at the end work around the issue that elf2e32 doesn't return non-null on error
-    QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${TARGET} $$symbianDestdir/$${TARGET}.sym \
+    QMAKE_POST_LINK = $$QMAKE_MOVE $$symbianDestdir/$${baseTarget} $$symbianDestdir/$${baseTarget}.sym \
                       && elf2e32_qtwrapper  --version $$decVersion \
                       --sid=$$TARGET.SID \
                       --uid1=0x1000007a \
                       --uid2=$$TARGET.UID2 \
                       --uid3=$$TARGET.UID3 \
                       --targettype=EXE \
-                      --elfinput=$${symbianDestdir}/$${TARGET}.sym \
-                      --output=$${symbianDestdir}/$${TARGET}.exe \
-                      --linkas=$${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
+                      --elfinput=$${symbianDestdir}/$${baseTarget}.sym \
+                      --output=$${symbianDestdir}/$${baseTarget}.exe \
+                      --linkas=$${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe \
                       --heap=$$epoc_heap_size \
                       --stack=$$TARGET.EPOCSTACKSIZE \
                       $$elf2e32_LIBPATH \
                       $$capability \
                       $$QMAKE_ELF2E32_FLAGS \
-                      && ln "$${symbianDestdir}/$${TARGET}.exe" "$${symbianDestdir}/$$TARGET" \
+                      && ln "$${symbianDestdir}/$${baseTarget}.exe" "$${symbianDestdir}/$${baseTarget}" \
                       $$QMAKE_POST_LINK
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.sym
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}.exe
-    QMAKE_CLEAN += $${symbianDestdir}/$${TARGET}
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.sym
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.exe
+    QMAKE_CLEAN += $${symbianDestdir}/$${baseTarget}
 
     linux-armcc: {
         QMAKE_LIBS += usrt2_2.lib dfpaeabi.dso dfprvct2_2.dso drtaeabi.dso scppnwdl.dso drtrvct2_2.dso h_t__uf.l\\(switch8.o\\)
@@ -204,7 +206,7 @@ contains(TEMPLATE, app):!contains(QMAKE_LINK, "^@.*") {
         QMAKE_LFLAGS += --shared
     }
 
-    QMAKE_LFLAGS += --soname $${TARGET}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
+    QMAKE_LFLAGS += --soname $${baseTarget}\\{$${hexVersion}\\}\\[$${intUid3}\\].exe
     DEFINES += __EXE__
 }
 
@@ -245,47 +247,47 @@ symbianresources.CONFIG = no_link target_predeps
 QMAKE_EXTRA_COMPILERS += symbianresources
 
 contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
-    baseTarget = $$basename(TARGET)
+    baseResourceTarget = $$basename(TARGET)
     # If you change this, also see application_icon.prf
-    baseTarget = $$replace(baseTarget, " ",_)
+    baseResourceTarget = $$replace(baseResourceTarget, " ",_)
 
     # Make our own extra target in order to get dependencies for generated
     # files right. This also avoids the warning about files not found.
-    symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
+    symbianGenResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
     symbianGenResource.commands = cpp -nostdinc -undef \
                                   $$symbian_resources_INCLUDES \
                                   $$symbian_resources_DEFINES \
-                                  $${baseTarget}.rss \
-                                  -o $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
+                                  $${baseResourceTarget}.rss \
+                                  -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
                                   && rcomp -u -m045,046,047 \
-                                  -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \
-                                  -o$${symbianDestdir}/$${baseTarget}.rsc \
-                                  -h$${symbian_resources_RCC_DIR}/$${baseTarget}.rsg \
-                                  -i$${baseTarget}.rss
-    symbianGenResource.depends = $${baseTarget}.rss
-    PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
-    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
-    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp
-    QMAKE_DISTCLEAN += $${baseTarget}.rss
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseTarget}.rsc
+                                  -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp \
+                                  -o$${symbianDestdir}/$${baseResourceTarget}.rsc \
+                                  -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg \
+                                  -i$${baseResourceTarget}.rss
+    symbianGenResource.depends = $${baseResourceTarget}.rss
+    PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rpp
+    QMAKE_DISTCLEAN += $${baseResourceTarget}.rss
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}.rsc
 
-    symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
+    symbianGenRegResource.target = $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
     symbianGenRegResource.commands = cpp -nostdinc -undef \
                                      $$symbian_resources_INCLUDES \
                                      $$symbian_resources_DEFINES \
-                                     $${baseTarget}_reg.rss \
-                                     -o $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
+                                     $${baseResourceTarget}_reg.rss \
+                                     -o $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
                                      && rcomp -u -m045,046,047 \
-                                     -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \
-                                     -o$${symbianDestdir}/$${baseTarget}_reg.rsc \
-                                     -h$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg \
-                                     -i$${baseTarget}_reg.rss
-    symbianGenRegResource.depends = $${baseTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseTarget}.rsg
-    PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
-    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rsg
-    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp
-    QMAKE_DISTCLEAN += $${TARGET}_reg.rss
-    QMAKE_DISTCLEAN += $${symbianDestdir}/$${TARGET}_reg.rsc
+                                     -s$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp \
+                                     -o$${symbianDestdir}/$${baseResourceTarget}_reg.rsc \
+                                     -h$${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg \
+                                     -i$${baseResourceTarget}_reg.rss
+    symbianGenRegResource.depends = $${baseResourceTarget}_reg.rss $${symbian_resources_RCC_DIR}/$${baseResourceTarget}.rsg
+    PRE_TARGETDEPS += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rsg
+    QMAKE_CLEAN += $${symbian_resources_RCC_DIR}/$${baseResourceTarget}_reg.rpp
+    QMAKE_DISTCLEAN += $${baseResourceTarget}_reg.rss
+    QMAKE_DISTCLEAN += $${symbianDestdir}/$${baseResourceTarget}_reg.rsc
 
     # Trick to get qmake to create the RCC_DIR for us.
     symbianRccDirCreation.input = SOURCES
@@ -296,9 +298,9 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") {
     QMAKE_EXTRA_TARGETS += symbianGenResource symbianGenRegResource
     QMAKE_EXTRA_COMPILERS += symbianRccDirCreation
 
-    QMAKE_DISTCLEAN += $${TARGET}.loc
+    QMAKE_DISTCLEAN += $${baseTarget}.loc
 }
 
 # Generated pkg files
 
-QMAKE_DISTCLEAN += $${TARGET}_template.pkg
+QMAKE_DISTCLEAN += $${baseTarget}_template.pkg
-- 
cgit v0.12


From bbb3420e74ee005e0d2b688af65c4ecfe5771235 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Fri, 25 Jun 2010 16:45:57 +0200
Subject: Various fixes to autotests when using the symbian/linux-armcc mkspec.

---
 tests/auto/checkxmlfiles/checkxmlfiles.pro                        | 2 +-
 tests/auto/corelib.pro                                            | 7 +++++++
 tests/auto/gui.pro                                                | 8 ++++++++
 tests/auto/mediaobject/mediaobject.pro                            | 2 +-
 tests/auto/networkselftest/networkselftest.pro                    | 2 +-
 tests/auto/patternistexamples/patternistexamples.pro              | 2 +-
 .../qapplication/desktopsettingsaware/desktopsettingsaware.pro    | 5 +++--
 tests/auto/qapplication/test/test.pro                             | 2 +-
 tests/auto/qaudiooutput/qaudiooutput.pro                          | 2 +-
 tests/auto/qchar/qchar.pro                                        | 4 ++--
 tests/auto/qclipboard/test/test.pro                               | 4 ++--
 tests/auto/qcryptographichash/qcryptographichash.pro              | 4 ++--
 tests/auto/qdiriterator/qdiriterator.pro                          | 2 +-
 tests/auto/qdom/qdom.pro                                          | 2 +-
 tests/auto/qfile/qfile.pro                                        | 2 +-
 tests/auto/qfileinfo/qfileinfo.pro                                | 2 +-
 tests/auto/qftp/qftp.pro                                          | 2 +-
 tests/auto/qgraphicsscene/qgraphicsscene.pro                      | 4 ++--
 tests/auto/qhash/qhash.pro                                        | 4 ++--
 tests/auto/qhttp/qhttp.pro                                        | 2 +-
 tests/auto/qicoimageformat/qicoimageformat.pro                    | 2 +-
 tests/auto/qimage/qimage.pro                                      | 2 +-
 tests/auto/qimagereader/qimagereader.pro                          | 2 +-
 tests/auto/qimagewriter/qimagewriter.pro                          | 2 +-
 tests/auto/qitemmodel/qitemmodel.pro                              | 2 +-
 tests/auto/qlayout/qlayout.pro                                    | 2 +-
 tests/auto/qlibrary/tst/tst.pro                                   | 2 +-
 tests/auto/qline/qline.pro                                        | 2 +-
 tests/auto/qlocalsocket/qlocalsocket.pro                          | 2 +-
 tests/auto/qmenubar/qmenubar.pro                                  | 2 +-
 tests/auto/qmovie/qmovie.pro                                      | 2 +-
 tests/auto/qpainter/qpainter.pro                                  | 2 +-
 tests/auto/qpathclipper/qpathclipper.pro                          | 2 +-
 tests/auto/qpixmap/qpixmap.pro                                    | 4 ++--
 tests/auto/qprocess/testDetached/testDetached.pro                 | 2 +-
 tests/auto/qresourceengine/qresourceengine.pro                    | 2 +-
 tests/auto/qscriptengine/qscriptengine.pro                        | 2 +-
 tests/auto/qset/qset.pro                                          | 4 ++--
 tests/auto/qsound/qsound.pro                                      | 2 +-
 tests/auto/qsplitter/qsplitter.pro                                | 2 +-
 tests/auto/qstyle/qstyle.pro                                      | 2 +-
 tests/auto/qtcpsocket/qtcpsocket.pro                              | 2 +-
 tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro            | 2 +-
 tests/auto/qtextbrowser/qtextbrowser.pro                          | 4 ++--
 tests/auto/qtextedit/qtextedit.pro                                | 2 +-
 tests/auto/qthread/qthread.pro                                    | 2 +-
 tests/auto/qthreadstorage/qthreadstorage.pro                      | 2 +-
 tests/auto/qtipc/qsharedmemory/test/test.pro                      | 2 +-
 tests/auto/qtransform/qtransform.pro                              | 2 +-
 tests/auto/qtranslator/qtranslator.pro                            | 2 +-
 tests/auto/qtwidgets/qtwidgets.pro                                | 2 +-
 tests/auto/qudpsocket/test/test.pro                               | 2 +-
 tests/auto/qwmatrix/qwmatrix.pro                                  | 2 +-
 tests/auto/qxml/qxml.pro                                          | 2 +-
 tests/auto/qxmlformatter/qxmlformatter.pro                        | 2 +-
 tests/auto/qxmlquery/qxmlquery.pro                                | 2 +-
 tests/auto/qxmlsimplereader/qxmlsimplereader.pro                  | 2 +-
 tests/auto/qxmlstream/qxmlstream.pro                              | 2 +-
 58 files changed, 81 insertions(+), 65 deletions(-)

diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro
index d53c11c..319ba9b 100644
--- a/tests/auto/checkxmlfiles/checkxmlfiles.pro
+++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro
@@ -6,7 +6,7 @@ QT -= gui
 
 include (../xmlpatterns.pri)
 
-wince*|symbian*: {
+wince*|symbian: {
 QT += network
 addFiles.sources = \
 	$$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \
diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro
index 259be4c..531fed2 100644
--- a/tests/auto/corelib.pro
+++ b/tests/auto/corelib.pro
@@ -101,3 +101,10 @@ SUBDIRS=\
    selftests \
    utf8 \
 
+symbian:SUBDIRS -= \
+   qtconcurrentfilter \
+   qtconcurrentiteratekernel \
+   qtconcurrentmap \
+   qtconcurrentrun \
+   qtconcurrentthreadengine \
+
diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro
index a8fd2b4..cfaa3fa 100644
--- a/tests/auto/gui.pro
+++ b/tests/auto/gui.pro
@@ -220,3 +220,11 @@ win32:SUBDIRS -= qtextpiecetable
            qstylesheetstyle \
            qtextpiecetable \
 
+symbian:SUBDIRS -= \
+    qhelpcontentmodel \
+    qhelpenginecore \
+    qhelpgenerator \
+    qhelpindexmodel \
+    qhelpprojectdata \
+    qsystemtrayicon \
+
diff --git a/tests/auto/mediaobject/mediaobject.pro b/tests/auto/mediaobject/mediaobject.pro
index bef2fe9..e887df4 100755
--- a/tests/auto/mediaobject/mediaobject.pro
+++ b/tests/auto/mediaobject/mediaobject.pro
@@ -14,7 +14,7 @@ wince*{
   DEFINES += tst_MediaObject=tst_MediaObject_waveout
 }
 
-symbian*:{
+symbian:{
    addFiles.sources = media/test.sdp
    addFiles.path = media
    DEPLOYMENT += addFiles
diff --git a/tests/auto/networkselftest/networkselftest.pro b/tests/auto/networkselftest/networkselftest.pro
index b0d537a..d7cb7f3 100644
--- a/tests/auto/networkselftest/networkselftest.pro
+++ b/tests/auto/networkselftest/networkselftest.pro
@@ -8,7 +8,7 @@ wince*: {
     addFiles.path = .
     DEPLOYMENT = addFiles
     DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
     addFiles.sources = rfc3252.txt
     addFiles.path = .
     DEPLOYMENT = addFiles
diff --git a/tests/auto/patternistexamples/patternistexamples.pro b/tests/auto/patternistexamples/patternistexamples.pro
index c528c93..f83e0aa 100644
--- a/tests/auto/patternistexamples/patternistexamples.pro
+++ b/tests/auto/patternistexamples/patternistexamples.pro
@@ -1,7 +1,7 @@
 load(qttest_p4)
 SOURCES += tst_patternistexamples.cpp
 CONFIG += qtestlib
-wince*|symbian*: {
+wince*|symbian: {
 	snippets.sources = $$QT_SOURCE_TREE/doc/src/snippets/patternist/*
 	snippets.path = patternist
 	widgetRen.sources = $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/widgetRenderer/*
diff --git a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
index e8b1ce9..3193764 100644
--- a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
+++ b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro
@@ -3,11 +3,12 @@
 ######################################################################
 
 TEMPLATE = app
-!symbian*: {
+!symbian: {
 DEPENDPATH += .
 INCLUDEPATH += .
 }
-wince*|symbian*:TARGET = ../desktopsettingsaware
+wince*:TARGET = ../desktopsettingsaware
+symbian:TARGET = desktopsettingsaware
 
 # Input
 SOURCES += main.cpp
diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro
index e68af26..30eb751 100644
--- a/tests/auto/qapplication/test/test.pro
+++ b/tests/auto/qapplication/test/test.pro
@@ -11,7 +11,7 @@ wince* {
   DEPLOYMENT = additional deploy someTest
 }
 
-symbian*: {
+symbian: {
   additional.sources = ../desktopsettingsaware/desktopsettingsaware.exe
   additional.path = desktopsettingsaware
   someTest.sources = test.pro
diff --git a/tests/auto/qaudiooutput/qaudiooutput.pro b/tests/auto/qaudiooutput/qaudiooutput.pro
index a6286ec..e1734e0 100644
--- a/tests/auto/qaudiooutput/qaudiooutput.pro
+++ b/tests/auto/qaudiooutput/qaudiooutput.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qaudiooutput.cpp
 
 QT = core multimedia
 
-wince*|symbian*: {
+wince*|symbian: {
     deploy.sources += 4.wav
     DEPLOYMENT = deploy
     !symbian {
diff --git a/tests/auto/qchar/qchar.pro b/tests/auto/qchar/qchar.pro
index a534d14..3813e4e 100644
--- a/tests/auto/qchar/qchar.pro
+++ b/tests/auto/qchar/qchar.pro
@@ -3,12 +3,12 @@ SOURCES  += tst_qchar.cpp
 
 QT = core
 
-wince*|symbian*: {
+wince*|symbian: {
 deploy.sources += NormalizationTest.txt
 DEPLOYMENT = deploy
 }
 
-symbian*: {
+symbian: {
     DEFINES += SRCDIR=""
 } else {
     DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro
index 62a38af..0f8cad1 100644
--- a/tests/auto/qclipboard/test/test.pro
+++ b/tests/auto/qclipboard/test/test.pro
@@ -10,13 +10,13 @@ win32 {
   }
 }
 
-wince*|symbian*: {
+wince*|symbian: {
   copier.sources = ../copier/copier.exe
   copier.path = copier
   paster.sources = ../paster/paster.exe  
   paster.path = paster
   
-  symbian*: {
+  symbian: {
     load(data_caging_paths)
     rsc.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc
     rsc.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc
diff --git a/tests/auto/qcryptographichash/qcryptographichash.pro b/tests/auto/qcryptographichash/qcryptographichash.pro
index aa9a7c4..7e1a866 100644
--- a/tests/auto/qcryptographichash/qcryptographichash.pro
+++ b/tests/auto/qcryptographichash/qcryptographichash.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
 SOURCES += tst_qcryptographichash.cpp
 QT = core
 
-symbian*: {
+symbian: {
 TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
 }
diff --git a/tests/auto/qdiriterator/qdiriterator.pro b/tests/auto/qdiriterator/qdiriterator.pro
index ece886c..d60b52d 100644
--- a/tests/auto/qdiriterator/qdiriterator.pro
+++ b/tests/auto/qdiriterator/qdiriterator.pro
@@ -3,7 +3,7 @@ SOURCES  += tst_qdiriterator.cpp
 RESOURCES      += qdiriterator.qrc
 QT = core
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = entrylist recursiveDirs foo
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qdom/qdom.pro b/tests/auto/qdom/qdom.pro
index 61914b5..5434ada 100644
--- a/tests/auto/qdom/qdom.pro
+++ b/tests/auto/qdom/qdom.pro
@@ -4,7 +4,7 @@ SOURCES  += tst_qdom.cpp
 QT = core xml
 QT -= gui
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = testdata doubleNamespaces.xml umlaut.xml
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qfile/qfile.pro b/tests/auto/qfile/qfile.pro
index 33fd2fd..0383e30 100644
--- a/tests/auto/qfile/qfile.pro
+++ b/tests/auto/qfile/qfile.pro
@@ -5,5 +5,5 @@ wince*:{
   SUBDIRS = test stdinprocess
 }
 
-!symbian*:SUBDIRS += largefile
+!symbian:SUBDIRS += largefile
 
diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro
index 2038514..ef5ed22 100644
--- a/tests/auto/qfileinfo/qfileinfo.pro
+++ b/tests/auto/qfileinfo/qfileinfo.pro
@@ -6,7 +6,7 @@ QT = core
 
 RESOURCES      += qfileinfo.qrc
 
-wince*:|symbian*: {
+wince*:|symbian: {
     deploy.sources += qfileinfo.qrc tst_qfileinfo.cpp
     res.sources = resources\\file1 resources\\file1.ext1 resources\\file1.ext1.ext2
     res.path = resources
diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro
index 33d479a..9618962 100644
--- a/tests/auto/qftp/qftp.pro
+++ b/tests/auto/qftp/qftp.pro
@@ -9,7 +9,7 @@ wince*: {
    addFiles.path = .
    DEPLOYMENT += addFiles
    DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
    addFiles.sources = rfc3252.txt
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro
index 401c9eb..cc6f585 100644
--- a/tests/auto/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro
@@ -6,7 +6,7 @@ win32:!wince*: LIBS += -lUser32
 !wince*:!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
 DEFINES += QT_NO_CAST_TO_ASCII
 
-wince*|symbian*: {
+wince*|symbian: {
    rootFiles.sources = Ash_European.jpg graphicsScene_selection.data
    rootFiles.path = .
    renderFiles.sources = testData\\render\\*
@@ -17,4 +17,4 @@ wince*:{
    DEFINES += SRCDIR=\\\".\\\"
 }
 
-symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # Min 1Mb, max 16Mb
diff --git a/tests/auto/qhash/qhash.pro b/tests/auto/qhash/qhash.pro
index 6fedb82..86b98a2 100644
--- a/tests/auto/qhash/qhash.pro
+++ b/tests/auto/qhash/qhash.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
 SOURCES  += tst_qhash.cpp
 QT = core
 
-symbian*: {
+symbian: {
 TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
 }
diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro
index 23a73c4..c0be518 100644
--- a/tests/auto/qhttp/qhttp.pro
+++ b/tests/auto/qhttp/qhttp.pro
@@ -13,7 +13,7 @@ wince*: {
     addFiles.path = .
     DEPLOYMENT = addFiles webFiles cgi
     DEFINES += SRCDIR=\\\"\\\"
-} else:symbian* {
+} else:symbian {
     webFiles.sources = webserver/*
     webFiles.path = webserver
     cgi.sources = webserver/cgi-bin/*
diff --git a/tests/auto/qicoimageformat/qicoimageformat.pro b/tests/auto/qicoimageformat/qicoimageformat.pro
index b9c8622..cabab3f 100644
--- a/tests/auto/qicoimageformat/qicoimageformat.pro
+++ b/tests/auto/qicoimageformat/qicoimageformat.pro
@@ -12,7 +12,7 @@ wince*: {
    }
    addPlugins.path = imageformats
    DEPLOYMENT += addFiles addPlugins
-} else:symbian* {
+} else:symbian {
    addFiles.sources = icons
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qimage/qimage.pro b/tests/auto/qimage/qimage.pro
index 3e0bd69..6469211 100644
--- a/tests/auto/qimage/qimage.pro
+++ b/tests/auto/qimage/qimage.pro
@@ -6,7 +6,7 @@ wince*: {
    addImages.path = images
    DEPLOYMENT += addImages
    DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
    TARGET.EPOCHEAPSIZE = 0x200000 0x800000
    addImages.sources = images/*
    addImages.path = images
diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro
index 402e94b..f8fc7fa 100644
--- a/tests/auto/qimagereader/qimagereader.pro
+++ b/tests/auto/qimagereader/qimagereader.pro
@@ -27,7 +27,7 @@ wince*: {
     DEFINES += SRCDIR=\\\".\\\"
 }
 
-symbian*: {
+symbian: {
     images.sources = images
     images.path = .
 
diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro
index 2171c3e..f25472f 100644
--- a/tests/auto/qimagewriter/qimagewriter.pro
+++ b/tests/auto/qimagewriter/qimagewriter.pro
@@ -10,7 +10,7 @@ wince*: {
    addFiles.path = images
    DEPLOYMENT += addFiles
    DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
    addFiles.sources = images\\*.*
    addFiles.path = images
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro
index 2d0bdea..92709fe 100644
--- a/tests/auto/qitemmodel/qitemmodel.pro
+++ b/tests/auto/qitemmodel/qitemmodel.pro
@@ -15,7 +15,7 @@ QT += sql
 #}
 
 symbian {
-    TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+    TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
     qt_not_deployed {
         contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) {
             sqlite.path = /sys/bin
diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro
index 0dfe1e9..c99f1d9 100644
--- a/tests/auto/qlayout/qlayout.pro
+++ b/tests/auto/qlayout/qlayout.pro
@@ -6,7 +6,7 @@ load(qttest_p4)
 
 SOURCES += tst_qlayout.cpp
 contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = baseline
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro
index e15d7ed..4c647c0 100644
--- a/tests/auto/qlibrary/tst/tst.pro
+++ b/tests/auto/qlibrary/tst/tst.pro
@@ -16,7 +16,7 @@ wince*: {
    addFiles.path = .
    DEPLOYMENT += addFiles
    DEFINES += SRCDIR=\\\"\\\"
-}else:symbian* {
+}else:symbian {
    binDep.sources = \
         mylib.dll \
         system.trolltech.test.mylib.dll
diff --git a/tests/auto/qline/qline.pro b/tests/auto/qline/qline.pro
index 1a3d7f2..4651fd3 100644
--- a/tests/auto/qline/qline.pro
+++ b/tests/auto/qline/qline.pro
@@ -1,6 +1,6 @@
 load(qttest_p4)
 QT -= gui
 SOURCES += tst_qline.cpp
-unix:!mac:!symbian*:!vxworks:LIBS+=-lm
+unix:!mac:!symbian:!vxworks:LIBS+=-lm
 
 
diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro
index 287e946..3911a64 100644
--- a/tests/auto/qlocalsocket/qlocalsocket.pro
+++ b/tests/auto/qlocalsocket/qlocalsocket.pro
@@ -1,4 +1,4 @@
 TEMPLATE = subdirs
 SUBDIRS = lackey test
-!wince*:!symbian*: SUBDIRS += example
+!wince*:!symbian: SUBDIRS += example
 symbian: TARGET.CAPABILITY = NetworkServices
diff --git a/tests/auto/qmenubar/qmenubar.pro b/tests/auto/qmenubar/qmenubar.pro
index a0a6420..adce164 100644
--- a/tests/auto/qmenubar/qmenubar.pro
+++ b/tests/auto/qmenubar/qmenubar.pro
@@ -2,5 +2,5 @@ load(qttest_p4)
 HEADERS += 
 SOURCES += tst_qmenubar.cpp
 
-contains(QT_CONFIG, qt3support):!symbian*:QT += qt3support
+contains(QT_CONFIG, qt3support):!symbian:QT += qt3support
 
diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro
index a8ec478..510a70e 100644
--- a/tests/auto/qmovie/qmovie.pro
+++ b/tests/auto/qmovie/qmovie.pro
@@ -13,7 +13,7 @@ wince*: {
 }
 
 
-symbian*: {
+symbian: {
    addFiles.sources = animations\\*
    addFiles.path = animations
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro
index c8446d1..69dc98d 100644
--- a/tests/auto/qpainter/qpainter.pro
+++ b/tests/auto/qpainter/qpainter.pro
@@ -1,7 +1,7 @@
 load(qttest_p4)
 contains(QT_CONFIG, qt3support): QT += qt3support
 SOURCES  += tst_qpainter.cpp
-wince*|symbian*: {
+wince*|symbian: {
     addFiles.sources = drawEllipse drawLine_rop_bitmap drawPixmap_rop drawPixmap_rop_bitmap task217400.png
     addFiles.path = .
     DEPLOYMENT += addFiles
diff --git a/tests/auto/qpathclipper/qpathclipper.pro b/tests/auto/qpathclipper/qpathclipper.pro
index 930a6f2..590fba0 100644
--- a/tests/auto/qpathclipper/qpathclipper.pro
+++ b/tests/auto/qpathclipper/qpathclipper.pro
@@ -5,6 +5,6 @@ SOURCES  += tst_qpathclipper.cpp paths.cpp
 
 requires(contains(QT_CONFIG,private_tests))
 
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
 
 
diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro
index a3577bd..c3ee192 100644
--- a/tests/auto/qpixmap/qpixmap.pro
+++ b/tests/auto/qpixmap/qpixmap.pro
@@ -1,7 +1,7 @@
 load(qttest_p4)
 SOURCES  += tst_qpixmap.cpp
 contains(QT_CONFIG, qt3support): QT += qt3support
-wince*|symbian*: {
+wince*|symbian: {
 
    task31722_0.sources = convertFromImage/task31722_0/*.png
    task31722_0.path    = convertFromImage/task31722_0
@@ -18,7 +18,7 @@ wince*|symbian*: {
 
 wince*: {
    DEFINES += SRCDIR=\\\".\\\"
-} else:symbian* {
+} else:symbian {
    DEPLOYMENT_PLUGIN += qmng
    LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll
    contains(QT_CONFIG, openvg) {
diff --git a/tests/auto/qprocess/testDetached/testDetached.pro b/tests/auto/qprocess/testDetached/testDetached.pro
index 319cfa6..80a616b 100644
--- a/tests/auto/qprocess/testDetached/testDetached.pro
+++ b/tests/auto/qprocess/testDetached/testDetached.pro
@@ -5,6 +5,6 @@ CONFIG -= app_bundle
 INSTALLS =
 DESTDIR = ./
 
-symbian*: {
+symbian: {
 TARGET.EPOCSTACKSIZE =0x14000
 }
diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro
index 3e47b52..17e36af 100644
--- a/tests/auto/qresourceengine/qresourceengine.pro
+++ b/tests/auto/qresourceengine/qresourceengine.pro
@@ -20,7 +20,7 @@ QMAKE_EXTRA_TARGETS = runtime_resource
 PRE_TARGETDEPS += $${runtime_resource.target}
 
 QT = core
-wince*|symbian*:{
+wince*|symbian:{
     deploy.sources += runtime_resource.rcc parentdir.txt
     test.sources = testqrc/*
     test.path = testqrc
diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro
index 7d0f5d0..fc35f66 100644
--- a/tests/auto/qscriptengine/qscriptengine.pro
+++ b/tests/auto/qscriptengine/qscriptengine.pro
@@ -9,7 +9,7 @@ wince* {
     DEFINES += SRCDIR=\\\"$$PWD\\\"
 }
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = script
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qset/qset.pro b/tests/auto/qset/qset.pro
index 05ad07d..b45a015 100644
--- a/tests/auto/qset/qset.pro
+++ b/tests/auto/qset/qset.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
 SOURCES  += tst_qset.cpp
 QT = core
 
-symbian*: {
+symbian: {
 TARGET.EPOCSTACKSIZE =0x5000
-TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
+TARGET.EPOCHEAPSIZE="0x100000 0x1000000" # // Min 1Mb, max 16Mb
 }
diff --git a/tests/auto/qsound/qsound.pro b/tests/auto/qsound/qsound.pro
index 383a085..bb1981c 100644
--- a/tests/auto/qsound/qsound.pro
+++ b/tests/auto/qsound/qsound.pro
@@ -1,7 +1,7 @@
 load(qttest_p4)
 SOURCES += tst_qsound.cpp
 
-wince*|symbian*: {
+wince*|symbian: {
    deploy.sources += 4.wav
    DEPLOYMENT = deploy
    !symbian:DEFINES += SRCDIR=\\\"\\\"
diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro
index 5ec2b9d..b11e408 100644
--- a/tests/auto/qsplitter/qsplitter.pro
+++ b/tests/auto/qsplitter/qsplitter.pro
@@ -4,7 +4,7 @@ SOURCES  += tst_qsplitter.cpp
 
 contains(QT_CONFIG, qt3support): QT += qt3support
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = extradata.txt setSizes3.dat
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro
index 1ffe369..11f5943 100644
--- a/tests/auto/qstyle/qstyle.pro
+++ b/tests/auto/qstyle/qstyle.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
 TARGET.EPOCHEAPSIZE = 0x200000 0x800000
 SOURCES  += tst_qstyle.cpp
 
-wince*|symbian*: {
+wince*|symbian: {
    !symbian:DEFINES += SRCDIR=\\\".\\\"
    addPixmap.sources = task_25863.png
    addPixmap.path = .
diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro
index 370a695..8b1f664 100644
--- a/tests/auto/qtcpsocket/qtcpsocket.pro
+++ b/tests/auto/qtcpsocket/qtcpsocket.pro
@@ -2,7 +2,7 @@ TEMPLATE = subdirs
 
 
 !wince*: SUBDIRS = test stressTest
-wince*|symbian*|vxworks* : SUBDIRS = test
+wince*|symbian|vxworks* : SUBDIRS = test
 
 
 requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
index cba5a74..aa1fbb5 100644
--- a/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
+++ b/tests/auto/qtextboundaryfinder/qtextboundaryfinder.pro
@@ -4,7 +4,7 @@ HEADERS +=
 SOURCES += tst_qtextboundaryfinder.cpp 
 !symbian:*:DEFINES += SRCDIR=\\\"$$PWD\\\"
 
-wince*|symbian*:{
+wince*|symbian:{
    addFiles.sources = data
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro
index e159a3c..88061a9 100644
--- a/tests/auto/qtextbrowser/qtextbrowser.pro
+++ b/tests/auto/qtextbrowser/qtextbrowser.pro
@@ -1,11 +1,11 @@
 load(qttest_p4)
 SOURCES += tst_qtextbrowser.cpp
-!symbian*:DEFINES += SRCDIR=\\\"$$PWD\\\"
+!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
 
 contains(QT_CONFIG, qt3support): QT += qt3support
 
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = *.html
    addFiles.path = .
    addDir.sources = subdir/*
diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro
index 3efabad..43813da 100644
--- a/tests/auto/qtextedit/qtextedit.pro
+++ b/tests/auto/qtextedit/qtextedit.pro
@@ -5,7 +5,7 @@ INCLUDEPATH += ../
 HEADERS +=  
 SOURCES += tst_qtextedit.cpp 
 
-wince*|symbian*: {
+wince*|symbian: {
     addImages.sources = fullWidthSelection/*
     addImages.path = fullWidthSelection
     DEPLOYMENT += addImages
diff --git a/tests/auto/qthread/qthread.pro b/tests/auto/qthread/qthread.pro
index 4ea8fe5..0b042ab 100644
--- a/tests/auto/qthread/qthread.pro
+++ b/tests/auto/qthread/qthread.pro
@@ -1,4 +1,4 @@
 load(qttest_p4)
 SOURCES += tst_qthread.cpp
 QT = core
-symbian*:LIBS += -llibpthread
+symbian:LIBS += -llibpthread
diff --git a/tests/auto/qthreadstorage/qthreadstorage.pro b/tests/auto/qthreadstorage/qthreadstorage.pro
index 376ba65..3071098 100644
--- a/tests/auto/qthreadstorage/qthreadstorage.pro
+++ b/tests/auto/qthreadstorage/qthreadstorage.pro
@@ -1,4 +1,4 @@
 load(qttest_p4)
 SOURCES += tst_qthreadstorage.cpp
 QT = core
-symbian*:LIBS += -llibpthread
+symbian:LIBS += -llibpthread
diff --git a/tests/auto/qtipc/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro
index 4ff5486..68a5362 100644
--- a/tests/auto/qtipc/qsharedmemory/test/test.pro
+++ b/tests/auto/qtipc/qsharedmemory/test/test.pro
@@ -24,7 +24,7 @@ addFiles.sources = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts
 addFiles.path = .
 DEPLOYMENT += addFiles
 DEFINES += SRCDIR=\\\".\\\"
-}else:symbian*{
+}else:symbian{
 requires(contains(QT_CONFIG,script))
 QT += gui script
 addFiles.sources = ../../lackey/scripts
diff --git a/tests/auto/qtransform/qtransform.pro b/tests/auto/qtransform/qtransform.pro
index 298feb2..92bef8c 100644
--- a/tests/auto/qtransform/qtransform.pro
+++ b/tests/auto/qtransform/qtransform.pro
@@ -2,6 +2,6 @@ load(qttest_p4)
 HEADERS += 
 SOURCES  += tst_qtransform.cpp
 
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
 
 
diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro
index 2b08b4a..5b742f7 100644
--- a/tests/auto/qtranslator/qtranslator.pro
+++ b/tests/auto/qtranslator/qtranslator.pro
@@ -2,7 +2,7 @@ load(qttest_p4)
 SOURCES  += tst_qtranslator.cpp
 RESOURCES += qtranslator.qrc
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = hellotr_la.qm msgfmt_from_po.qm
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qtwidgets/qtwidgets.pro b/tests/auto/qtwidgets/qtwidgets.pro
index b762acb..9c33cd1 100644
--- a/tests/auto/qtwidgets/qtwidgets.pro
+++ b/tests/auto/qtwidgets/qtwidgets.pro
@@ -1,5 +1,5 @@
 load(qttest_p4)
-symbian*:TARGET.EPOCHEAPSIZE=0x200000 0xa00000
+symbian:TARGET.EPOCHEAPSIZE=0x200000 0xa00000
 
 SOURCES += tst_qtwidgets.cpp mainwindow.cpp
 HEADERS += mainwindow.h
diff --git a/tests/auto/qudpsocket/test/test.pro b/tests/auto/qudpsocket/test/test.pro
index 44d3d30..9c0d009 100644
--- a/tests/auto/qudpsocket/test/test.pro
+++ b/tests/auto/qudpsocket/test/test.pro
@@ -14,7 +14,7 @@ win32 {
     DESTDIR = ../
 }
 
-wince*|symbian*: {
+wince*|symbian: {
     addApp.sources = ../clientserver/clientserver.exe
     addApp.path = clientserver
     DEPLOYMENT += addApp
diff --git a/tests/auto/qwmatrix/qwmatrix.pro b/tests/auto/qwmatrix/qwmatrix.pro
index 58ea706..bab298b 100644
--- a/tests/auto/qwmatrix/qwmatrix.pro
+++ b/tests/auto/qwmatrix/qwmatrix.pro
@@ -1,6 +1,6 @@
 load(qttest_p4)
 SOURCES  += tst_qwmatrix.cpp
 
-unix:!mac:!symbian*:LIBS+=-lm
+unix:!mac:!symbian:LIBS+=-lm
 
 
diff --git a/tests/auto/qxml/qxml.pro b/tests/auto/qxml/qxml.pro
index 304fc54..5fb7fe2 100644
--- a/tests/auto/qxml/qxml.pro
+++ b/tests/auto/qxml/qxml.pro
@@ -3,7 +3,7 @@ load(qttest_p4)
 SOURCES += tst_qxml.cpp
 QT = core xml
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = 0x010D.xml
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlformatter/qxmlformatter.pro b/tests/auto/qxmlformatter/qxmlformatter.pro
index 4c00d73..339fa55 100644
--- a/tests/auto/qxmlformatter/qxmlformatter.pro
+++ b/tests/auto/qxmlformatter/qxmlformatter.pro
@@ -3,7 +3,7 @@ SOURCES += tst_qxmlformatter.cpp
 
 include (../xmlpatterns.pri)
 
-wince*|symbian*:{
+wince*|symbian:{
    addFiles.sources = baselines input
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlquery/qxmlquery.pro b/tests/auto/qxmlquery/qxmlquery.pro
index cfab564..ae73488 100644
--- a/tests/auto/qxmlquery/qxmlquery.pro
+++ b/tests/auto/qxmlquery/qxmlquery.pro
@@ -18,7 +18,7 @@ wince* {
 
 include (../xmlpatterns.pri)
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = pushBaselines input.xml
    addFiles.path    = .
 
diff --git a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
index bfdec58..c107470 100644
--- a/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
+++ b/tests/auto/qxmlsimplereader/qxmlsimplereader.pro
@@ -12,7 +12,7 @@ QT += network xml
 QT -= gui
 
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = encodings parser xmldocs
    addFiles.path = .
    DEPLOYMENT += addFiles
diff --git a/tests/auto/qxmlstream/qxmlstream.pro b/tests/auto/qxmlstream/qxmlstream.pro
index f82a7b3..8f076be 100644
--- a/tests/auto/qxmlstream/qxmlstream.pro
+++ b/tests/auto/qxmlstream/qxmlstream.pro
@@ -4,7 +4,7 @@ SOURCES += tst_qxmlstream.cpp
 QT = core xml network
 
 
-wince*|symbian*: {
+wince*|symbian: {
    addFiles.sources = data XML-Test-Suite
    addFiles.path = .
    DEPLOYMENT += addFiles
-- 
cgit v0.12


From 48dfb5bab110f8cfa5e3a9d5a68f328728099318 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 29 Jun 2010 14:04:45 +0200
Subject: Added the APP_PRIVATE_DIR_BASE variable.

RevBy:    Miikka Heikkinen
---
 mkspecs/features/symbian/data_caging_paths.prf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mkspecs/features/symbian/data_caging_paths.prf b/mkspecs/features/symbian/data_caging_paths.prf
index 6b38d4d..2f03128 100644
--- a/mkspecs/features/symbian/data_caging_paths.prf
+++ b/mkspecs/features/symbian/data_caging_paths.prf
@@ -76,4 +76,5 @@ exists($${EPOCROOT}epoc32/include/data_caging_paths.prf) {
 
 isEmpty(HW_ZDIR): HW_ZDIR = epoc32/data/z
 isEmpty(REG_RESOURCE_DIR): REG_RESOURCE_DIR = /private/10003a3f/apps
-isEmpty(REG_RESOURCE_IMPORT_DIR): REG_RESOURCE_IMPORT_DIR = /private/10003a3f/import/apps
\ No newline at end of file
+isEmpty(REG_RESOURCE_IMPORT_DIR): REG_RESOURCE_IMPORT_DIR = /private/10003a3f/import/apps
+isEmpty(APP_PRIVATE_DIR_BASE): APP_PRIVATE_DIR_BASE = /private
-- 
cgit v0.12


From b6687616708d953df52c84d4e9bc06196a75c553 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 29 Jun 2010 14:01:17 +0200
Subject: Fixed a relative path problem in qml demos.

qmake doesn't handle the relative path very well.

RevBy:    Alessandro Portale
---
 demos/embedded/qmlcalculator/deployment.pri  | 2 +-
 demos/embedded/qmlclocks/deployment.pri      | 2 +-
 demos/embedded/qmldialcontrol/deployment.pri | 2 +-
 demos/embedded/qmleasing/deployment.pri      | 2 +-
 demos/embedded/qmlflickr/deployment.pri      | 2 +-
 demos/embedded/qmlphotoviewer/deployment.pri | 2 +-
 demos/embedded/qmltwitter/deployment.pri     | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/demos/embedded/qmlcalculator/deployment.pri b/demos/embedded/qmlcalculator/deployment.pri
index a0bfbb6..53c6dbf 100644
--- a/demos/embedded/qmlcalculator/deployment.pri
+++ b/demos/embedded/qmlcalculator/deployment.pri
@@ -1,7 +1,7 @@
 qmlcalculator_src = $$PWD/../../declarative/calculator
 symbian {
     qmlcalculator_uid3 = A000E3FB
-    qmlcalculator_files.path = ../$$qmlcalculator_uid3
+    qmlcalculator_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlcalculator_uid3
 }
 qmlcalculator_files.sources = $$qmlcalculator_src/calculator.qml $$qmlcalculator_src/Core
 DEPLOYMENT += qmlcalculator_files
diff --git a/demos/embedded/qmlclocks/deployment.pri b/demos/embedded/qmlclocks/deployment.pri
index a30e403..03ba129 100644
--- a/demos/embedded/qmlclocks/deployment.pri
+++ b/demos/embedded/qmlclocks/deployment.pri
@@ -1,7 +1,7 @@
 qmlclocks_src = $$PWD/../../../examples/declarative/toys/clocks
 symbian {
     qmlclocks_uid3 = A000E3FC
-    qmlclocks_files.path = ../$$qmlclocks_uid3
+    qmlclocks_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlclocks_uid3
 }
 qmlclocks_files.sources = $$qmlclocks_src/clocks.qml $$qmlclocks_src/content
 DEPLOYMENT += qmlclocks_files
diff --git a/demos/embedded/qmldialcontrol/deployment.pri b/demos/embedded/qmldialcontrol/deployment.pri
index c04ed05..097c74c 100644
--- a/demos/embedded/qmldialcontrol/deployment.pri
+++ b/demos/embedded/qmldialcontrol/deployment.pri
@@ -1,7 +1,7 @@
 qmldialcontrol_src = $$PWD/../../../examples/declarative/ui-components/dialcontrol
 symbian {
     qmldialcontrol_uid3 = A000E3FD
-    qmldialcontrol_files.path = ../$$qmldialcontrol_uid3
+    qmldialcontrol_files.path = $$APP_PRIVATE_DIR_BASE/$$qmldialcontrol_uid3
 }
 qmldialcontrol_files.sources = $$qmldialcontrol_src/dialcontrol.qml $$qmldialcontrol_src/content
 DEPLOYMENT += qmldialcontrol_files
diff --git a/demos/embedded/qmleasing/deployment.pri b/demos/embedded/qmleasing/deployment.pri
index bc37348..47192e6 100644
--- a/demos/embedded/qmleasing/deployment.pri
+++ b/demos/embedded/qmleasing/deployment.pri
@@ -1,7 +1,7 @@
 qmleasing_src = $$PWD/../../../examples/declarative/animation/easing
 symbian {
     qmleasing_uid3 = A000E3FE
-    qmleasing_files.path = ../$$qmleasing_uid3
+    qmleasing_files.path = $$APP_PRIVATE_DIR_BASE/$$qmleasing_uid3
 }
 qmleasing_files.sources = $$qmleasing_src/easing.qml
 DEPLOYMENT += qmleasing_files
diff --git a/demos/embedded/qmlflickr/deployment.pri b/demos/embedded/qmlflickr/deployment.pri
index c1f82df..c8fef1a 100644
--- a/demos/embedded/qmlflickr/deployment.pri
+++ b/demos/embedded/qmlflickr/deployment.pri
@@ -1,7 +1,7 @@
 qmlflickr_src = $$PWD/../../declarative/flickr
 symbian {
     qmlflickr_uid3 = A000E3FF
-    qmlflickr_files.path = ../$$qmlflickr_uid3
+    qmlflickr_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlflickr_uid3
 }
 qmlflickr_files.sources = $$qmlflickr_src/flickr.qml $$qmlflickr_src/common $$qmlflickr_src/mobile
 DEPLOYMENT += qmlflickr_files
diff --git a/demos/embedded/qmlphotoviewer/deployment.pri b/demos/embedded/qmlphotoviewer/deployment.pri
index 0a457de..128a1f7 100644
--- a/demos/embedded/qmlphotoviewer/deployment.pri
+++ b/demos/embedded/qmlphotoviewer/deployment.pri
@@ -1,7 +1,7 @@
 qmlphotoviewer_src = $$PWD/../../declarative/photoviewer
 symbian {
     qmlphotoviewer_uid3 = A000E400
-    qmlphotoviewer_files.path = ../$$qmlphotoviewer_uid3
+    qmlphotoviewer_files.path = $$APP_PRIVATE_DIR_BASE/$$qmlphotoviewer_uid3
 }
 qmlphotoviewer_files.sources = $$qmlphotoviewer_src/photoviewer.qml $$qmlphotoviewer_src/PhotoViewerCore
 DEPLOYMENT += qmlphotoviewer_files
diff --git a/demos/embedded/qmltwitter/deployment.pri b/demos/embedded/qmltwitter/deployment.pri
index 34c8cd1..40c53ad 100644
--- a/demos/embedded/qmltwitter/deployment.pri
+++ b/demos/embedded/qmltwitter/deployment.pri
@@ -1,7 +1,7 @@
 qmltwitter_src = $$PWD/../../declarative/twitter
 symbian {
     qmltwitter_uid3 = A000E401
-    qmltwitter_files.path = ../$$qmltwitter_uid3
+    qmltwitter_files.path = $$APP_PRIVATE_DIR_BASE/$$qmltwitter_uid3
 }
 qmltwitter_files.sources = $$qmltwitter_src/twitter.qml $$qmltwitter_src/TwitterCore
 DEPLOYMENT += qmltwitter_files
-- 
cgit v0.12


From 2de30dafb76388b4e9ea5b8d6ea385d81da7ea37 Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 29 Jun 2010 14:07:01 +0200
Subject: Fixed deployment paths for the symbian/linux-armcc mkspec.

Paths to executables matter on that build system, unlike on Raptor.

RevBy:    Trust me
---
 demos/embedded/fluidlauncher/fluidlauncher.pro                   | 9 +++++----
 .../declarative/cppextensions/imageprovider/imageprovider.pro    | 2 +-
 examples/declarative/cppextensions/qwidgets/qwidgets.pro         | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro
index 416e58b..ca74c38 100644
--- a/demos/embedded/fluidlauncher/fluidlauncher.pro
+++ b/demos/embedded/fluidlauncher/fluidlauncher.pro
@@ -118,7 +118,7 @@ symbian {
     }
 
     contains(QT_CONFIG, multimedia) {
-        reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/spectrum_reg.rsc
+        reg_resource.sources += $$regResourceDir(demos/spectrum/app/spectrum_reg.rsc)
     }
 
 
@@ -202,10 +202,11 @@ symbian {
     }
 
     contains(QT_CONFIG, multimedia) {
-        executables.sources += spectrum.exe fftreal.dll
-        resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.rsc
+        executables.sources += $$QT_BUILD_TREE/demos/spectrum/app/spectrum.exe
+        executables.sources += $$QT_BUILD_TREE/demos/spectrum/3rdparty/fftreal/fftreal.dll
+        resource.sources += $$appResourceDir(demos/spectrum/app/spectrum.rsc)
         mifs.sources += \
-            $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.mif
+            $$appResourceDir(demos/spectrum/app/spectrum.mif)
     }
 
     contains(QT_CONFIG, script) {
diff --git a/examples/declarative/cppextensions/imageprovider/imageprovider.pro b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
index c7e7843..7149986 100644
--- a/examples/declarative/cppextensions/imageprovider/imageprovider.pro
+++ b/examples/declarative/cppextensions/imageprovider/imageprovider.pro
@@ -22,7 +22,7 @@ symbian:{
     include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
     TARGET.EPOCALLOWDLLDATA = 1
 
-    importFiles.sources = qmlimageproviderplugin.dll ImageProviderCore/qmldir
+    importFiles.sources = ImageProviderCore/qmlimageproviderplugin.dll ImageProviderCore/qmldir
     importFiles.path = ImageProviderCore
     DEPLOYMENT = importFiles
 }
diff --git a/examples/declarative/cppextensions/qwidgets/qwidgets.pro b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
index 3ec7d29..2e610f9 100644
--- a/examples/declarative/cppextensions/qwidgets/qwidgets.pro
+++ b/examples/declarative/cppextensions/qwidgets/qwidgets.pro
@@ -17,7 +17,7 @@ symbian:{
     include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
     TARGET.EPOCALLOWDLLDATA = 1
 
-    importFiles.sources = qmlqwidgetsplugin.dll QWidgets/qmldir
+    importFiles.sources = QWidgets/qmlqwidgetsplugin.dll QWidgets/qmldir
     importFiles.path = QWidgets
 
     DEPLOYMENT = importFiles
-- 
cgit v0.12


From ce57d92ef5723f54c1e3a1b50d66eb74273b995b Mon Sep 17 00:00:00 2001
From: Miikka Heikkinen <miikka.heikkinen@digia.com>
Date: Tue, 29 Jun 2010 14:38:42 +0300
Subject: Fix s60main linking issue with gcce applications

MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA must not be included in
s60main build, otherwise some symbols will not be relocatable when
linked against from gcce build.

Task-number: QTBUG-11804
Reviewed-by: Alessandro Portale
---
 src/s60main/s60main.pro | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro
index 1ba105d..9ea3080 100644
--- a/src/s60main/s60main.pro
+++ b/src/s60main/s60main.pro
@@ -25,6 +25,10 @@ symbian {
 
     # Workaround for abld toolchain problem to make ARMV6 qtmain.lib link with GCCE apps
     symbian-abld: QMAKE_CXXFLAGS.ARMCC += --dllimport_runtime
+
+    # Having MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA will cause s60main.lib be unlinkable
+    # against GCCE apps, so remove it
+    MMP_RULES -= $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA
 } else {
     error("$$_FILE_ is intended only for Symbian!")
 }
-- 
cgit v0.12


From 05f4d51a69516aa585f9941960afd483325e562f Mon Sep 17 00:00:00 2001
From: axis <qt-info@nokia.com>
Date: Tue, 29 Jun 2010 14:57:35 +0200
Subject: Fixed deployment paths for WebKit declarative plugin.

---
 src/3rdparty/webkit/WebCore/WebCore.pro | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 1162a52..c1661a4 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -26,7 +26,7 @@ symbian: {
     webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
 
     contains(QT_CONFIG, declarative) {
-         declarativeImport.sources = qmlwebkitplugin$${QT_LIBINFIX}.dll
+         declarativeImport.sources = $$QT_BUILD_TREE/imports/QtWebKit/qmlwebkitplugin$${QT_LIBINFIX}.dll
          declarativeImport.sources += ../WebKit/qt/declarative/qmldir
          declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
          DEPLOYMENT += declarativeImport
-- 
cgit v0.12


From 497fd44414dea6314731b96869e2d49bb8b439b5 Mon Sep 17 00:00:00 2001
From: Geir Vattekar <geir.vattekar@nokia.com>
Date: Tue, 29 Jun 2010 15:10:39 +0200
Subject:     Doc: QSettings::sync() imports changes made by other processes.

    Task-number: QTBUG-5949
    Reviewed-by: Morten Engvoldsen
---
 src/corelib/io/qsettings.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 64015ce..f802412 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -2274,9 +2274,9 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
     be different instances of your application running at the same
     time or different applications altogether) to read and write to
     the same system locations. It uses advisory file locking and a
-    smart merging algorithm to ensure data integrity. Changes
-    performed by another process aren't visible in the current
-    process until sync() is called.
+    smart merging algorithm to ensure data integrity. Note that sync()
+    imports changes made by other processes (in addition to writing
+    the changes from this QSettings).
 
     \section1 Platform-Specific Notes
 
-- 
cgit v0.12


From 3f68329ba1b1c691ecf3ec7b96cd10d0d27f23f8 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 29 Jun 2010 16:41:38 +0200
Subject: fix double percent sign after migration to yyMsg()

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

diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index b3e7e84..028a64f 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1761,7 +1761,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
             if (!tor)
                 goto case_default;
             if (!sourcetext.isEmpty())
-                yyMsg() << "//%% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n";
+                yyMsg() << "//% cannot be used with tr() / QT_TR_NOOP(). Ignoring\n";
             utf8 = (yyTok == Tok_trUtf8);
             line = yyLineNo;
             yyTok = getToken();
@@ -1867,7 +1867,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
             if (!tor)
                 goto case_default;
             if (!sourcetext.isEmpty())
-                yyMsg() << "//%% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n";
+                yyMsg() << "//% cannot be used with translate() / QT_TRANSLATE_NOOP(). Ignoring\n";
             utf8 = (yyTok == Tok_translateUtf8);
             line = yyLineNo;
             yyTok = getToken();
-- 
cgit v0.12


From f08b60f4ca52d525c1dc9890cb0c6661ee34b069 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 29 Jun 2010 16:36:04 +0200
Subject: don't complain multiple times about same abuse of //% meta strings

Reviewed-by: Kent Hansen
Task-number: QTBUG-11818
---
 .../lupdate/testdata/good/parsecpp2/expectedoutput.txt      |  2 ++
 .../auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp  | 13 +++++++++++++
 .../lupdate/testdata/good/parsecpp2/project.ts.result       | 12 ++++++++++++
 tools/linguist/lupdate/cpp.cpp                              |  3 +++
 4 files changed, 30 insertions(+)

diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
index 195c0e6..959938c 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
@@ -2,3 +2,5 @@
 .*/lupdate/testdata/good/parsecpp2/main.cpp:55: Excess closing brace .*
 .*/lupdate/testdata/good/parsecpp2/main.cpp:61: Excess closing brace .*
 .*/lupdate/testdata/good/parsecpp2/main.cpp:65: Excess closing brace .*
+.*/lupdate/testdata/good/parsecpp2/main.cpp:120: //% cannot be used with tr\(\) / QT_TR_NOOP\(\)\. Ignoring
+.*/lupdate/testdata/good/parsecpp2/main.cpp:123: //% cannot be used with translate\(\) / QT_TRANSLATE_NOOP\(\)\. Ignoring
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
index feb885c..06e6fe0 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/main.cpp
@@ -112,3 +112,16 @@ void ToBeUsed::caller()
 {
     tr("NameSpace::ToBeUsed");
 }
+
+
+
+// QTBUG-11818
+//% "Foo"
+QObject::tr("Hello World");
+QObject::tr("Hello World");
+//% "Bar"
+QApplication::translate("QObject", "Hello World");
+QApplication::translate("QObject", "Hello World");
+//% "Baz"
+clear = me;
+QObject::tr("Hello World");
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
index 6f48e27..806f56f 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.ts.result
@@ -10,6 +10,18 @@
     </message>
 </context>
 <context>
+    <name>QObject</name>
+    <message>
+        <location filename="main.cpp" line="120"/>
+        <location filename="main.cpp" line="121"/>
+        <location filename="main.cpp" line="123"/>
+        <location filename="main.cpp" line="124"/>
+        <location filename="main.cpp" line="127"/>
+        <source>Hello World</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
     <name>TopLevel</name>
     <message>
         <location filename="main.cpp" line="82"/>
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 028a64f..25e162f 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1858,6 +1858,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
               gotctx:
                 recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural);
             }
+            sourcetext.clear(); // Will have warned about that already
             extracomment.clear();
             msgid.clear();
             extra.clear();
@@ -1913,6 +1914,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
                 }
                 recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural);
             }
+            sourcetext.clear(); // Will have warned about that already
             extracomment.clear();
             msgid.clear();
             extra.clear();
@@ -2079,6 +2081,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
         case Tok_Semicolon:
             prospectiveContext.clear();
             prefix.clear();
+            sourcetext.clear();
             extracomment.clear();
             msgid.clear();
             extra.clear();
-- 
cgit v0.12


From 7258ad9817ae811808ea89c790b059474d145654 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 29 Jun 2010 16:33:40 +0200
Subject: warn about stray meta data

---
 .../lupdate/testdata/good/parsecpp2/expectedoutput.txt        |  1 +
 tools/linguist/lupdate/cpp.cpp                                | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
index 959938c..d4ebe49 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt
@@ -4,3 +4,4 @@
 .*/lupdate/testdata/good/parsecpp2/main.cpp:65: Excess closing brace .*
 .*/lupdate/testdata/good/parsecpp2/main.cpp:120: //% cannot be used with tr\(\) / QT_TR_NOOP\(\)\. Ignoring
 .*/lupdate/testdata/good/parsecpp2/main.cpp:123: //% cannot be used with translate\(\) / QT_TRANSLATE_NOOP\(\)\. Ignoring
+.*/lupdate/testdata/good/parsecpp2/main.cpp:126: Discarding unconsumed meta data
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 25e162f..609bd3d 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -2081,10 +2081,13 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
         case Tok_Semicolon:
             prospectiveContext.clear();
             prefix.clear();
-            sourcetext.clear();
-            extracomment.clear();
-            msgid.clear();
-            extra.clear();
+            if (!sourcetext.isEmpty() || !extracomment.isEmpty() || !msgid.isEmpty() || !extra.isEmpty()) {
+                yyMsg() << "Discarding unconsumed meta data\n";
+                sourcetext.clear();
+                extracomment.clear();
+                msgid.clear();
+                extra.clear();
+            }
             yyTokColonSeen = false;
             yyTok = getToken();
             break;
-- 
cgit v0.12


From c2bbf335d13d490697578010cee0810de159dcb9 Mon Sep 17 00:00:00 2001
From: Aaron McCarthy <aaron.mccarthy@nokia.com>
Date: Wed, 30 Jun 2010 11:02:37 +1000
Subject: Fix build failure on Symbian^3.

---
 src/plugins/bearer/symbian/qnetworksession_impl.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index b6e11df..f89ed0a 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -1303,7 +1303,8 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
 #ifdef OCC_FUNCTIONALITY_AVAILABLE
             // If the retVal is not true here, it means that the status update may apply to an IAP outside of
             // SNAP (session is based on SNAP but follows IAP outside of it), which may occur on Symbian^3 EasyWlan.
-            if (retVal == false && activeConfig.d.data() && activeConfig.d.data()->numericId == accessPointId) {
+            if (retVal == false && activeConfig.isValid() &&
+                toSymbianConfig(privateConfiguration(activeConfig))->numericIdentifier() == accessPointId) {
 #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
                 qDebug() << "QNS this : " << QString::number((uint)this) << " - " << "===> EMIT State changed G  to: " << state;
 #endif
@@ -1311,7 +1312,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
                     activeConfig = QNetworkConfiguration();
                 }
                 state = newState;
-                emit q->stateChanged(state);
+                emit stateChanged(state);
                 retVal = true;
             }
 #endif
-- 
cgit v0.12


From e47512726bc4dcf23db680f0516fc46a634fcef4 Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Wed, 30 Jun 2010 16:15:04 +1000
Subject: Fixed ARM .def files.

Update for commits fd8e9eadd087d11b0a01d598132ccbb19667fa5a
and fb76a872e20bd0df8e7bbe9c039b7f20423c6f12, which add
private exports.
---
 src/s60installs/eabi/QtGuiu.def | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index e7d865b..45be23e 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12020,4 +12020,9 @@ EXPORTS
 	_ZN10QImageData14convertInPlaceEN6QImage6FormatE6QFlagsIN2Qt19ImageConversionFlagEE @ 12019 NONAME
 	_ZN17QRasterPixmapData20createPixmapForImageER6QImage6QFlagsIN2Qt19ImageConversionFlagEEb @ 12020 NONAME
 	_ZN17QRasterPixmapData8fromDataEPKhjPKc6QFlagsIN2Qt19ImageConversionFlagEE @ 12021 NONAME
+	_ZN15QGraphicsSystem16createPixmapDataEP11QPixmapData @ 12022 NONAME
+	_ZN17QRasterPixmapData4copyEPK11QPixmapDataRK5QRect @ 12023 NONAME
+	_ZNK11QPixmapData7toImageERK5QRect @ 12024 NONAME
+	_ZNK17QRasterPixmapData7toImageERK5QRect @ 12025 NONAME
+	_ZTV15QGraphicsSystem @ 12026 NONAME
 
-- 
cgit v0.12


From 8ea60a39a8c4661db505a6dc1342e524ec2e460c Mon Sep 17 00:00:00 2001
From: Thierry Bastian <thierry.bastian@nokia.com>
Date: Wed, 30 Jun 2010 12:15:49 +0200
Subject: Fixed a crash in menubar with invisible actions

That would happen because the loop to find the next action when
navigating with the keyboard was not good enough.

Task-number: QTBUG-11823
---
 src/gui/widgets/qmenubar.cpp         |  2 +-
 tests/auto/qmenubar/tst_qmenubar.cpp | 29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp
index aa4ffce..e8e80b7 100644
--- a/src/gui/widgets/qmenubar.cpp
+++ b/src/gui/widgets/qmenubar.cpp
@@ -768,7 +768,7 @@ QAction *QMenuBarPrivate::getNextAction(const int _start, const int increment) c
     const int start = (_start == -1 && increment == -1) ? actions.count() : _start;
     const int end =  increment == -1 ? 0 : actions.count() - 1;
 
-    for (int i = start; start != end;) {
+    for (int i = start; i != end;) {
         i += increment;
         QAction *current = actions.at(i);
         if (!actionRects.at(i).isNull() && (allowActiveAndDisabled || current->isEnabled()))
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index 4cb63a1..cc9fb0c 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -168,6 +168,7 @@ private slots:
     void task256322_highlight();
     void menubarSizeHint();
     void taskQTBUG4965_escapeEaten();
+    void taskQTBUG11823_crashwithInvisibleActions();
 
 #if defined(QT3_SUPPORT)
     void indexBasedInsertion_data();
@@ -1690,6 +1691,34 @@ void tst_QMenuBar::taskQTBUG4965_escapeEaten()
     QTRY_VERIFY(!menubar.isVisible());
 }
 
+void tst_QMenuBar::taskQTBUG11823_crashwithInvisibleActions()
+{
+    QMenuBar menubar;
+    menubar.setNativeMenuBar(false); //we can't check the geometry of native menubars
+
+    QAction * m = menubar.addAction( "&m" );
+    QAction * a = menubar.addAction( "&a" );
+
+    menubar.show();
+    QApplication::setActiveWindow(&menubar);
+    QTest::qWaitForWindowShown(&menubar);
+    menubar.setActiveAction(m);
+    QCOMPARE(menubar.activeAction(), m);
+    QTest::keyClick(0, Qt::Key_Right);
+    QCOMPARE(menubar.activeAction(), a);
+    QTest::keyClick(0, Qt::Key_Right);
+    QCOMPARE(menubar.activeAction(), m);
+    a->setVisible(false);
+
+    menubar.setActiveAction(m);
+    QCOMPARE(menubar.activeAction(), m); //the active action shouldn't have changed
+
+    //it used to crash here because the action is invisible
+    QTest::keyClick(0, Qt::Key_Right);
+    QCOMPARE(menubar.activeAction(), m); //the active action shouldn't have changed
+}
+
+
 #if defined(QT3_SUPPORT)
 void tst_QMenuBar::indexBasedInsertion_data()
 {
-- 
cgit v0.12


From 0ee2330ec237cf5baeabe4833fb8b6cad503fb7c Mon Sep 17 00:00:00 2001
From: Gunnar Sletta <gunnar.sletta@nokia.com>
Date: Wed, 30 Jun 2010 12:43:52 +0200
Subject: Added textureUpload benchmark to the GL benchmarks

---
 tests/benchmarks/opengl/main.cpp | 51 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/tests/benchmarks/opengl/main.cpp b/tests/benchmarks/opengl/main.cpp
index beb4d43..c042fce 100644
--- a/tests/benchmarks/opengl/main.cpp
+++ b/tests/benchmarks/opengl/main.cpp
@@ -75,6 +75,10 @@ private slots:
     void gradients_data();
     void gradients();
 
+    void textureUpload_data();
+    void textureUpload();
+
+
 private:
     QGLPixelBuffer *pb;
 };
@@ -374,6 +378,53 @@ void OpenGLBench::gradients()
     }
 }
 
+void OpenGLBench::textureUpload_data()
+{
+    QTest::addColumn<int>("size");
+    QTest::addColumn<int>("flags");
+    QTest::addColumn<int>("format");
+
+    int sizes[] = { 8, 10, 16, 20, 32, 50, 64, 100, 128, 200, 256, 500, 512, 1000, 1024, 2000, 2048, -1 };
+    int flags[] = { QGLContext::InternalBindOption,
+                  QGLContext::DefaultBindOption,
+                  -1 };
+    int formats[] = { GL_RGB, GL_RGBA, -1 };
+
+    for (int s = 0; sizes[s] != -1; ++s) {
+        for (int f = 0; flags[f] != -1; ++f) {
+            for (int a = 0; formats[a] != -1; ++a) {
+                QByteArray name;
+                name.append("size=").append(QByteArray::number(sizes[s]));
+                name.append(", flags=").append(f == 0 ? "internal" : "default");
+                name.append(", format=").append(a == 0 ? "RGB" : "RGBA");
+                QTest::newRow(name.constData()) << sizes[s] << flags[f] << formats[a];
+            }
+        }
+    }
+}
+
+void OpenGLBench::textureUpload()
+{
+    QFETCH(int, size);
+    QFETCH(int, flags);
+    QFETCH(int, format);
+
+    QPixmap pixmap(size, size);
+
+    if (format == GL_RGB)
+        pixmap.fill(Qt::red);
+    else
+        pixmap.fill(Qt::transparent);
+
+    pb->makeCurrent();
+    QGLContext *context = const_cast<QGLContext *>(QGLContext::currentContext());
+    QTime time;
+
+    time.start();
+    context->bindTexture(pixmap, GL_TEXTURE_2D, format, (QGLContext::BindOptions) flags);
+    QTest::setBenchmarkResult(time.elapsed(), QTest::WalltimeMilliseconds);
+}
+
 QTEST_MAIN(OpenGLBench)
 
 #include "main.moc"
-- 
cgit v0.12


From 6ea8ad02e1929f98744f7b18f20fa91223cb4398 Mon Sep 17 00:00:00 2001
From: Jason McDonald <jason.mcdonald@nokia.com>
Date: Wed, 30 Jun 2010 21:23:23 +1000
Subject: Add missing license header.

---
 tests/manual/qtabletevent/regular_widgets/main.cpp | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp
index e0c53f5..a39e094 100644
--- a/tests/manual/qtabletevent/regular_widgets/main.cpp
+++ b/tests/manual/qtabletevent/regular_widgets/main.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the FOO module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
 #include <QApplication>
 #include <QDebug>
 #include <QMouseEvent>
-- 
cgit v0.12


From c16162214eb8757a62e221c34d38cefc402e5b05 Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Tue, 29 Jun 2010 17:28:19 +0200
Subject: Add QPixmap::fromImageReader() to decode arbitrary images in place.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Decoding in-place with QPixmap::fromData() has limitations, it cannot
be used with animated gif images, and the user has no control over the
parameters of the image reader.

Reader the image directly from the image reader allow us to do a better
job when loading images.

Reviewed-by: Simon Hausmann
Reviewed-by: Samuel Rødal
---
 src/gui/image/qpixmap.cpp     | 23 ++++++++++++++++++++++-
 src/gui/image/qpixmap.h       |  2 ++
 src/gui/image/qpixmapdata.cpp |  7 +++++++
 src/gui/image/qpixmapdata_p.h |  4 ++++
 4 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index fd2c139..ef9be8f 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -2018,7 +2018,7 @@ void QPixmap::detach()
     the color table. If this is too expensive an operation, you can
     use QBitmap::fromImage() instead.
 
-    \sa toImage(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
+    \sa fromImageReader(), toImage(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
 */
 QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
 {
@@ -2033,6 +2033,27 @@ QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags)
 }
 
 /*!
+    \fn QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)
+
+    Create a QPixmap from an image read directly from an \a imageReader.
+    The \a flags argument is a bitwise-OR of the \l{Qt::ImageConversionFlags}.
+    Passing 0 for \a flags sets all the default options.
+
+    On some systems, reading an image directly to QPixmap can use less memory than
+    reading a QImage to convert it to QPixmap.
+
+    \sa fromImage(), toImage(), {QPixmap#Pixmap Conversion}{Pixmap Conversion}
+*/
+QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)
+{
+    QGraphicsSystem *gs = QApplicationPrivate::graphicsSystem();
+    QScopedPointer<QPixmapData> data(gs ? gs->createPixmapData(QPixmapData::PixmapType)
+            : QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixmapType));
+    data->fromImageReader(imageReader, flags);
+    return QPixmap(data.take());
+}
+
+/*!
     \fn QPixmap QPixmap::grabWindow(WId window, int x, int y, int
     width, int height)
 
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 82546da..64ca8a3 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -62,6 +62,7 @@ QT_BEGIN_NAMESPACE
 QT_MODULE(Gui)
 
 class QImageWriter;
+class QImageReader;
 class QColor;
 class QVariant;
 class QX11Info;
@@ -134,6 +135,7 @@ public:
 
     QImage toImage() const;
     static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
+    static QPixmap fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags = Qt::AutoColor);
 
     bool load(const QString& fileName, const char *format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
     bool loadFromData(const uchar *buf, uint len, const char* format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor);
diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp
index 345e3cf..ef1f6c4 100644
--- a/src/gui/image/qpixmapdata.cpp
+++ b/src/gui/image/qpixmapdata.cpp
@@ -124,6 +124,13 @@ static QImage makeBitmapCompliantIfNeeded(QPixmapData *d, const QImage &image, Q
     return image;
 }
 
+void QPixmapData::fromImageReader(QImageReader *imageReader,
+                                  Qt::ImageConversionFlags flags)
+{
+    const QImage image = imageReader->read();
+    fromImage(image, flags);
+}
+
 bool QPixmapData::fromFile(const QString &fileName, const char *format,
                            Qt::ImageConversionFlags flags)
 {
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index 9a1505a..ec62b0b 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -58,6 +58,8 @@
 
 QT_BEGIN_NAMESPACE
 
+class QImageReader;
+
 class Q_GUI_EXPORT QPixmapData
 {
 public:
@@ -83,6 +85,8 @@ public:
     virtual void resize(int width, int height) = 0;
     virtual void fromImage(const QImage &image,
                            Qt::ImageConversionFlags flags) = 0;
+    virtual void fromImageReader(QImageReader *imageReader,
+                                 Qt::ImageConversionFlags flags);
 
     virtual bool fromFile(const QString &filename, const char *format,
                           Qt::ImageConversionFlags flags);
-- 
cgit v0.12


From 176024dfea7d354451a65b61fa2e82dd422b4dfb Mon Sep 17 00:00:00 2001
From: Benjamin Poulain <benjamin.poulain@nokia.com>
Date: Tue, 29 Jun 2010 19:47:53 +0200
Subject: Add the conversion in-place for QPixmap::fromImageReader() on raster.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since raster uses QImage internal, QPixmap::fromImageReader() can use
conversion in-place of the image. This avoid a memory peak during the
conversion and is a bit faster.

Reviewed-by: Samuel Rødal
---
 src/gui/image/qpixmap_raster.cpp                   |  11 ++++
 src/gui/image/qpixmap_raster_p.h                   |   1 +
 .../designer_indexed8_with_alpha_animated.gif      | Bin 0 -> 4138 bytes
 tests/auto/qpixmap/tst_qpixmap.cpp                 |  61 +++++++++++++++++++++
 4 files changed, 73 insertions(+)
 create mode 100644 tests/auto/qpixmap/loadFromData/designer_indexed8_with_alpha_animated.gif

diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index e188745..53f3559 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -152,6 +152,17 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
     createPixmapForImage(image, flags, /* inplace = */false);
 }
 
+void QRasterPixmapData::fromImageReader(QImageReader *imageReader,
+                                        Qt::ImageConversionFlags flags)
+{
+    Q_UNUSED(flags);
+    QImage image = imageReader->read();
+    if (image.isNull())
+        return;
+
+    createPixmapForImage(image, flags, /* inplace = */true);
+}
+
 // from qwindowsurface.cpp
 extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);
 
diff --git a/src/gui/image/qpixmap_raster_p.h b/src/gui/image/qpixmap_raster_p.h
index a46e054..36a9b2f 100644
--- a/src/gui/image/qpixmap_raster_p.h
+++ b/src/gui/image/qpixmap_raster_p.h
@@ -74,6 +74,7 @@ public:
     void fromFile(const QString &filename, Qt::ImageConversionFlags flags);
     bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags);
     void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
+    void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags);
 
     void copy(const QPixmapData *data, const QRect &rect);
     bool scroll(int dx, int dy, const QRect &rect);
diff --git a/tests/auto/qpixmap/loadFromData/designer_indexed8_with_alpha_animated.gif b/tests/auto/qpixmap/loadFromData/designer_indexed8_with_alpha_animated.gif
new file mode 100644
index 0000000..f813c05
Binary files /dev/null and b/tests/auto/qpixmap/loadFromData/designer_indexed8_with_alpha_animated.gif differ
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 179f068..f22edf6 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -44,6 +44,7 @@
 #include <qpixmap.h>
 #include <qbitmap.h>
 #include <qimage.h>
+#include <qimagereader.h>
 #include <qmatrix.h>
 #include <qdesktopwidget.h>
 #include <qpaintengine.h>
@@ -175,6 +176,11 @@ private slots:
     void loadFromDataImage_data();
     void loadFromDataImage();
 
+    void fromImageReader_data();
+    void fromImageReader();
+
+    void fromImageReaderAnimatedGif();
+
     void preserveDepth();
     void splash_crash();
 
@@ -1577,6 +1583,61 @@ void tst_QPixmap::loadFromDataImage()
     QVERIFY(pixmapsAreEqual(&pixmapWithCopy, &directLoadingPixmap));
 }
 
+void tst_QPixmap::fromImageReader_data()
+{
+    QTest::addColumn<QString>("imagePath");
+#ifdef Q_OS_SYMBIAN
+    const QString prefix = QLatin1String(SRCDIR) + "loadFromData";
+#else
+    const QString prefix = QLatin1String(SRCDIR) + "/loadFromData";
+#endif
+    QTest::newRow("designer_argb32.png") << prefix + "/designer_argb32.png";
+    QTest::newRow("designer_indexed8_no_alpha.png") << prefix + "/designer_indexed8_no_alpha.png";
+    QTest::newRow("designer_indexed8_with_alpha.png") << prefix + "/designer_indexed8_with_alpha.png";
+    QTest::newRow("designer_rgb32.png") << prefix + "/designer_rgb32.png";
+    QTest::newRow("designer_indexed8_no_alpha.gif") << prefix + "/designer_indexed8_no_alpha.gif";
+    QTest::newRow("designer_indexed8_with_alpha.gif") << prefix + "/designer_indexed8_with_alpha.gif";
+    QTest::newRow("designer_rgb32.jpg") << prefix + "/designer_rgb32.jpg";
+}
+
+void tst_QPixmap::fromImageReader()
+{
+    QFETCH(QString, imagePath);
+
+    QImage imageRef(imagePath);
+    QPixmap pixmapWithCopy = QPixmap::fromImage(imageRef);
+
+    QImageReader imageReader(imagePath);
+
+    QPixmap directLoadingPixmap = QPixmap::fromImageReader(&imageReader);
+
+    QVERIFY(pixmapsAreEqual(&pixmapWithCopy, &directLoadingPixmap));
+}
+
+void tst_QPixmap::fromImageReaderAnimatedGif()
+{
+#ifdef Q_OS_SYMBIAN
+    const QString prefix = QLatin1String(SRCDIR) + "loadFromData";
+#else
+    const QString prefix = QLatin1String(SRCDIR) + "/loadFromData";
+#endif
+    const QString path = prefix + QString::fromLatin1("/designer_indexed8_with_alpha_animated.gif");
+
+    QImageReader referenceReader(path);
+    QImageReader pixmapReader(path);
+
+    Q_ASSERT(referenceReader.canRead());
+    Q_ASSERT(referenceReader.imageCount() > 1);
+
+    for (int i = 0; i < referenceReader.imageCount(); ++i) {
+        QImage refImage = referenceReader.read();
+        QPixmap refPixmap = QPixmap::fromImage(refImage);
+
+        QPixmap directLoadingPixmap = QPixmap::fromImageReader(&pixmapReader);
+        QVERIFY(pixmapsAreEqual(&refPixmap, &directLoadingPixmap));
+    }
+}
+
 void tst_QPixmap::task_246446()
 {
     // This crashed without the bugfix in 246446
-- 
cgit v0.12


From f141de3daa267c266f67def765adb934138db080 Mon Sep 17 00:00:00 2001
From: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Date: Wed, 30 Jun 2010 13:59:30 +0200
Subject: Adds slowdownFactor to UnifiedTimer in abstract animation

The slowdown factor is useful for debugging complex animations.
Setting it to 0 will stop all animations when slowMode is enabled.

Submitted-by: Lasse
Reviewed-by: Thierry
---
 src/corelib/animation/qabstractanimation.cpp | 11 ++++++++---
 src/corelib/animation/qabstractanimation_p.h |  9 ++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 04342e7..7feb3f7 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -168,7 +168,7 @@ Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
 QUnifiedTimer::QUnifiedTimer() :
     QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL),
     currentAnimationIdx(0), consistentTiming(false), slowMode(false),
-    isPauseTimerActive(false), runningLeafAnimations(0)
+    slowdownFactor(5.0f), isPauseTimerActive(false), runningLeafAnimations(0)
 {
     time.invalidate();
 }
@@ -208,8 +208,13 @@ void QUnifiedTimer::updateAnimationsTime()
     // ignore consistentTiming in case the pause timer is active
     int delta = (consistentTiming && !isPauseTimerActive) ?
                         timingInterval : time.elapsed() - lastTick;
-    if (slowMode)
-        delta /= 5;
+    if (slowMode) {
+        if (slowdownFactor > 0)
+            delta = qRound(delta / slowdownFactor);
+        else
+            delta = 0;
+    }
+
     lastTick = time.elapsed();
 
     //we make sure we only call update time if the time has actually changed
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index fcfe824..6ff18f5 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -145,8 +145,9 @@ public:
     */
     void setConsistentTiming(bool consistent) { consistentTiming = consistent; }
 
-    //this facilitates fine-tuning of complex animations
+    //these facilitate fine-tuning of complex animations
     void setSlowModeEnabled(bool enabled) { slowMode = enabled; }
+    void setSlowdownFactor(qreal factor) { slowdownFactor = factor; }
 
     /*
         this is used for updating the currentTime of all animations in case the pause
@@ -176,6 +177,12 @@ private:
     int currentAnimationIdx;
     bool consistentTiming;
     bool slowMode;
+
+    // This factor will be used to divide the DEFAULT_TIMER_INTERVAL at each tick
+    // when slowMode is enabled. Setting it to 0 or higher than DEFAULT_TIMER_INTERVAL (16)
+    // stops all animations.
+    qreal slowdownFactor;
+
     // bool to indicate that only pause animations are active
     bool isPauseTimerActive;
 
-- 
cgit v0.12


From 38a04b3a8c7a33f1636008e04d58690febcc22f5 Mon Sep 17 00:00:00 2001
From: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Date: Wed, 30 Jun 2010 14:48:11 +0200
Subject: Avoid calling time.elapsed() twice in abstract animation

Reviewed-by: Thierry
---
 src/corelib/animation/qabstractanimation.cpp | 5 +++--
 src/corelib/animation/qabstractanimation_p.h | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 7feb3f7..641b42b 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -205,9 +205,10 @@ void QUnifiedTimer::ensureTimerUpdate()
 
 void QUnifiedTimer::updateAnimationsTime()
 {
+    qint64 totalElapsed = time.elapsed();
     // ignore consistentTiming in case the pause timer is active
     int delta = (consistentTiming && !isPauseTimerActive) ?
-                        timingInterval : time.elapsed() - lastTick;
+                        timingInterval : totalElapsed - lastTick;
     if (slowMode) {
         if (slowdownFactor > 0)
             delta = qRound(delta / slowdownFactor);
@@ -215,7 +216,7 @@ void QUnifiedTimer::updateAnimationsTime()
             delta = 0;
     }
 
-    lastTick = time.elapsed();
+    lastTick = totalElapsed;
 
     //we make sure we only call update time if the time has actually changed
     //it might happen in some cases that the time doesn't change because events are delayed
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 6ff18f5..d3d4098 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -172,7 +172,7 @@ private:
 
     ElapsedTimer time;
 
-    int lastTick;
+    qint64 lastTick;
     int timingInterval;
     int currentAnimationIdx;
     bool consistentTiming;
-- 
cgit v0.12


From 3a2a6e8746b5076b5b7f496444479fa40067731c Mon Sep 17 00:00:00 2001
From: Gunnar Sletta <gunnar.sletta@nokia.com>
Date: Wed, 30 Jun 2010 14:33:38 +0200
Subject: support BGRA textures on SGX

Reviewed-by: Samuel
---
 src/opengl/qgl.cpp | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index b4c85ac..adc3aa3 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2331,9 +2331,6 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
         && target == GL_TEXTURE_2D
         && (options & QGLContext::MipmapBindOption))
     {
-#ifdef QGL_BIND_TEXTURE_DEBUG
-        printf(" - generating mipmaps (%d ms)\n", time.elapsed());
-#endif
 #if !defined(QT_OPENGL_ES_2)
         glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST);
 #ifndef QT_OPENGL_ES
@@ -2347,6 +2344,9 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
 #endif
         glTexParameterf(target, GL_TEXTURE_MIN_FILTER, options & QGLContext::LinearFilteringBindOption
                         ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_NEAREST);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+        printf(" - generating mipmaps (%d ms)\n", time.elapsed());
+#endif
     } else {
         glTexParameterf(target, GL_TEXTURE_MIN_FILTER, filtering);
     }
@@ -2371,7 +2371,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
         if (premul) {
             img = img.convertToFormat(target_format = QImage::Format_ARGB32_Premultiplied);
 #ifdef QGL_BIND_TEXTURE_DEBUG
-            printf(" - converting ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed());
+            printf(" - converted ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed());
 #endif
         }
         break;
@@ -2379,7 +2379,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
         if (!premul) {
             img = img.convertToFormat(target_format = QImage::Format_ARGB32);
 #ifdef QGL_BIND_TEXTURE_DEBUG
-            printf(" - converting ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed());
+            printf(" - converted ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed());
 #endif
         }
         break;
@@ -2396,20 +2396,17 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
                                       ? QImage::Format_ARGB32_Premultiplied
                                       : QImage::Format_ARGB32);
 #ifdef QGL_BIND_TEXTURE_DEBUG
-            printf(" - converting to 32-bit alpha format (%d ms)\n", time.elapsed());
+            printf(" - converted to 32-bit alpha format (%d ms)\n", time.elapsed());
 #endif
         } else {
             img = img.convertToFormat(QImage::Format_RGB32);
 #ifdef QGL_BIND_TEXTURE_DEBUG
-            printf(" - converting to 32-bit (%d ms)\n", time.elapsed());
+            printf(" - converted to 32-bit (%d ms)\n", time.elapsed());
 #endif
         }
     }
 
     if (options & QGLContext::InvertedYBindOption) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
-            printf(" - flipping bits over y (%d ms)\n", time.elapsed());
-#endif
         if (img.isDetached()) {
             int ipl = img.bytesPerLine() / 4;
             int h = img.height();
@@ -2426,17 +2423,20 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
             // data twice.  This version should only do it once.
             img = img.mirrored();
         }
+#ifdef QGL_BIND_TEXTURE_DEBUG
+            printf(" - flipped bits over y (%d ms)\n", time.elapsed());
+#endif
     }
 
     if (externalFormat == GL_RGBA) {
-#ifdef QGL_BIND_TEXTURE_DEBUG
-            printf(" - doing byte swapping (%d ms)\n", time.elapsed());
-#endif
         // The only case where we end up with a depth different from
         // 32 in the switch above is for the RGB16 case, where we set
         // the format to GL_RGB
         Q_ASSERT(img.depth() == 32);
         qgl_byteSwapImage(img, pixel_type);
+#ifdef QGL_BIND_TEXTURE_DEBUG
+            printf(" - did byte swapping (%d ms)\n", time.elapsed());
+#endif
     }
 #ifdef QT_OPENGL_ES
     // OpenGL/ES requires that the internal and external formats be
@@ -2465,7 +2465,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
 #ifdef QGL_BIND_TEXTURE_DEBUG
     static int totalUploadTime = 0;
     totalUploadTime += time.elapsed();
-    printf(" - upload done in (%d ms) time=%d\n", time.elapsed(), totalUploadTime);
+    printf(" - upload done in %d ms, (accumulated: %d ms)\n", time.elapsed(), totalUploadTime);
 #endif
 
 
@@ -5161,6 +5161,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
         glExtensions |= NVFloatBuffer;
     if (extensions.match("GL_ARB_pixel_buffer_object"))
         glExtensions |= PixelBufferObject;
+    if (extensions.match("GL_IMG_texture_format_BGRA8888"))
+        glExtensions |= BGRATextureFormat;
 #if defined(QT_OPENGL_ES_2)
     glExtensions |= FramebufferObject;
     glExtensions |= GenerateMipmap;
-- 
cgit v0.12


From 7d80cd1f66fa6331c926674870d2a0dbe2921e77 Mon Sep 17 00:00:00 2001
From: Yoann Lopes <yoann.lopes@nokia.com>
Date: Wed, 30 Jun 2010 16:57:41 +0200
Subject: Fixes the documentation of QGraphicsEffect::update().

Reflects now the real behavior of this function. Related to a false bug
report (QT-3481).

Reviewed-by: sroedal
---
 src/gui/effects/qgraphicseffect.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 5e4e49e..0029017 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -488,13 +488,10 @@ void QGraphicsEffect::setEnabled(bool enable)
 */
 
 /*!
-    Schedules a redraw of the source. Call this function whenever the source
-    needs to be redrawn.
-
-    This convenience function is equivalent to calling
-    QGraphicsEffectSource::update().
+    Schedules a redraw of the effect. Call this function whenever the effect
+    needs to be redrawn. This function does not trigger a redraw of the source.
 
-    \sa updateBoundingRect(), QGraphicsEffectSource::update()
+    \sa updateBoundingRect()
 */
 void QGraphicsEffect::update()
 {
-- 
cgit v0.12


From 01648005f1f546dc0281155fecd94b4f47a94584 Mon Sep 17 00:00:00 2001
From: Olivier Goffart <olivier.goffart@nokia.com>
Date: Wed, 30 Jun 2010 15:52:20 +0200
Subject: Moc: fix compilation when templated types with multiple arguments are
 used.

Each template argument need to be normalized separately. Else, the const
type of one argument may end up moved in the first argument.
(And then the compilation of the generated moc file would fail as the types
would not match)

Reviewed-by: Kent Hansen
Task-number: QTBUG-11647
---
 src/corelib/kernel/qmetaobject_p.h         | 11 +++++++----
 tests/auto/moc/tst_moc.cpp                 | 19 +++++++++++++++++++
 tests/auto/qmetaobject/tst_qmetaobject.cpp |  2 ++
 3 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index b538787..4a03874 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -276,12 +276,15 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
                     ++templdepth;
                 if (c == '>')
                     --templdepth;
-                if (templdepth == 0) {
+                if (templdepth == 0 || (templdepth == 1 && c == ',')) {
                     result += normalizeTypeInternal(tt, t-1, fixScope, false);
                     result += c;
-                    if (*t == '>')
-                        result += ' '; // avoid >>
-                    break;
+                    if (templdepth == 0) {
+                        if (*t == '>')
+                            result += ' '; // avoid >>
+                        break;
+                    }
+                    tt = t;
                 }
             }
         }
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index a56d842..19f3677 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -1322,6 +1322,25 @@ public slots:
     void foo(struct const_ *) {};
 };
 
+
+template<typename T1, typename T2>
+class TestTemplate2
+{
+};
+
+class QTBUG11647_constInTemplateParameter : public QObject
+{ Q_OBJECT
+public slots:
+    void testSlot(TestTemplate2<const int, const short*>) {}
+    void testSlot2(TestTemplate2<int, short const * const >) {}
+    void testSlot3(TestTemplate2<TestTemplate2 < const int, const short* > const *,
+                                TestTemplate2< TestTemplate2 < void, int > , unsigned char *> > ) {}
+
+signals:
+    void testSignal(TestTemplate2<const int, const short*>);
+};
+
+
 QTEST_APPLESS_MAIN(tst_Moc)
 #include "tst_moc.moc"
 
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index b6d4558..62416b1 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -740,6 +740,8 @@ void tst_QMetaObject::normalizedType_data()
     QTest::newRow("template5") << "QList< ::Foo::Bar>" << "QList< ::Foo::Bar>";
     QTest::newRow("template6") << "QList<::Foo::Bar>" << "QList<::Foo::Bar>";
     QTest::newRow("template7") << "QList<QList<int> >" << "QList<QList<int> >";
+    QTest::newRow("template8") << "QMap<const int, const short*>" << "QMap<const int,const short*>";
+    QTest::newRow("template9") << "QPair<const QPair<int, int const *> , QPair<QHash<int, const char*>  >  >" << "QPair<const QPair<int,const int*>,QPair<QHash<int,const char*> > >";
     QTest::newRow("value1") << "const QString &" << "QString";
     QTest::newRow("value2") << "QString const &" << "QString";
     QTest::newRow("constInName1") << "constconst" << "constconst";
-- 
cgit v0.12

