summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-06-26 08:31:19 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-06-26 08:31:19 (GMT)
commitb914c388a809c17e4f76a4dcc1d3a1006e13c115 (patch)
treeef6723688578c7ff13fed8b4ea0c961aaf98fe09
parent7278c142089d46946d1ad2558eae949220dfe0c4 (diff)
parentd553f376a34ea1d27492a1a5fd14f79616f6a27c (diff)
downloadQt-b914c388a809c17e4f76a4dcc1d3a1006e13c115.zip
Qt-b914c388a809c17e4f76a4dcc1d3a1006e13c115.tar.gz
Qt-b914c388a809c17e4f76a4dcc1d3a1006e13c115.tar.bz2
Merge branch '4.5'
Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/network/access/qnetworkreplyimpl.cpp
-rwxr-xr-xconfig.tests/unix/compile.test2
-rw-r--r--dist/changes-4.5.3123
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/PlatformKeyboardEventQt.cpp9
-rw-r--r--src/corelib/kernel/qmetaobject.cpp8
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp30
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h5
-rw-r--r--src/plugins/qpluginbase.pri2
-rw-r--r--src/tools/moc/generator.cpp4
-rw-r--r--tests/auto/auto.pro1
-rw-r--r--tests/auto/qmetaobject/tst_qmetaobject.cpp22
-rw-r--r--tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro5
-rw-r--r--tests/auto/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp130
-rw-r--r--tools/assistant/tools/assistant/doc/assistant.qdocconf2
13 files changed, 337 insertions, 6 deletions
diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test
index f9c18fc..550890f 100755
--- a/config.tests/unix/compile.test
+++ b/config.tests/unix/compile.test
@@ -64,7 +64,7 @@ test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST"
cd "$OUTDIR/$TEST"
-test -e Makefile && make distclean >/dev/null 2>&1
+test -r Makefile && make distclean >/dev/null 2>&1
"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
diff --git a/dist/changes-4.5.3 b/dist/changes-4.5.3
new file mode 100644
index 0000000..096d28c
--- /dev/null
+++ b/dist/changes-4.5.3
@@ -0,0 +1,123 @@
+Qt 4.5.3 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 4.5.0. For more details,
+refer to the online documentation included in this distribution. The
+documentation is also available online:
+
+ http://doc.trolltech.com/4.5
+
+The Qt version 4.5 series is binary compatible with the 4.4.x series.
+Applications compiled for 4.4 will continue to run with 4.5.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Task Tracker:
+
+ http://www.qtsoftware.com/developer/task-tracker
+
+Each of these identifiers can be entered in the task tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* General *
+****************************************************************************
+
+General Improvements
+--------------------
+
+- Documentation and Examples
+
+Third party components
+----------------------
+
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+
+****************************************************************************
+* Database Drivers *
+****************************************************************************
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Qt for Linux/X11
+----------------
+
+
+Qt for Windows
+--------------
+
+
+Qt for Mac OS X
+---------------
+
+
+Qt for Embedded Linux
+---------------------
+
+
+Qt for Windows CE
+-----------------
+
+
+****************************************************************************
+* Compiler Specific Changes *
+****************************************************************************
+
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+- Build System
+
+- Assistant
+
+
+- Designer
+
+
+- Linguist
+ - Linguist GUI
+
+ - lupdate
+
+ - lrelease
+
+
+- rcc
+
+
+- moc
+
+
+- uic
+
+
+- uic3
+
+
+- qmake
+
+
+- configure
+
+
+- qtconfig
+
+
+- qt3to4
+
+
+****************************************************************************
+* Plugins *
+****************************************************************************
+
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/PlatformKeyboardEventQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
index 88cca5a..955da9b 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
@@ -511,6 +511,15 @@ void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
m_text = String();
m_unmodifiedText = String();
} else {
+ /*
+ When we receive shortcut events like Ctrl+V then the text in the QKeyEvent is
+ empty. If we're asked to disambiguate the event into a Char keyboard event,
+ we try to detect this situation and still set the text, to ensure that the
+ general event handling sends a key press event after this disambiguation.
+ */
+ if (m_text.isEmpty() && m_windowsVirtualKeyCode && m_qtEvent->key() < Qt::Key_Escape)
+ m_text.append(UChar(m_windowsVirtualKeyCode));
+
m_keyIdentifier = String();
m_windowsVirtualKeyCode = 0;
}
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 260be26..215f6ae 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -218,8 +218,14 @@ QObject *QMetaObject::newInstance(QGenericArgument val0,
QGenericArgument val8,
QGenericArgument val9) const
{
+ QByteArray constructorName = className();
+ {
+ int idx = constructorName.lastIndexOf(':');
+ if (idx != -1)
+ constructorName.remove(0, idx+1); // remove qualified part
+ }
QVarLengthArray<char, 512> sig;
- sig.append(className(), qstrlen(className()));
+ sig.append(constructorName.constData(), constructorName.length());
sig.append('(');
enum { MaximumParamCount = 10 };
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 265ebe9..d1dbdc9 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -56,6 +56,7 @@ inline QNetworkReplyImplPrivate::QNetworkReplyImplPrivate()
: backend(0), outgoingData(0), outgoingDataBuffer(0),
copyDevice(0), networkCache(0),
cacheEnabled(false), cacheSaveDevice(0),
+ notificationHandlingPaused(false),
bytesDownloaded(0), lastBytesDownloaded(-1), bytesUploaded(-1),
state(Idle)
{
@@ -126,9 +127,11 @@ void QNetworkReplyImplPrivate::_q_copyReadyRead()
lastBytesDownloaded = bytesDownloaded;
QVariant totalSize = cookedHeaders.value(QNetworkRequest::ContentLengthHeader);
+ pauseNotificationHandling();
emit q->downloadProgress(bytesDownloaded,
totalSize.isNull() ? Q_INT64_C(-1) : totalSize.toLongLong());
emit q->readyRead();
+ resumeNotificationHandling();
}
void QNetworkReplyImplPrivate::_q_copyReadChannelFinished()
@@ -262,6 +265,9 @@ void QNetworkReplyImplPrivate::backendNotify(InternalNotifications notification)
void QNetworkReplyImplPrivate::handleNotifications()
{
+ if (notificationHandlingPaused)
+ return;
+
NotificationQueue current = pendingNotifications;
pendingNotifications.clear();
@@ -292,6 +298,22 @@ void QNetworkReplyImplPrivate::handleNotifications()
}
}
+// Do not handle the notifications while we are emitting downloadProgress
+// or readyRead
+void QNetworkReplyImplPrivate::pauseNotificationHandling()
+{
+ notificationHandlingPaused = true;
+}
+
+// Resume notification handling
+void QNetworkReplyImplPrivate::resumeNotificationHandling()
+{
+ Q_Q(QNetworkReplyImpl);
+ notificationHandlingPaused = false;
+ if (pendingNotifications.size() >= 1)
+ QCoreApplication::postEvent(q, new QEvent(QEvent::NetworkReplyUpdated));
+}
+
void QNetworkReplyImplPrivate::createCache()
{
// check if we can save and if we're allowed to
@@ -347,7 +369,9 @@ void QNetworkReplyImplPrivate::emitUploadProgress(qint64 bytesSent, qint64 bytes
{
Q_Q(QNetworkReplyImpl);
bytesUploaded = bytesSent;
+ pauseNotificationHandling();
emit q->uploadProgress(bytesSent, bytesTotal);
+ resumeNotificationHandling();
}
@@ -398,12 +422,14 @@ void QNetworkReplyImplPrivate::appendDownstreamData(const QByteArray &data)
QPointer<QNetworkReplyImpl> qq = q;
QVariant totalSize = cookedHeaders.value(QNetworkRequest::ContentLengthHeader);
+ pauseNotificationHandling();
emit q->downloadProgress(bytesDownloaded,
totalSize.isNull() ? Q_INT64_C(-1) : totalSize.toLongLong());
emit q->readyRead();
// hopefully we haven't been deleted here
if (!qq.isNull()) {
+ resumeNotificationHandling();
// do we still have room in the buffer?
if (nextDownstreamBlockSize() > 0)
backendNotify(QNetworkReplyImplPrivate::NotifyDownstreamReadyWrite);
@@ -441,6 +467,7 @@ void QNetworkReplyImplPrivate::finished()
state = Finished;
pendingNotifications.clear();
+ pauseNotificationHandling();
QVariant totalSize = cookedHeaders.value(QNetworkRequest::ContentLengthHeader);
if (totalSize.isNull() || totalSize == -1) {
emit q->downloadProgress(bytesDownloaded, bytesDownloaded);
@@ -448,14 +475,17 @@ void QNetworkReplyImplPrivate::finished()
if (bytesUploaded == -1 && (outgoingData || outgoingDataBuffer))
emit q->uploadProgress(0, 0);
+ resumeNotificationHandling();
completeCacheSave();
// note: might not be a good idea, since users could decide to delete us
// which would delete the backend too...
// maybe we should protect the backend
+ pauseNotificationHandling();
emit q->readChannelFinished();
emit q->finished();
+ resumeNotificationHandling();
}
void QNetworkReplyImplPrivate::error(QNetworkReplyImpl::NetworkError code, const QString &errorMessage)
diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h
index 4d75526..3e89a00 100644
--- a/src/network/access/qnetworkreplyimpl_p.h
+++ b/src/network/access/qnetworkreplyimpl_p.h
@@ -130,6 +130,9 @@ public:
void setup(QNetworkAccessManager::Operation op, const QNetworkRequest &request,
QIODevice *outgoingData);
void setNetworkCache(QAbstractNetworkCache *networkCache);
+
+ void pauseNotificationHandling();
+ void resumeNotificationHandling();
void backendNotify(InternalNotifications notification);
void handleNotifications();
void createCache();
@@ -159,6 +162,8 @@ public:
QIODevice *cacheSaveDevice;
NotificationQueue pendingNotifications;
+ bool notificationHandlingPaused;
+
QUrl urlForLastAuthentication;
#ifndef QT_NO_NETWORKPROXY
QNetworkProxy lastProxyAuthentication;
diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri
index ae39021..82a1459 100644
--- a/src/plugins/qpluginbase.pri
+++ b/src/plugins/qpluginbase.pri
@@ -1,6 +1,6 @@
TEMPLATE = lib
isEmpty(QT_MAJOR_VERSION) {
- VERSION=4.5.2
+ VERSION=4.5.3
} else {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
}
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 563310d..b872dfd 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -928,7 +928,7 @@ void Generator::generateStaticMetacall(const QByteArray &prefix)
fprintf(out, " switch (_id) {\n");
for (int ctorindex = 0; ctorindex < cdef->constructorList.count(); ++ctorindex) {
fprintf(out, " case %d: { %s *_r = new %s(", ctorindex,
- cdef->classname.constData(), cdef->classname.constData());
+ cdef->qualified.constData(), cdef->qualified.constData());
const FunctionDef &f = cdef->constructorList.at(ctorindex);
int offset = 1;
for (int j = 0; j < f.arguments.count(); ++j) {
@@ -946,7 +946,7 @@ void Generator::generateStaticMetacall(const QByteArray &prefix)
fprintf(out, " }\n");
if (!isQObject)
- fprintf(out, " _id = %s::staticMetaObject.superClass()->static_metacall(_c, _id, _a);\n", cdef->classname.constData());
+ fprintf(out, " _id = %s::staticMetaObject.superClass()->static_metacall(_c, _id, _a);\n", cdef->qualified.constData());
fprintf(out, " if (_id < 0)\n return _id;\n");
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index a8b1059..9b62116 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -216,6 +216,7 @@ SUBDIRS += _networkselftest \
qnetworkproxy \
qnetworkrequest \
qnetworkreply \
+ qnetworkaccessmanager_and_qprogressdialog \
qnumeric \
qobject \
qobjectrace \
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index 95d19e2..dea0ffb 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -605,6 +605,19 @@ void tst_QMetaObject::invokeCustomTypes()
QCOMPARE(obj.sum, 3);
}
+namespace NamespaceWithConstructibleClass
+{
+
+class ConstructibleClass : public QObject
+{
+ Q_OBJECT
+public:
+ Q_INVOKABLE ConstructibleClass(QObject *parent = 0)
+ : QObject(parent) {}
+};
+
+}
+
void tst_QMetaObject::invokeMetaConstructor()
{
const QMetaObject *mo = &QtTestObject::staticMetaObject;
@@ -619,6 +632,15 @@ void tst_QMetaObject::invokeMetaConstructor()
QCOMPARE(obj2->parent(), (QObject*)&obj);
QVERIFY(qobject_cast<QtTestObject*>(obj2) != 0);
}
+ // class in namespace
+ const QMetaObject *nsmo = &NamespaceWithConstructibleClass::ConstructibleClass::staticMetaObject;
+ {
+ QtTestObject obj;
+ QObject *obj2 = nsmo->newInstance(Q_ARG(QObject*, &obj));
+ QVERIFY(obj2 != 0);
+ QCOMPARE(obj2->parent(), (QObject*)&obj);
+ QVERIFY(qobject_cast<NamespaceWithConstructibleClass::ConstructibleClass*>(obj2) != 0);
+ }
}
void tst_QMetaObject::normalizedSignature_data()
diff --git a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro
new file mode 100644
index 0000000..7ed5b07
--- /dev/null
+++ b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro
@@ -0,0 +1,5 @@
+load(qttest_p4)
+SOURCES += tst_qnetworkaccessmanager_and_qprogressdialog.cpp
+QT += network
+
+
diff --git a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
new file mode 100644
index 0000000..62e4ce5
--- /dev/null
+++ b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** 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 either Technology Preview License Agreement or the
+** Beta Release License Agreement.
+**
+** 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.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://www.qtsoftware.com/contact.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtTest/QtTest>
+#include <QtGui>
+#include <QtCore>
+#include <QtNetwork/QNetworkAccessManager>
+#include <QtNetwork/QNetworkRequest>
+#include <QtNetwork/QNetworkReply>
+#include <qdebug.h>
+
+#include "../network-settings.h"
+
+
+class tst_QNetworkAccessManager_And_QProgressDialog : public QObject
+{
+Q_OBJECT
+private slots:
+ void downloadCheck();
+};
+
+class DownloadCheckWidget : public QWidget
+{
+ Q_OBJECT;
+public:
+ DownloadCheckWidget(QWidget *parent = 0) : QWidget(parent)
+ , progressDlg(this), netmanager(this)
+ , lateReadyRead(true)
+ {
+ progressDlg.setRange(1, 100);
+ QMetaObject::invokeMethod(this, "go", Qt::QueuedConnection);
+ }
+ bool lateReadyRead;
+public slots:
+ void go()
+ {
+ QNetworkReply *reply = netmanager.get(
+ QNetworkRequest(
+ QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile")
+ ));
+ connect(reply, SIGNAL(downloadProgress(qint64, qint64)),
+ this, SLOT(dataReadProgress(qint64, qint64)));
+ connect(reply, SIGNAL(readyRead()),
+ this, SLOT(dataReadyRead()));
+ connect(reply, SIGNAL(finished()), this, SLOT(finishedFromReply()));
+
+ progressDlg.exec();
+ }
+ void dataReadProgress(qint64 done, qint64 total)
+ {
+ QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
+ progressDlg.setMaximum(total);
+ progressDlg.setValue(done);
+ }
+ void dataReadyRead()
+ {
+ QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
+ lateReadyRead = true;
+ }
+ void finishedFromReply()
+ {
+ QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
+ lateReadyRead = false;
+ reply->deleteLater();
+ QTestEventLoop::instance().exitLoop();
+ }
+
+
+private:
+ QProgressDialog progressDlg;
+ QNetworkAccessManager netmanager;
+};
+
+void tst_QNetworkAccessManager_And_QProgressDialog::downloadCheck()
+{
+ DownloadCheckWidget widget;
+ widget.show();
+ // run and exit on finished()
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ // run some more to catch the late readyRead() (or: to not catch it)
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(QTestEventLoop::instance().timeout());
+ // the following fails when a readyRead() was received after finished()
+ QVERIFY(!widget.lateReadyRead);
+}
+
+
+
+QTEST_MAIN(tst_QNetworkAccessManager_And_QProgressDialog)
+#include "tst_qnetworkaccessmanager_and_qprogressdialog.moc"
diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf
index aca97ed..9566e90 100644
--- a/tools/assistant/tools/assistant/doc/assistant.qdocconf
+++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf
@@ -12,5 +12,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
"<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
"<td width=\"30%\" align=\"left\">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
"<td width=\"40%\" align=\"center\">Trademarks</td>\n" \
- "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.5.2</div></td>\n" \
+ "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.5.3</div></td>\n" \
"</tr></table></div></address>"