From 3e9014ed6179acd06a11dcd089490a6c16dc07e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 13 Mar 2020 17:48:16 +0100 Subject: QNetworkReply: stabilize sslSessionSharing test Sometimes this test would fail due to the session not actually being reused. The cause of this was that the requests were sometimes being completed 1-by-1, enabling the individual requests to re-use the already-connected socket completely because it stayed connected. Setting the Connection-header to close lets us be sure that the socket cannot be re-used when the request is finished. Fixes: QTBUG-82846 Change-Id: I5da8baa50a3a45fb60f1e1613e500e3e9c034fb0 Reviewed-by: Timur Pocheptsov --- tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 7d065f1248..6450d2a5d2 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -6490,6 +6490,9 @@ void tst_QNetworkReply::sslSessionSharing() QNetworkRequest warmupRequest(urlString); QFETCH(bool, sessionSharingEnabled); warmupRequest.setAttribute(QNetworkRequest::User, sessionSharingEnabled); // so we can read it from the slot + // Make sure the socket is closed when the request is finished to guarantee that + // the _socket_ is not reused, but rather the ssl session + warmupRequest.setRawHeader("Connection", "close"); if (! sessionSharingEnabled) { QSslConfiguration configuration(QSslConfiguration::defaultConfiguration()); configuration.setSslOption(QSsl::SslOptionDisableSessionSharing, true); -- cgit v1.2.3 From b345087ddee39679223147e1da8f1240fb3bc8b9 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 16 Mar 2020 21:37:25 +0100 Subject: Log the possible socket error code for the flaky test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tst_QSocks5SocketEngine::simpleConnectToIMAP() is flaky. It may be useful to log the socket error, to provide more info in case the test fails again. Change-Id: Ia5518dce13fd9da1fa5bfb3d5cf3a52a908b8698 Reviewed-by: Timur Pocheptsov Reviewed-by: Mårten Nordheim --- .../auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp index 85eec6e783..009c5b7240 100644 --- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -309,7 +309,7 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP() QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::imapServerIp()); // Wait for the greeting - QVERIFY(socketDevice.waitForRead()); + QVERIFY2(socketDevice.waitForRead(), qPrintable("Socket error:" + socketDevice.errorString())); // Read the greeting qint64 available = socketDevice.bytesAvailable(); -- cgit v1.2.3 From 7150b07041bf05d953e82aa8d1738c83e9ba80f6 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 17 Mar 2020 11:15:23 +0100 Subject: QLocale: Fix test on MinGW 8.1.0 32 bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The call of _control87 would crash because of the previous test. Change-Id: I254efe9c2e9892a473a02663e5ff7016791d5d6d Reviewed-by: Tony Sarajärvi --- tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index ec85a6c5c6..5eb6a6a9a4 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -1395,6 +1395,7 @@ void tst_QLocale::fpExceptions() // check that double-to-string conversion doesn't throw floating point exceptions when they are // enabled #ifdef Q_OS_WIN + _clear87(); unsigned int oldbits = _control87(0, 0); _control87( 0 | _EM_INEXACT, _MCW_EM ); #endif -- cgit v1.2.3 From 1b4d01d163a19bc5bc290930c879fba83d870826 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 17 Mar 2020 14:41:34 +0100 Subject: Add 'since' tag to documentation of new enum value Change-Id: I400dc1f2d3dba0fa50b2bcb5e4efbcfc0ad912fd Reviewed-by: Paul Wicking --- src/widgets/styles/qstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 5570d59276..1066bb48c9 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1012,7 +1012,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SE_PushButtonFocusRect Area for the focus rect (usually larger than the contents rect). \value SE_PushButtonLayoutItem Area that counts for the parent layout. - \value SE_PushButtonBevel Area used for the bevel of the button. + \value SE_PushButtonBevel [since 5.15] Area used for the bevel of the button. \value SE_CheckBoxIndicator Area for the state indicator (e.g., check mark). \value SE_CheckBoxContents Area for the label (text or pixmap). -- cgit v1.2.3 From b43082650174288553961a1afeff3a84e5860c28 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 17 Mar 2020 13:06:07 +0100 Subject: Fix memory leak on new QThreadPool::tryStart version Also documents the ownership of the traditional tryStart better, and remove a redundant check. Change-Id: I06202465b782926724fa33a901d08c1626f87373 Reviewed-by: Sona Kurazyan --- src/corelib/thread/qthreadpool.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp index a9352c3894..44cdf071df 100644 --- a/src/corelib/thread/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp @@ -534,7 +534,7 @@ void QThreadPool::start(std::function functionToRun, int priority) does nothing and returns \c false. Otherwise, \a runnable is run immediately using one available thread and this function returns \c true. - Note that the thread pool takes ownership of the \a runnable if + Note that on success the thread pool takes ownership of the \a runnable if \l{QRunnable::autoDelete()}{runnable->autoDelete()} returns \c true, and the \a runnable will be deleted automatically by the thread pool after the \l{QRunnable::run()}{runnable->run()} returns. If @@ -549,12 +549,7 @@ bool QThreadPool::tryStart(QRunnable *runnable) return false; Q_D(QThreadPool); - QMutexLocker locker(&d->mutex); - - if (d->allThreads.isEmpty() == false && d->activeThreadCount() >= d->maxThreadCount) - return false; - return d->tryStart(runnable); } @@ -571,7 +566,17 @@ bool QThreadPool::tryStart(std::function functionToRun) { if (!functionToRun) return false; - return tryStart(QRunnable::create(std::move(functionToRun))); + + Q_D(QThreadPool); + QMutexLocker locker(&d->mutex); + if (!d->allThreads.isEmpty() && d->activeThreadCount() >= d->maxThreadCount) + return false; + + QRunnable *runnable = QRunnable::create(std::move(functionToRun)); + if (d->tryStart(runnable)) + return true; + delete runnable; + return false; } /*! \property QThreadPool::expiryTimeout -- cgit v1.2.3 From 0677525f2ed0bf195acdc4c6d047c258e2f9f523 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 16 Mar 2020 18:01:15 +0100 Subject: Update Unicode license for CLDR and UCD Task-number: QTBUG-82747 Change-Id: I6bbecaf3f0a8f8e7e0ad31074d88dea7ec98dff2 Reviewed-by: Paul Wicking --- src/corelib/text/UNICODE_LICENSE.txt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/corelib/text/UNICODE_LICENSE.txt b/src/corelib/text/UNICODE_LICENSE.txt index 1c73202b74..567fda24dd 100644 --- a/src/corelib/text/UNICODE_LICENSE.txt +++ b/src/corelib/text/UNICODE_LICENSE.txt @@ -1,5 +1,20 @@ -Copyright © 1991-2018 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +See Terms of Use for definitions of Unicode Inc.'s +Data Files and Software. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2019 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in https://www.unicode.org/copyright.html. Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation -- cgit v1.2.3 From 8337684b044b944ba99c7e9a69933ea29e1194ab Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 17 Mar 2020 17:14:16 +0100 Subject: Fix docs suggesting that it's possible to draw to the X11 screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not possible anymore, since many years. The desktop's don't use the X11 root window anymore :) Fixes: QTBUG-82880 Change-Id: I923f29f23e61d93640cacb2ac20620c5ddc480b9 Reviewed-by: Tor Arne Vestbø --- src/widgets/kernel/qapplication.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index f49461b2d0..a2c2dccbcc 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2695,8 +2695,6 @@ void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) QDesktopWidget has various functions for obtaining useful geometries upon the desktop, such as QDesktopWidget::screenGeometry() and QDesktopWidget::availableGeometry(). - - On X11, it is also possible to draw on the desktop. */ QDesktopWidget *QApplication::desktop() { -- cgit v1.2.3 From 943cb0999dbbf1da99c1358b81ea3298ee116447 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 17 Mar 2020 14:34:24 +0100 Subject: Header-review: add Q_DECL_DEPRECATED_X macro to deprecated method Change-Id: I486d479b2e07042b397869aab117f44e65539f1e Reviewed-by: Lars Knoll --- src/widgets/dialogs/qwizard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h index a40635c4a5..dc29c80f51 100644 --- a/src/widgets/dialogs/qwizard.h +++ b/src/widgets/dialogs/qwizard.h @@ -129,7 +129,7 @@ public: QWizardPage *page(int id) const; bool hasVisitedPage(int id) const; #if QT_DEPRECATED_SINCE(5, 15) - QList visitedPages() const; + Q_DECL_DEPRECATED_X("Use visitedIds() instead") QList visitedPages() const; #endif QList visitedIds() const; QList pageIds() const; -- cgit v1.2.3