From 5cc8175242addb6668c3af299e9bc002f23527a2 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Wed, 9 Nov 2011 17:01:09 +0100 Subject: Updated WebKit to 52a11cec052aa40d3bbc06861be1177b649b4a99 --- src/3rdparty/webkit/.tag | 2 +- src/3rdparty/webkit/ChangeLog | 20 +++++ src/3rdparty/webkit/Source/WebCore/WebCore.pri | 4 +- .../Source/WebCore/bindings/js/JSExceptionBase.h | 86 +++++++++++----------- src/3rdparty/webkit/Source/WebKit.pri | 10 ++- src/3rdparty/webkit/VERSION | 2 +- 6 files changed, 73 insertions(+), 51 deletions(-) diff --git a/src/3rdparty/webkit/.tag b/src/3rdparty/webkit/.tag index a5f6423..12a28b8 100644 --- a/src/3rdparty/webkit/.tag +++ b/src/3rdparty/webkit/.tag @@ -1 +1 @@ -99371ddc1d61832131835964a753e1c5817f6916 +52a11cec052aa40d3bbc06861be1177b649b4a99 diff --git a/src/3rdparty/webkit/ChangeLog b/src/3rdparty/webkit/ChangeLog index a661d6a..bbaf26d 100644 --- a/src/3rdparty/webkit/ChangeLog +++ b/src/3rdparty/webkit/ChangeLog @@ -1,3 +1,23 @@ +2011-11-09 Zeno Albisser + + [Qt] Unreviewed: Fix build on Mac. + https://bugreports.qt.nokia.com/browse/QTBUG-20619 + + This bug was introduced by the previous commit + for the same bugreport. + + * Source/WebKit.pri: + +2011-11-09 Zeno Albisser + + [Qt] Unreviewed: Fix debug_and_release build on Windows. + https://bugreports.qt.nokia.com/browse/QTBUG-20619 + + This bug was introduced by the previous commit + for the same bugreport. + + * Source/WebKit.pri: + 2011-11-03 Zeno Albisser [Qt] Unreviewed: Fix universal binary build on Mac. diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pri b/src/3rdparty/webkit/Source/WebCore/WebCore.pri index d8ba8a6..82311d2 100644 --- a/src/3rdparty/webkit/Source/WebCore/WebCore.pri +++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pri @@ -153,7 +153,7 @@ symbian { CONFIG += do_not_build_as_thumb CONFIG(release, debug|release): QMAKE_CXXFLAGS.ARMCC += -OTime -O3 - # Symbian plugin support. + # Symbian plugin support LIBS += -lefsrv !CONFIG(QTDIR_build) { @@ -303,7 +303,7 @@ win32-* { } # Remove whole program optimizations due to miscompilations -win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{ +win32-msvc2005|win32-msvc2008|wince*:{ QMAKE_CFLAGS_RELEASE -= -GL QMAKE_CXXFLAGS_RELEASE -= -GL diff --git a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h index 7713002..01c6ac2 100644 --- a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h +++ b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h @@ -1,43 +1,43 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef JSExceptionBase_h -#define JSExceptionBase_h - -namespace JSC { - -class JSValue; - -} // namespace JSC - -namespace WebCore { - -class ExceptionBase; - -ExceptionBase* toExceptionBase(JSC::JSValue); - -} // namespace WebCore - -#endif // JSExceptionBase_h +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef JSExceptionBase_h +#define JSExceptionBase_h + +namespace JSC { + +class JSValue; + +} // namespace JSC + +namespace WebCore { + +class ExceptionBase; + +ExceptionBase* toExceptionBase(JSC::JSValue); + +} // namespace WebCore + +#endif // JSExceptionBase_h diff --git a/src/3rdparty/webkit/Source/WebKit.pri b/src/3rdparty/webkit/Source/WebKit.pri index bc889d1..c469d1a 100644 --- a/src/3rdparty/webkit/Source/WebKit.pri +++ b/src/3rdparty/webkit/Source/WebKit.pri @@ -12,10 +12,12 @@ CONFIG(QTDIR_build) { win32|mac:!macx-xcode:CONFIG += debug_and_release # In case we are building a universal binary for Qt, building debug is not # possible because we would exceed the maximum library size for 32bit. - mac:CONFIG(QT_CONFIG, x86):CONFIG(QT_CONFIG, x86_64):debug|debug_and_release { - message(Building a universal binary with debug symbols is not possible. Building release!) - CONFIG -= debug_and_release debug - CONFIG += release + mac:contains(QT_CONFIG, x86):contains(QT_CONFIG, x86_64) { + CONFIG(debug_and_release)|CONFIG(debug, debug|release) { + message(Building a universal binary with debug symbols is not possible. Building release!) + CONFIG -= debug_and_release debug + CONFIG += release + } } } else { !CONFIG(release, debug|release) { diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 19f5536..750e7e7 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 - 99371ddc1d61832131835964a753e1c5817f6916 + 52a11cec052aa40d3bbc06861be1177b649b4a99 -- cgit v0.12 From 42543208749fc3b6b24983c0a7b3a6d8e62801a2 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Mon, 19 Sep 2011 10:43:14 -0300 Subject: Re-apply change 945c44d0865cf44363e6c860995f971ce952dd5f by Ademar de Souza Reis Jr dos2unix on a webkit source file (fix support for Visual Studio) webkit/Source/WebCore/bindings/js/JSExceptionBase.h had CRLF terminations, which Visual Studio didn't like for some reason. Reported by Simo Falt. Patch is also being submited to upstream (webkit.org) --- .../Source/WebCore/bindings/js/JSExceptionBase.h | 86 +++++++++++----------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h index 01c6ac2..7713002 100644 --- a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h +++ b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSExceptionBase.h @@ -1,43 +1,43 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef JSExceptionBase_h -#define JSExceptionBase_h - -namespace JSC { - -class JSValue; - -} // namespace JSC - -namespace WebCore { - -class ExceptionBase; - -ExceptionBase* toExceptionBase(JSC::JSValue); - -} // namespace WebCore - -#endif // JSExceptionBase_h +/* + * Copyright (C) 2009 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef JSExceptionBase_h +#define JSExceptionBase_h + +namespace JSC { + +class JSValue; + +} // namespace JSC + +namespace WebCore { + +class ExceptionBase; + +ExceptionBase* toExceptionBase(JSC::JSValue); + +} // namespace WebCore + +#endif // JSExceptionBase_h -- cgit v0.12 From 3c4f8767ccd4f6214eae17992aa7b0ad0630eb36 Mon Sep 17 00:00:00 2001 From: Ademar de Souza Reis Jr Date: Tue, 20 Sep 2011 11:12:04 -0300 Subject: Re-apply change 37cde52cb17b57f8ec89c248f06331ed4977e51c by Ademar de Souza Reis Jr Workaround MSVC2010 problems when linking QtWebKit Include MSVC2010 in the list of compilers where incremental build is disabled (INCREMENTAL:NO). Change suggested by Simo Falt --- src/3rdparty/webkit/Source/WebCore/WebCore.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pri b/src/3rdparty/webkit/Source/WebCore/WebCore.pri index 82311d2..00357a1 100644 --- a/src/3rdparty/webkit/Source/WebCore/WebCore.pri +++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pri @@ -303,7 +303,7 @@ win32-* { } # Remove whole program optimizations due to miscompilations -win32-msvc2005|win32-msvc2008|wince*:{ +win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{ QMAKE_CFLAGS_RELEASE -= -GL QMAKE_CXXFLAGS_RELEASE -= -GL -- cgit v0.12 From 7a401da71f27ca9e9cd10bc8f1e0995a9992100d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 22 Sep 2011 14:48:44 +0200 Subject: Re-apply change e3208a8d44423bc3b5c32e2e90f68675e51a3b73 by Andreas Kling Sentences should end with a period! (Poor man's rebuild trigger.) --- src/3rdparty/webkit/Source/WebCore/WebCore.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pri b/src/3rdparty/webkit/Source/WebCore/WebCore.pri index 00357a1..d8ba8a6 100644 --- a/src/3rdparty/webkit/Source/WebCore/WebCore.pri +++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pri @@ -153,7 +153,7 @@ symbian { CONFIG += do_not_build_as_thumb CONFIG(release, debug|release): QMAKE_CXXFLAGS.ARMCC += -OTime -O3 - # Symbian plugin support + # Symbian plugin support. LIBS += -lefsrv !CONFIG(QTDIR_build) { -- cgit v0.12 From 054fa68b6ae852e84f2d44a73260b4282286f5ab Mon Sep 17 00:00:00 2001 From: jahonkon Date: Fri, 11 Nov 2011 10:59:47 +0100 Subject: Fix QPlainTextEdit when using Qt::TextSelectableByKeyboard flag It is not possible to select text with keyboard when specifying only Qt::TextSelectableByKeyboard flag. Task-number: QTBUG-18952 Reviewed-by: Friedemann Kleint --- src/gui/text/qtextcontrol.cpp | 7 ++----- src/gui/widgets/qplaintextedit.cpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 5babbc2..ffcd90b 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -2029,10 +2029,7 @@ void QTextControlPrivate::focusEvent(QFocusEvent *e) #endif ))) { #endif - cursorOn = (interactionFlags & Qt::TextSelectableByKeyboard); - if (interactionFlags & Qt::TextEditable) { - setBlinkingCursorEnabled(true); - } + setBlinkingCursorEnabled(interactionFlags & (Qt::TextEditable | Qt::TextSelectableByKeyboard)); #ifdef QT_KEYPAD_NAVIGATION } #endif @@ -2808,7 +2805,7 @@ void QTextControl::setTextInteractionFlags(Qt::TextInteractionFlags flags) d->interactionFlags = flags; if (d->hasFocus) - d->setBlinkingCursorEnabled(flags & Qt::TextEditable); + d->setBlinkingCursorEnabled(flags & (Qt::TextEditable | Qt::TextSelectableByKeyboard)); } Qt::TextInteractionFlags QTextControl::textInteractionFlags() const diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index f2fca8f..3b2c8fd 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -1900,7 +1900,7 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e) } } - bool drawCursor = (editable + bool drawCursor = ((editable || (textInteractionFlags() & Qt::TextSelectableByKeyboard)) && context.cursorPosition >= blpos && context.cursorPosition < blpos + bllen); -- cgit v0.12 From 00020eed3fa948f69cfa776e92121edec6f975cc Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Fri, 11 Nov 2011 12:10:22 +0100 Subject: Don't directly access QList contents The existing code doesn't work on 64bit machines. We must first convert the list into a QVector, which guarantees that elements are laid out correctly as an array. Merge-request: 1467 Reviewed-by: thiago --- src/dbus/qdbuspendingcall.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index ea84742..2278db4 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -180,9 +180,12 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb if (metaTypes.at(count) == QDBusMetaTypeId::message) --count; - // QList is actually a vector - // kids, don't try this at home - setMetaTypes(count, count ? &metaTypes.at(1) : 0); + if (count == 0) { + setMetaTypes(count, 0); + } else { + QVector types = QVector::fromList(metaTypes); + setMetaTypes(count, types.constData() + 1); + } return true; } -- cgit v0.12 From cb2d647c1d4c01f3ab6131d7044b5afff2e5a434 Mon Sep 17 00:00:00 2001 From: Sergey Belyashov Date: Fri, 11 Nov 2011 12:27:43 +0100 Subject: Russian translation update Merge-request: 2715 Reviewed-by: Oswald Buddenhagen --- translations/qt_ru.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/translations/qt_ru.ts b/translations/qt_ru.ts index 348b1ce..aebbac2 100644 --- a/translations/qt_ru.ts +++ b/translations/qt_ru.ts @@ -1816,14 +1816,6 @@ to QDeclarativeImportDatabase - cannot load module "%1": File name case mismatch for "%2" - невозможно загрузить модуль «%1»: Регистр имени файла не соответствует «%2» - - - module "%1" definition "%2" not readable - невозможно прочитать определение «%2» модуля «%1» - - plugin cannot be loaded for module "%1": %2 не удалось загрузить плагин для модуля «%1»: %2 @@ -1876,8 +1868,8 @@ to не является типом - File name case mismatch for "%2" - Регистр имени файла не соответствует «%2» + File name case mismatch for "%1" + Регистр имени файла не соответствует «%1» @@ -4977,7 +4969,11 @@ Please choose a different file name. bad lookahead syntax - неправильный предварительный синтаксис + неправильный синтаксис lookahead + + + lookbehinds not supported, see QTBUG-2371 + lookbehind не поддерживается, см. QTBUG-2371 bad repetition syntax -- cgit v0.12 From d8213cbff66784a3e1132e278d608500f88975f2 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 26 Oct 2011 14:45:50 +0100 Subject: HTTP proxy engine - accept standard Connection header The Proxy-Connection header is a non standard header, but is widely used so forming a de-facto standard. Some proxies use the official Connection header, so we should check for that in responses. Otherwise https connections over http proxy fail in case the proxy sends "Connection: close" with the 407 reply. Task-number: QTBUG-22177 Change-Id: If6cfa4ebb7ac9d97d65b6ddcc8257aee20ac0448 Reviewed-by: Peter Hartmann (cherry picked from commit 0ad18e18d1223b173d4a0d374b70ec08c3b22b11) --- src/network/socket/qhttpsocketengine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 5c672ec..b62bc05 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -614,6 +614,10 @@ void QHttpSocketEngine::slotSocketReadNotification() bool willClose; QString proxyConnectionHeader = responseHeader.value(QLatin1String("Proxy-Connection")); + // Although most proxies use the unofficial Proxy-Connection header, the Connection header + // from http spec is also allowed. + if (proxyConnectionHeader.isEmpty()) + proxyConnectionHeader = responseHeader.value(QLatin1String("Connection")); proxyConnectionHeader = proxyConnectionHeader.toLower(); if (proxyConnectionHeader == QLatin1String("close")) { willClose = true; -- cgit v0.12 From 425272e7405eed077cb65a101d5dd1fafc4b11d2 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 10 Nov 2011 17:16:25 +0000 Subject: Fix warning when using QXmlInputSource with non opened QIODevice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling setTextModeEnabled on a QIODevice that is not open generates a warning as a result of QTBUG-20905. Previously, it caused incorrect behaviour when called with true. Now only call it if the QIODevice passed in is already opened. If not open, then it is opened by the xml reader without text mode, so there is no difference in behaviour. xml autotests still pass, although this removes several QWARN messages from the qdom autotest. Task-number: QTBUG-22659 Change-Id: Ie3137e44fe776bff6371ebd008428110168717ec Reviewed-by: João Abecasis (cherry picked from commit d457f148cf1efbea3db5fdc87c418cc9647e2baf) --- src/xml/sax/qxml.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index 0c7f2ab..c4c5f0c 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -1321,7 +1321,8 @@ QXmlInputSource::QXmlInputSource(QIODevice *dev) { init(); d->inputDevice = dev; - d->inputDevice->setTextModeEnabled(false); + if (dev->isOpen()) + d->inputDevice->setTextModeEnabled(false); } #ifdef QT3_SUPPORT -- cgit v0.12 From 22c7a2f69e833789e9b5613f809ea43561624482 Mon Sep 17 00:00:00 2001 From: Tero Ahola Date: Fri, 11 Nov 2011 13:03:02 +0100 Subject: Mac: Fix the color of check marks in menus with stylesheet Task-number: QTBUG-16989 Reviewed-by: Friedemann Kleint Reviewed-by: Morten Johan Sorvig Reviewed-by: Eike Ziller --- src/gui/styles/qmacstyle_mac.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 1c1713c..8f0e602 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -2920,10 +2920,14 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai QVector a(2); a << QLineF(x1, y1, x2, y2); a << QLineF(x2, y2, x3, y3); - if (opt->palette.currentColorGroup() == QPalette::Active) - p->setPen(QPen(Qt::white, 3)); - else + if (opt->palette.currentColorGroup() == QPalette::Active) { + if (opt->state & State_On) + p->setPen(QPen(opt->palette.highlightedText().color(), 3)); + else + p->setPen(QPen(opt->palette.text().color(), 3)); + } else { p->setPen(QPen(QColor(100, 100, 100), 3)); + } p->save(); p->setRenderHint(QPainter::Antialiasing); p->drawLines(a); -- cgit v0.12 From 371617983a7640a42d74db9c17f7ac3c9c22d29d Mon Sep 17 00:00:00 2001 From: Sami Rosendahl Date: Fri, 11 Nov 2011 13:29:38 +0100 Subject: Fix crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd If a HTTP server responds with gzip-encoded empty content without defining Content-Length in the response header QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd will crash because it calls zlib inflateEnd for an uninitialized stream. - Fixed the crash by adding a check if the stream is initialized to gunzipBodyPartiallyEnd. - Added a regression test tst_QNetworkReply::nb279420gzipNoContentLengthEmptyContentDisconnect PMO 279420 Task-number: QTBUG-22660 Signed-off-by: Sami Rosendahl Merge-request: 1465 Reviewed-by: Peter Hartmann --- src/network/access/qhttpnetworkreply.cpp | 6 ++++-- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index 6173b39..3dc8b2f 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -472,8 +472,10 @@ int QHttpNetworkReplyPrivate::gunzipBodyPartially(QByteArray &compressed, QByteA void QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd() { - inflateEnd(&inflateStrm); - initInflate = false; + if (initInflate) { + inflateEnd(&inflateStrm); + initInflate = false; + } } #endif diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 9df820a..14ad6a9 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -368,6 +368,7 @@ private Q_SLOTS: void qtbug15311doubleContentLength(); void qtbug18232gzipContentLengthZero(); + void nb279420gzipNoContentLengthEmptyContentDisconnect(); void synchronousRequest_data(); void synchronousRequest(); @@ -6139,6 +6140,28 @@ void tst_QNetworkReply::qtbug18232gzipContentLengthZero() QCOMPARE(reply->readAll(), QByteArray()); } +// Reproduced a crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd +// where zlib inflateEnd was called for uninitialized zlib stream +void tst_QNetworkReply::nb279420gzipNoContentLengthEmptyContentDisconnect() +{ + // Response with no Content-Length in header and empty content + QByteArray response("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\n\r\n"); + MiniHttpServer server(response); + server.doClose = true; + + QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); + QNetworkReplyPtr reply = manager.get(request); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(reply->isFinished()); + QCOMPARE(reply->error(), QNetworkReply::NoError); + QCOMPARE(reply->size(), qint64(0)); + QVERIFY(!reply->header(QNetworkRequest::ContentLengthHeader).isValid()); + QCOMPARE(reply->readAll(), QByteArray()); +} + void tst_QNetworkReply::synchronousRequest_data() { QTest::addColumn("url"); -- cgit v0.12 From ee3f763f3642d1a098e6293fbc586b34a3e6e8be Mon Sep 17 00:00:00 2001 From: Mikko Knuutila Date: Fri, 11 Nov 2011 14:15:29 +0100 Subject: Added base 10 to be used with QIntValidator. Fixes an error in QIntValidator, which occurred because locale.toInt() was missing a parameter for base value and this led it to presume wrongly that a base 8 is in use. Task-number: QTBUG-21602 Reviewed-by: Friedemann Kleint --- src/gui/widgets/qvalidator.cpp | 3 ++- tests/auto/qintvalidator/tst_qintvalidator.cpp | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qvalidator.cpp b/src/gui/widgets/qvalidator.cpp index b32bea8..4362f2b 100644 --- a/src/gui/widgets/qvalidator.cpp +++ b/src/gui/widgets/qvalidator.cpp @@ -400,8 +400,9 @@ QValidator::State QIntValidator::validate(QString & input, int&) const qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow); if (overflow || !ok) return Invalid; + if (entered >= b && entered <= t) { - locale().toInt(input, &ok); + locale().toInt(input, &ok, 10); return ok ? Acceptable : Intermediate; } diff --git a/tests/auto/qintvalidator/tst_qintvalidator.cpp b/tests/auto/qintvalidator/tst_qintvalidator.cpp index d537635..7e36093 100644 --- a/tests/auto/qintvalidator/tst_qintvalidator.cpp +++ b/tests/auto/qintvalidator/tst_qintvalidator.cpp @@ -168,6 +168,15 @@ void tst_QIntValidator::validate_data() QTest::newRow("8.9") << -1 << 100 << QString("5") << ACC; QTest::newRow("8.10") << -1 << 100 << QString("+") << INT; QTest::newRow("8.11") << -1 << 100 << QString("+50") << ACC; + + QTest::newRow("9.0") << -10 << 10 << QString("000") << ACC; + QTest::newRow("9.1") << -10 << 10 << QString("008") << ACC; + QTest::newRow("9.2") << -10 << 10 << QString("-008") << ACC; + QTest::newRow("9.3") << -10 << 10 << QString("00010") << ACC; + QTest::newRow("9.4") << -10 << 10 << QString("-00010") << ACC; + QTest::newRow("9.5") << -10 << 10 << QString("00020") << INV; + QTest::newRow("9.6") << -10 << 10 << QString("-00020") << INV; + } void tst_QIntValidator::validateArabic() -- cgit v0.12 From df819cfe17f6dfd089096063524932fc4975804f Mon Sep 17 00:00:00 2001 From: Markku Heikkila Date: Fri, 11 Nov 2011 14:35:23 +0100 Subject: Fixed wrong QGroupBox check state Handle mouserelease only if mouse is pressed in QGroupBox. Task-number: QTBUG-19170 Reviewed-by: Friedemann Kleint --- src/gui/widgets/qgroupbox.cpp | 4 ++++ tests/auto/qgroupbox/tst_qgroupbox.cpp | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/gui/widgets/qgroupbox.cpp b/src/gui/widgets/qgroupbox.cpp index 56fb2dd..db068cf 100644 --- a/src/gui/widgets/qgroupbox.cpp +++ b/src/gui/widgets/qgroupbox.cpp @@ -733,6 +733,10 @@ void QGroupBox::mouseReleaseEvent(QMouseEvent *event) } Q_D(QGroupBox); + if (!d->overCheckBox) { + event->ignore(); + return; + } QStyleOptionGroupBox box; initStyleOption(&box); QStyle::SubControl released = style()->hitTestComplexControl(QStyle::CC_GroupBox, &box, diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp index f1388bc..f3d26ef 100644 --- a/tests/auto/qgroupbox/tst_qgroupbox.cpp +++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp @@ -83,6 +83,7 @@ private slots: void toggledVsClicked(); void childrenAreDisabled(); void propagateFocus(); + void task_QTBUG_19170_ignoreMouseReleseEvent(); private: bool checked; @@ -473,5 +474,27 @@ void tst_QGroupBox::propagateFocus() QTRY_COMPARE(qApp->focusWidget(), static_cast(&lineEdit)); } +void tst_QGroupBox::task_QTBUG_19170_ignoreMouseReleseEvent() +{ + QGroupBox box; + box.setCheckable(true); + box.setChecked(false); + box.setTitle("This is a test for QTBUG-19170"); + box.show(); + + QStyleOptionGroupBox option; + option.initFrom(&box); + option.subControls = QStyle::SubControls(QStyle::SC_All); + QRect rect = box.style()->subControlRect(QStyle::CC_GroupBox, &option, + QStyle::SC_GroupBoxCheckBox, &box); + + QTest::mouseClick(&box, Qt::LeftButton, 0, rect.center()); + QCOMPARE(box.isChecked(), true); + + box.setChecked(false); + QTest::mouseRelease(&box, Qt::LeftButton, 0, rect.center()); + QCOMPARE(box.isChecked(), false); +} + QTEST_MAIN(tst_QGroupBox) #include "tst_qgroupbox.moc" -- cgit v0.12