From 41b2c477b771e7c214d09138af1a48701f573912 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 27 Jan 2020 13:12:45 +0100 Subject: [PATCH 1/8] Take care of NULL data from QStringView in QCollator Back-ends need to catch NULL data so as not to call system APIs with invalid pointers. [ChangeLog][QtCore][QCollator] Fixed a regression introduced in 5.14.0 that caused QCollator not to operate with default-constructed QStrings and print a warning on Windows. Fixes: QTBUG-81673 Change-Id: I2eafe1e188b436afcca3cf2ecdf98bba707c44c9 Reviewed-by: Thiago Macieira --- src/corelib/text/qcollator_icu.cpp | 7 ++++++- src/corelib/text/qcollator_macx.cpp | 7 ++++++- src/corelib/text/qcollator_posix.cpp | 7 ++++++- src/corelib/text/qcollator_win.cpp | 7 ++++++- .../auto/corelib/text/qcollator/tst_qcollator.cpp | 14 +++++++++++++- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/corelib/text/qcollator_icu.cpp b/src/corelib/text/qcollator_icu.cpp index 8acda45070..0dca1ee9c9 100644 --- a/src/corelib/text/qcollator_icu.cpp +++ b/src/corelib/text/qcollator_icu.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2013 Aleix Pol Gonzalez ** Contact: https://www.qt.io/licensing/ ** @@ -109,6 +109,11 @@ void QCollatorPrivate::cleanup() int QCollator::compare(QStringView s1, QStringView s2) const { + if (!s1.size()) + return s2.size() ? -1 : 0; + if (!s2.size()) + return +1; + if (d->dirty) d->init(); diff --git a/src/corelib/text/qcollator_macx.cpp b/src/corelib/text/qcollator_macx.cpp index 071d7c048f..cb8e073d4a 100644 --- a/src/corelib/text/qcollator_macx.cpp +++ b/src/corelib/text/qcollator_macx.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Aleix Pol Gonzalez +** Copyright (C) 2020 Aleix Pol Gonzalez ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -94,6 +94,11 @@ void QCollatorPrivate::cleanup() int QCollator::compare(QStringView s1, QStringView s2) const { + if (!s1.size()) + return s2.size() ? -1 : 0; + if (!s2.size()) + return +1; + if (d->dirty) d->init(); if (!d->collator) diff --git a/src/corelib/text/qcollator_posix.cpp b/src/corelib/text/qcollator_posix.cpp index 9cbc539ebe..ffcd214cfb 100644 --- a/src/corelib/text/qcollator_posix.cpp +++ b/src/corelib/text/qcollator_posix.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Aleix Pol Gonzalez +** Copyright (C) 2020 Aleix Pol Gonzalez ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -75,6 +75,11 @@ static void stringToWCharArray(QVarLengthArray &ret, QStringView string int QCollator::compare(QStringView s1, QStringView s2) const { + if (!s1.size()) + return s2.size() ? -1 : 0; + if (!s2.size()) + return +1; + if (d->isC()) return s1.compare(s2, caseSensitivity()); if (d->dirty) diff --git a/src/corelib/text/qcollator_win.cpp b/src/corelib/text/qcollator_win.cpp index 9d81de882f..54f57f1d24 100644 --- a/src/corelib/text/qcollator_win.cpp +++ b/src/corelib/text/qcollator_win.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Aleix Pol Gonzalez +** Copyright (C) 2020 Aleix Pol Gonzalez ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -89,6 +89,11 @@ void QCollatorPrivate::cleanup() int QCollator::compare(QStringView s1, QStringView s2) const { + if (!s1.size()) + return s2.size() ? -1 : 0; + if (!s2.size()) + return +1; + if (d->isC()) return s1.compare(s2, d->caseSensitivity); diff --git a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp index 2ae9c6e159..6806aa09b5 100644 --- a/tests/auto/corelib/text/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -105,6 +105,8 @@ void tst_QCollator::compare_data() QTest::newRow("english6") << QString("en_US") << QString("test 9") << QString("test_19") << -1 << -1 << true << true << -1; QTest::newRow("english7") << QString("en_US") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("english8") << QString("en_US") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("en-empty-word") << QString("en_US") << QString() << QString("non-empty") << -1 << -1 << false << true << -1; + QTest::newRow("en-empty-number") << QString("en_US") << QString() << QString("42") << -1 << -1 << true << true << -1; /* In Swedish, a with ring above (E5) comes before a with @@ -119,6 +121,8 @@ void tst_QCollator::compare_data() QTest::newRow("swedish6") << QString("sv_SE") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("swedish7") << QString("sv_SE") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("swedish8") << QString("sv_SE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("sv-empty-word") << QString("sv_SE") << QString() << QString("mett") << -1 << -1 << false << true << -1; + QTest::newRow("sv-empty-number") << QString("sv_SE") << QString() << QString("42") << -1 << -1 << true << true << -1; /* @@ -133,6 +137,8 @@ void tst_QCollator::compare_data() QTest::newRow("norwegian6") << QString("no_NO") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("norwegian7") << QString("no_NO") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("norwegian8") << QString("no_NO") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("nb-empty-word") << QString("nb_NO") << QString() << QString("mett") << -1 << -1 << false << true << -1; + QTest::newRow("nb-empty-number") << QString("nb_NO") << QString() << QString("42") << -1 << -1 << true << true << -1; /* In German, z comes *after* a with diaresis (E4), @@ -151,6 +157,8 @@ void tst_QCollator::compare_data() QTest::newRow("german11") << QString("de_DE") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("german12") << QString("de_DE") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("german13") << QString("de_DE") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("de-empty-word") << QString("de_DE") << QString() << QString("satt") << -1 << -1 << false << true << -1; + QTest::newRow("de-empty-number") << QString("de_DE") << QString() << QString("42") << -1 << -1 << true << true << -1; /* French sorting of e and e with acute accent @@ -163,11 +171,15 @@ void tst_QCollator::compare_data() QTest::newRow("french6") << QString("fr_FR") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("french7") << QString("fr_FR") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("french8") << QString("fr_FR") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; + QTest::newRow("fr-empty-word") << QString("fr_FR") << QString() << QString("plein") << -1 << -1 << false << true << -1; + QTest::newRow("fr-empty-number") << QString("fr_FR") << QString() << QString("42") << -1 << -1 << true << true << -1; // C locale: case sensitive [A-Z] < [a-z] but case insensitive [Aa] < [Bb] <...< [Zz] const QString C = QStringLiteral("C"); QTest::newRow("C:ABBA:AaaA") << C << QStringLiteral("ABBA") << QStringLiteral("AaaA") << -1 << 1 << false << false << 1; QTest::newRow("C:AZa:aAZ") << C << QStringLiteral("AZa") << QStringLiteral("aAZ") << -1 << 1 << false << false << 1; + QTest::newRow("C-empty-word") << QString(C) << QString() << QString("non-empty") << -1 << -1 << false << true << -1; + QTest::newRow("C-empty-number") << QString(C) << QString() << QString("42") << -1 << -1 << true << true << -1; } void tst_QCollator::compare() From 2767367795dc92c14f828e093a1d97478214b2fb Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 3 Sep 2019 15:37:22 +0200 Subject: [PATCH 2/8] Coding style: put case bodies on separate lines from the case label While the single-line-case format is more readable when consistently applied through the whole switch, it works less well when several of the cases are too complex to fit on a single line. Change-Id: I6a84a3d3d1493dadddab103da0336a8ef860563c Reviewed-by: Volker Hilsheimer --- src/corelib/time/qdatetimeparser.cpp | 37 +++++++++++++++++++--------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/corelib/time/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp index 2f7cbb4017..24f3969851 100644 --- a/src/corelib/time/qdatetimeparser.cpp +++ b/src/corelib/time/qdatetimeparser.cpp @@ -219,7 +219,8 @@ int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const const SectionNode &sn = sectionNode(s); switch (sn.type) { #if QT_CONFIG(timezone) - case TimeZoneSection: return QTimeZone::MaxUtcOffsetSecs; + case TimeZoneSection: + return QTimeZone::MaxUtcOffsetSecs; #endif case Hour24Section: case Hour12Section: @@ -227,20 +228,25 @@ int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const // We want it to be 23 for the stepBy case. return 23; case MinuteSection: - case SecondSection: return 59; - case MSecSection: return 999; + case SecondSection: + return 59; + case MSecSection: + return 999; case YearSection2Digits: case YearSection: // sectionMaxSize will prevent people from typing in a larger number in // count == 2 sections; stepBy() will work on real years anyway. return 9999; - case MonthSection: return calendar.maximumMonthsInYear(); + case MonthSection: + return calendar.maximumMonthsInYear(); case DaySection: case DayOfWeekSectionShort: case DayOfWeekSectionLong: return cur.isValid() ? cur.date().daysInMonth(calendar) : calendar.maximumDaysInMonth(); - case AmPmSection: return 1; - default: break; + case AmPmSection: + return 1; + default: + break; } qWarning("QDateTimeParser::absoluteMax() Internal error (%ls)", qUtf16Printable(sn.name())); @@ -620,7 +626,8 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const switch (s) { case FirstSection: case NoSection: - case LastSection: return 0; + case LastSection: + return 0; case AmPmSection: { const int lowerMax = qMax(getAmPmText(AmText, LowerCase).size(), @@ -634,7 +641,9 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const case Hour12Section: case MinuteSection: case SecondSection: - case DaySection: return 2; + case DaySection: + return 2; + case DayOfWeekSectionShort: case DayOfWeekSectionLong: #if !QT_CONFIG(textdate) @@ -663,11 +672,15 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const return ret; } #endif - case MSecSection: return 3; - case YearSection: return 4; - case YearSection2Digits: return 2; + case MSecSection: + return 3; + case YearSection: + return 4; + case YearSection2Digits: + return 2; + case TimeZoneSection: // Arbitrarily many tokens (each up to 14 bytes) joined with / separators: - case TimeZoneSection: return std::numeric_limits::max(); + return std::numeric_limits::max(); case CalendarPopupSection: case Internal: From 6baed766545f1ba5c747a067bb8e324f2bb9681a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 4 Feb 2020 13:22:27 +0100 Subject: [PATCH 3/8] uic/Python: Set form object name correctly Add missing "not" for the isEmpty() check. Fixes: PYSIDE-1210 Change-Id: I3798d483df9d077300ff69dc5d3a8d08812f534e Reviewed-by: Cristian Maureira-Fredes --- src/tools/uic/cpp/cppwriteinitialization.cpp | 2 +- tests/auto/tools/uic/baseline/config.ui.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index 1444c681c0..1212c410ff 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -1174,7 +1174,7 @@ void WriteInitialization::writeProperties(const QString &varName, m_output << m_indent << "if (" << varName << "->objectName().isEmpty())\n"; break; case Language::Python: - m_output << m_indent << "if " << varName << ".objectName():\n"; + m_output << m_indent << "if not " << varName << ".objectName():\n"; break; } } diff --git a/tests/auto/tools/uic/baseline/config.ui.py b/tests/auto/tools/uic/baseline/config.ui.py index 5fd558bb01..531b3ce4f0 100644 --- a/tests/auto/tools/uic/baseline/config.ui.py +++ b/tests/auto/tools/uic/baseline/config.ui.py @@ -48,7 +48,7 @@ from gammaview import GammaView class Ui_Config(object): def setupUi(self, Config): - if Config.objectName(): + if not Config.objectName(): Config.setObjectName(u"Config") Config.resize(600, 650) Config.setSizeGripEnabled(True) From e5408b62bdcee1abbc595eb581abcb540396ca4c Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 5 Feb 2020 08:35:21 +0100 Subject: [PATCH 4/8] Fix symbol resolving for OPENSSL_NO_NEXPROTONEG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Our ALPN-related definitions were conditioned both on OPENSSL_NO_NEXTPROTONEG and OpenSSL version (since ALPN first was introduced in 1.0.2), but resolving was only under version check, not OPENSSL_NO_NEXTPROTONEG. This went unnoticed for many years, and was found only recently with OpenSSL built with no-nexprotoneg. Fixes: QTBUG-81762 Change-Id: I7afca0b2034a234a19b5bcdefd3ce26f4202cddb Reviewed-by: Mårten Nordheim --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 1fcfdf9f16..26336edd3d 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -1375,12 +1375,12 @@ bool q_resolveOpenSslSymbols() RESOLVEFUNC(SSL_select_next_proto) RESOLVEFUNC(SSL_CTX_set_next_proto_select_cb) RESOLVEFUNC(SSL_get0_next_proto_negotiated) -#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ... #if OPENSSL_VERSION_NUMBER >= 0x10002000L - RESOLVEFUNC(SSL_set_alpn_protos) - RESOLVEFUNC(SSL_CTX_set_alpn_select_cb) - RESOLVEFUNC(SSL_get0_alpn_selected) + RESOLVEFUNC(SSL_set_alpn_protos) + RESOLVEFUNC(SSL_CTX_set_alpn_select_cb) + RESOLVEFUNC(SSL_get0_alpn_selected) #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ... +#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ... #if QT_CONFIG(dtls) RESOLVEFUNC(SSL_CTX_set_cookie_generate_cb) RESOLVEFUNC(SSL_CTX_set_cookie_verify_cb) From 9ecc595d7185ad3d072f3d811d7aa52fc6992cca Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Tue, 4 Feb 2020 13:18:31 +0100 Subject: [PATCH 5/8] widgets: Don't create winId when the widget is being destroyed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When QWidget is being destroyed, its winId is cleared, and a QEvent::WinIdChange is sent. If a listener of this event reacted by calling winId() again, we might crash. A crash can be observed when this child widget is destroyed in dtor of its parent. E.g. here is a hierarchy of widgets: 1:QWidget 2:QObject 3:QWidget 4:QWidget If a listener subscribed for WinIdChange events from (4), and there is a connection to destroy (4) when (2) is destroyed. This will lead to infinite loop: 1. QWidget::~QWidget 2. QWidget::destroy 3. QWidgetPrivate::setWinId(0) 4. QCoreApplication::sendEvent(q, QEvent::WinIdChange); 5. eventFilter 6. QWidget::winId 7. QWidgetPrivate::createWinId (this=0x555555957600) at kernel/qwidget.cpp:2380 8. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 9. QWidget::create (this=0x5555558f2010, window=0, initializeWindow=true, destroyOldWindow=true) at kernel/qwidget.cpp:1163 10. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 11. QWidget::create (this=0x5555558f2010, window=0, initializeWindow=true, destroyOldWindow=true) at kernel/qwidget.cpp:1163 12. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 Fixes: QTBUG-81849 Change-Id: Ib4c33ac97d9a79c701431ae107bddfb22720ba0d Reviewed-by: Volker Hilsheimer Reviewed-by: Tor Arne Vestbø --- src/widgets/kernel/qwidget.cpp | 4 +- .../widgets/kernel/qwidget/tst_qwidget.cpp | 51 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 8ec7f7e072..e7f95ecf4d 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -2350,7 +2350,9 @@ QWidget *QWidget::find(WId id) */ WId QWidget::winId() const { - if (!testAttribute(Qt::WA_WState_Created) || !internalWinId()) { + if (!data->in_destructor + && (!testAttribute(Qt::WA_WState_Created) || !internalWinId())) + { #ifdef ALIEN_DEBUG qDebug() << "QWidget::winId: creating native window for" << this; #endif diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index b5d174f340..2dd9e13b80 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -409,6 +409,8 @@ private slots: void closeEvent(); void closeWithChildWindow(); + void winIdAfterClose(); + private: bool ensureScreenSize(int width, int height); @@ -11261,5 +11263,54 @@ void tst_QWidget::closeWithChildWindow() QVERIFY(!childWidget->isVisible()); } +class WinIdChangeSpy : public QObject +{ + Q_OBJECT +public: + QWidget *widget = nullptr; + WId winId = 0; + explicit WinIdChangeSpy(QWidget *w, QObject *parent = nullptr) + : QObject(parent) + , widget(w) + , winId(widget->winId()) + { + } + +public slots: + bool eventFilter(QObject *obj, QEvent *event) override + { + if (obj == widget) { + if (event->type() == QEvent::WinIdChange) { + winId = widget->winId(); + return true; + } + } + return false; + } +}; + +void tst_QWidget::winIdAfterClose() +{ + auto widget = new QWidget; + auto notifier = new QObject(widget); + auto deleteWidget = new QWidget(new QWidget(widget)); + auto spy = new WinIdChangeSpy(deleteWidget); + deleteWidget->installEventFilter(spy); + connect(notifier, &QObject::destroyed, [&] { delete deleteWidget; }); + + widget->setAttribute(Qt::WA_NativeWindow); + widget->windowHandle()->create(); + widget->show(); + + QVERIFY(QTest::qWaitForWindowExposed(widget)); + QVERIFY(spy->winId); + + widget->windowHandle()->close(); + delete widget; + + QCOMPARE(spy->winId, WId(0)); + delete spy; +} + QTEST_MAIN(tst_QWidget) #include "tst_qwidget.moc" From 0947cf66e5b310ddc2318b3d9c9f415e49dd82aa Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 20 Jan 2020 16:47:16 +0200 Subject: [PATCH 6/8] Fix AndroidAbstractFileEngine "" it's the root folder of the assets, setting m_fileName = "" will make AndroidAbstractFileEngine::setFileName to fail and it will not set the proper flags. Fixes: QTBUG-81535 Change-Id: I0653f83b55ee790c8edf188889ccb30ef54584c0 Reviewed-by: Andy Shaw --- .../platforms/android/qandroidassetsfileenginehandler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp index 625473964d..ca16efe34f 100644 --- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp +++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp @@ -110,6 +110,8 @@ public: static AssetItem::Type fileType(const QString &filePath) { + if (filePath.isEmpty()) + return AssetItem::Type::Folder; const QStringList paths = filePath.split(QLatin1Char('/')); QString fullPath; AssetItem::Type res = AssetItem::Type::Invalid; @@ -399,7 +401,8 @@ public: private: AAsset *m_assetFile = nullptr; AAssetManager *m_assetManager = nullptr; - QString m_fileName; + // initialize with a name that can't be used as a file name + QString m_fileName = QLatin1String("."); bool m_isFolder = false; }; From 6839d297b3964047a207375a4955f6cedcb1c959 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Fri, 31 Jan 2020 17:04:54 +0200 Subject: [PATCH 7/8] Android: Fix native open fileDialog crash on Android Unregister the ActivityResultListener() after the result is handled. Fixes: QTBUG-78912 Change-Id: Ia2b45eca002e854492c409c70a3876fa8ce98de1 Reviewed-by: Andy Shaw --- .../platforms/android/qandroidplatformfiledialoghelper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp b/src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp index 4fb271a75c..7585b7eb95 100644 --- a/src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp +++ b/src/plugins/platforms/android/qandroidplatformfiledialoghelper.cpp @@ -104,6 +104,7 @@ void QAndroidPlatformFileDialogHelper::exec() void QAndroidPlatformFileDialogHelper::hide() { + QtAndroidPrivate::unregisterActivityResultListener(this); } QString QAndroidPlatformFileDialogHelper::selectedNameFilter() const From d29aaf598ab565600af2619d91e05459f7bad0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 22 Jan 2020 12:52:36 +0100 Subject: [PATCH 8/8] tst_qnetworkreply: Print proxy warning to stderr instead of stdout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way we produce valid xml also for the no-proxy case. Change-Id: I5a277255d22c3814fe463c0cd013c04ddc6ad919 Reviewed-by: André Hartmann --- .../auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 418e1caf68..963955e038 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -1312,9 +1312,9 @@ tst_QNetworkReply::tst_QNetworkReply() "+socksauth", true); } else { #endif // !QT_NO_NETWORKPROXY - printf("==================================================================\n"); - printf("Proxy could not be looked up. No proxy will be used while testing!\n"); - printf("==================================================================\n"); + fprintf(stderr, "==================================================================\n"); + fprintf(stderr, "Proxy could not be looked up. No proxy will be used while testing!\n"); + fprintf(stderr, "==================================================================\n"); #ifndef QT_NO_NETWORKPROXY } #endif // !QT_NO_NETWORKPROXY