diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-06-26 08:31:19 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-06-26 08:31:19 (GMT) |
commit | b914c388a809c17e4f76a4dcc1d3a1006e13c115 (patch) | |
tree | ef6723688578c7ff13fed8b4ea0c961aaf98fe09 /src | |
parent | 7278c142089d46946d1ad2558eae949220dfe0c4 (diff) | |
parent | d553f376a34ea1d27492a1a5fd14f79616f6a27c (diff) | |
download | Qt-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
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/webkit/WebCore/platform/qt/PlatformKeyboardEventQt.cpp | 9 | ||||
-rw-r--r-- | src/corelib/kernel/qmetaobject.cpp | 8 | ||||
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 30 | ||||
-rw-r--r-- | src/network/access/qnetworkreplyimpl_p.h | 5 | ||||
-rw-r--r-- | src/plugins/qpluginbase.pri | 2 | ||||
-rw-r--r-- | src/tools/moc/generator.cpp | 4 |
6 files changed, 54 insertions, 4 deletions
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"); |