From 5396e4de1146220e9fb57e42fa30083148af7798 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Mon, 20 Jul 2009 18:44:34 +0200
Subject: fix qmake syntax

Reviewed-by: TrustMe
---
 mkspecs/features/moc.prf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 33a58ad..62d9092 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -65,7 +65,7 @@ moc_header.output = $$MOC_DIR/$${QMAKE_H_MOD_MOC}${QMAKE_FILE_BASE}$${first(QMAK
 moc_header.input = HEADERS
 moc_header.variable_out = SOURCES
 moc_header.name = MOC ${QMAKE_FILE_IN}
-if(!contains(TEMPLATE, "vc.*") & !contains(TEMPLATE_PREFIX, "vc")) {
+if(!contains(TEMPLATE, "vc.*"):!contains(TEMPLATE_PREFIX, "vc")) {
 	!isEmpty(INCLUDETEMP):moc_header.depends += $$INCLUDETEMP
 }
 silent:moc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_header.commands
@@ -79,7 +79,7 @@ moc_source.commands = ${QMAKE_FUNC_mocCmd}
 moc_source.output = $$MOC_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_EXT_CPP_MOC}
 moc_source.input = SOURCES OBJECTIVE_SOURCES
 moc_source.name = MOC ${QMAKE_FILE_IN}
-if(!contains(TEMPLATE, "vc.*") & !contains(TEMPLATE_PREFIX, "vc")) {
+if(!contains(TEMPLATE, "vc.*"):!contains(TEMPLATE_PREFIX, "vc")) {
 	!isEmpty(INCLUDETEMP):moc_source.depends += $$INCLUDETEMP
 }
 silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands
-- 
cgit v0.12


From d3053c64e6e61656f8ea1fa809648228d0393957 Mon Sep 17 00:00:00 2001
From: Anders Bakken <anders.bakken@nokia.com>
Date: Mon, 20 Jul 2009 09:53:21 -0700
Subject: s/slots/Q_SLOTS/

Fix QDirectFBMousePrivate and QDirectFBKeyboardPrivate

Reviewed-by: TrustMe
---
 src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp | 2 +-
 src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp
index ed59db8..b5376b1 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbkeyboard.cpp
@@ -78,7 +78,7 @@ private:
     DFBEvent event;
     int bytesRead;
 
-private slots:
+private Q_SLOTS:
     void readKeyboardData();
 };
 
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
index 694ba51..142993d 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbmouse.cpp
@@ -71,7 +71,7 @@ private:
     DFBEvent event;
     uint bytesRead;
 
-private slots:
+private Q_SLOTS:
     void readMouseData();
 };
 
-- 
cgit v0.12


From 08834e4f7af8c1a4fe34ccfbbb8d2c973e91eb48 Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Tue, 21 Jul 2009 09:03:20 +1000
Subject: Fixed compile on certain Solaris versions.

Every source file must end with a newline, otherwise:
  "Error: There is extra text on this line."
---
 src/sql/drivers/mysql/qsql_mysql.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index dd4127c..8f377bd 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -1473,4 +1473,4 @@ QString QMYSQLDriver::escapeIdentifier(const QString &identifier, IdentifierType
 
 QT_END_NAMESPACE
 
-#include "qsql_mysql.moc"
\ No newline at end of file
+#include "qsql_mysql.moc"
-- 
cgit v0.12


From 42e469bc5edcc6dee2401a104bd30de6b4be54fe Mon Sep 17 00:00:00 2001
From: Markus Goetz <Markus.Goetz@nokia.com>
Date: Wed, 15 Jul 2009 14:56:57 +0200
Subject: QNAM: Proper loading of meta data when having AlwaysCache mode

Properly load the raw headers and properly handle the redirection
when having a network cache in AlwaysCache mode (equals the offline
mode in web browser).

Task-number: 256240
Reviewed-by: Thiago Macieira
---
 src/network/access/qnetworkaccesscachebackend.cpp | 14 ++++++++++++++
 src/network/access/qnetworkreplyimpl.cpp          | 10 ++++++++++
 2 files changed, 24 insertions(+)

diff --git a/src/network/access/qnetworkaccesscachebackend.cpp b/src/network/access/qnetworkaccesscachebackend.cpp
index f46a50a..8571ba3 100644
--- a/src/network/access/qnetworkaccesscachebackend.cpp
+++ b/src/network/access/qnetworkaccesscachebackend.cpp
@@ -86,6 +86,20 @@ bool QNetworkAccessCacheBackend::sendCacheContents()
     setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, attributes.value(QNetworkRequest::HttpReasonPhraseAttribute));
     setAttribute(QNetworkRequest::SourceIsFromCacheAttribute, true);
 
+    // set the raw headers
+    QNetworkCacheMetaData::RawHeaderList rawHeaders = item.rawHeaders();
+    QNetworkCacheMetaData::RawHeaderList::ConstIterator it = rawHeaders.constBegin(),
+                                                       end = rawHeaders.constEnd();
+    for ( ; it != end; ++it)
+        setRawHeader(it->first, it->second);
+
+    // handle a possible redirect
+    QVariant redirectionTarget = attributes.value(QNetworkRequest::RedirectionTargetAttribute);
+    if (redirectionTarget.isValid()) {
+        setAttribute(QNetworkRequest::RedirectionTargetAttribute, redirectionTarget);
+        redirectionRequested(redirectionTarget.toUrl());
+    }
+
     // signal we're open
     metaDataChanged();
 
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 98944fd..4ec3a75 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -376,7 +376,17 @@ void QNetworkReplyImplPrivate::feed(const QByteArray &data)
         QNetworkCacheMetaData metaData;
         metaData.setUrl(url);
         metaData = backend->fetchCacheMetaData(metaData);
+
+        // save the redirect request also in the cache
+        QVariant redirectionTarget = q->attribute(QNetworkRequest::RedirectionTargetAttribute);
+        if (redirectionTarget.isValid()) {
+            QNetworkCacheMetaData::AttributesMap attributes = metaData.attributes();
+            attributes.insert(QNetworkRequest::RedirectionTargetAttribute, redirectionTarget);
+            metaData.setAttributes(attributes);
+        }
+
         cacheSaveDevice = networkCache->prepare(metaData);
+
         if (!cacheSaveDevice || (cacheSaveDevice && !cacheSaveDevice->isOpen())) {
             if (cacheSaveDevice && !cacheSaveDevice->isOpen())
                 qCritical("QNetworkReplyImpl: network cache returned a device that is not open -- "
-- 
cgit v0.12


From 7624741ce0d2ab709f7a7418632c3e7969f536a6 Mon Sep 17 00:00:00 2001
From: Andy <qt-info@nokia.com>
Date: Tue, 21 Jul 2009 14:03:13 +0200
Subject: Fix building in a namespace when building with -arch ppc on Mac OS X

Task-number: 257080
Reviewed-by: nrc
---
 src/corelib/arch/qatomic_powerpc.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/corelib/arch/qatomic_powerpc.h b/src/corelib/arch/qatomic_powerpc.h
index ea3f458..c3b31f9 100644
--- a/src/corelib/arch/qatomic_powerpc.h
+++ b/src/corelib/arch/qatomic_powerpc.h
@@ -101,8 +101,6 @@ template <typename T>
 Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
 { return false; }
 
-QT_BEGIN_NAMESPACE
-
 #if defined(Q_CC_GNU)
 
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2) \
-- 
cgit v0.12


From c5e9b0238f0bfe0b8e2c415078011c6d6b34fb11 Mon Sep 17 00:00:00 2001
From: Markus Goetz <Markus.Goetz@nokia.com>
Date: Tue, 21 Jul 2009 14:16:12 +0200
Subject: QHttpNetworkConnection: Clarifying code comment about compression

Reviewed-by: TrustMe
---
 src/network/access/qhttpnetworkconnection.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 726b954..2169f97 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -228,7 +228,12 @@ void QHttpNetworkConnectionPrivate::prepareRequest(HttpMessagePair &messagePair)
 #ifndef QT_NO_NETWORKPROXY
     }
 #endif
-    // set the gzip header
+
+    // If the request had a accept-encoding set, we better not mess
+    // with it. If it was not set, we announce that we understand gzip
+    // and remember this fact in request.d->autoDecompress so that
+    // we can later decompress the HTTP reply if it has such an
+    // encoding.
     value = request.headerField("accept-encoding");
     if (value.isEmpty()) {
 #ifndef QT_NO_COMPRESS
-- 
cgit v0.12


From 21556aeb9bbfe86b742af9b75a160c44c914f41c Mon Sep 17 00:00:00 2001
From: Andy Shaw <qt-info@nokia.com>
Date: Tue, 21 Jul 2009 14:19:50 +0200
Subject: Another fix needed to build in a namespace on Mac with -arch ppc

Don't know how this got lost in the original submit since I had added
both.

Task-number: 257080
Reviewed-by: nrc
---
 src/gui/kernel/qt_cocoa_helpers_mac_p.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h
index 5156b9c..9cb5398 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h
+++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h
@@ -105,6 +105,8 @@
 #include <qpoint.h>
 #include "private/qt_mac_p.h"
 
+struct HIContentBorderMetrics;
+
 #ifdef Q_WS_MAC32
 typedef struct _NSPoint NSPoint; // Just redefine here so I don't have to pull in all of Cocoa.
 #else
@@ -121,7 +123,6 @@ void macWindowToolbarSet( void * /*OSWindowRef*/ window, void* toolbarRef );
 bool macWindowToolbarVisible( void * /*OSWindowRef*/ window );
 void macWindowSetHasShadow( void * /*OSWindowRef*/ window, bool hasShadow );
 void macWindowFlush(void * /*OSWindowRef*/ window);
-struct HIContentBorderMetrics;
 void qt_mac_updateContentBorderMetricts(void * /*OSWindowRef */window, const ::HIContentBorderMetrics &metrics);
 void * /*NSImage */qt_mac_create_nsimage(const QPixmap &pm);
 void qt_mac_update_mouseTracking(QWidget *widget);
-- 
cgit v0.12


From 150470d47d6871d163226de19f27c8b11a0131cf Mon Sep 17 00:00:00 2001
From: Anders Bakken <anders.bakken@nokia.com>
Date: Tue, 21 Jul 2009 16:00:32 -0700
Subject: Make sure DFB version macros are defined

Reviewed-by: Donald <qt-info@nokia.com>
---
 src/plugins/gfxdrivers/directfb/qdirectfbscreen.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index 9d1e670..090a685 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -44,6 +44,7 @@
 
 #include <QtGui/qscreen_qws.h>
 #include <directfb.h>
+#include <directfb_version.h>
 
 QT_BEGIN_HEADER
 
-- 
cgit v0.12


From 220b1cbcd253c8133ad185cd2be55db584071e67 Mon Sep 17 00:00:00 2001
From: Rohan McGovern <rohan.mcgovern@nokia.com>
Date: Wed, 22 Jul 2009 15:33:39 +1000
Subject: Add a (failing) test for QProcess bug 258462.

---
 tests/auto/qprocess/tst_qprocess.cpp | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp
index 6318d1d..3ce080a 100644
--- a/tests/auto/qprocess/tst_qprocess.cpp
+++ b/tests/auto/qprocess/tst_qprocess.cpp
@@ -141,6 +141,7 @@ private slots:
     void startFinishStartFinish();
     void invalidProgramString_data();
     void invalidProgramString();
+    void processEventsInAReadyReadSlot();
 
     // keep these at the end, since they use lots of processes and sometimes
     // caused obscure failures to occur in tests that followed them (esp. on the Mac)
@@ -154,6 +155,7 @@ protected slots:
     void restartProcess();
     void waitForReadyReadInAReadyReadSlotSlot();
     void waitForBytesWrittenInABytesWrittenSlotSlot();
+    void processEventsInAReadyReadSlotSlot();
     
 private:
     QProcess *process;
@@ -2024,5 +2026,34 @@ void tst_QProcess::invalidProgramString()
     QVERIFY(!QProcess::startDetached(programString));
 }
 
+//-----------------------------------------------------------------------------
+void tst_QProcess::processEventsInAReadyReadSlot()
+{
+#ifdef Q_OS_WINCE
+    QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
+#endif
+
+    QProcess process;
+    QVERIFY(QObject::connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(processEventsInAReadyReadSlotSlot())));
+
+    for (int i = 0; i < 10; ++i) {
+        QCOMPARE(process.state(), QProcess::NotRunning);
+
+#ifdef Q_OS_MAC
+        process.start("testProcessOutput/testProcessOutput.app");
+#else
+        process.start("testProcessOutput/testProcessOutput");
+#endif
+
+        QVERIFY(process.waitForFinished(10000));
+    }
+}
+
+//-----------------------------------------------------------------------------
+void tst_QProcess::processEventsInAReadyReadSlotSlot()
+{
+    qApp->processEvents();
+}
+
 QTEST_MAIN(tst_QProcess)
 #include "tst_qprocess.moc"
-- 
cgit v0.12


From 6ecce8dfe0c71bc4dcc510d7920f70f7799cb0a7 Mon Sep 17 00:00:00 2001
From: Andy Shaw <qt-info@nokia.com>
Date: Wed, 22 Jul 2009 10:35:03 +0200
Subject: Fix a potential crash due to the fact that _q_UpdateIndex() is
 reentered

This is confirmed to resolve a number of problems from the original
reportee.  It's already fixed in Qt 4.6 in a more wider fix, but this
one liner is a good to have in Qt 4.5.x anyway.

Task-number: 258194
Reviewed-by: alexis
---
 src/gui/graphicsview/qgraphicsscene.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 053338b..247347a 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -542,7 +542,7 @@ void QGraphicsScenePrivate::_q_updateIndex()
         // Regenerate the tree.
         if (regenerateIndex) {
             regenerateIndex = false;
-            bspTree.initialize(q->sceneRect(), depth);
+            bspTree.initialize(sceneRect, depth);
             unindexedItems = indexedItems;
             lastItemCount = indexedItems.size();
             q->update();
-- 
cgit v0.12


From 6c25a7cdea912f212ce00f43c7cfc862c1ecdd50 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Wed, 22 Jul 2009 14:08:07 +0200
Subject: Designer: Fixed bug in setting QUrl property values from resources.

Setting a file from a resource would result in 'qrc::/file' as
the resource browser returns ':/file'.
Reviewed-by: Jarek Kobus <jkobus@trolltech.com>
Initial-patch-by: andy <qt-info@nokia.com>
---
 .../src/components/propertyeditor/designerpropertymanager.cpp      | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp b/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp
index 2f6a51e..1092b92 100644
--- a/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp
+++ b/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp
@@ -254,8 +254,11 @@ void TextEditor::resourceActionActivated()
 {
     QString oldPath = m_editor->text();
     if (oldPath.startsWith(QLatin1String("qrc:")))
-        oldPath = oldPath.mid(4);
-    const QString newPath = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), oldPath, this);
+        oldPath.remove(0, 4);
+    // returns ':/file'
+    QString newPath = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), oldPath, this);
+    if (newPath.startsWith(QLatin1Char(':')))
+         newPath.remove(0, 1);
     if (newPath.isEmpty() || newPath == oldPath)
         return;
     const QString newText = QLatin1String("qrc:") + newPath;
-- 
cgit v0.12