diff options
-rw-r--r-- | doc/src/images/fetchmore-example.png | bin | 13407 -> 19169 bytes | |||
-rw-r--r-- | examples/widgets/doc/images/echoplugin.png | bin | 0 -> 7758 bytes | |||
-rw-r--r-- | examples/widgets/doc/src/fetchmore.qdoc | 8 | ||||
-rw-r--r-- | src/android/java/res/values-de/strings.xml | 1 | ||||
-rw-r--r-- | src/android/java/res/values-fr/strings.xml | 1 | ||||
-rw-r--r-- | src/corelib/itemmodels/qsortfilterproxymodel.cpp | 5 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface_linux.cpp | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslkey_openssl.cpp | 41 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols.cpp | 8 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols_p.h | 4 | ||||
-rw-r--r-- | tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp | 18 |
11 files changed, 63 insertions, 25 deletions
diff --git a/doc/src/images/fetchmore-example.png b/doc/src/images/fetchmore-example.png Binary files differindex d2359dc8c5..e8c689ad5e 100644 --- a/doc/src/images/fetchmore-example.png +++ b/doc/src/images/fetchmore-example.png diff --git a/examples/widgets/doc/images/echoplugin.png b/examples/widgets/doc/images/echoplugin.png Binary files differnew file mode 100644 index 0000000000..6c4fd2f6d8 --- /dev/null +++ b/examples/widgets/doc/images/echoplugin.png diff --git a/examples/widgets/doc/src/fetchmore.qdoc b/examples/widgets/doc/src/fetchmore.qdoc index 2355a466fe..df0cf3b8ec 100644 --- a/examples/widgets/doc/src/fetchmore.qdoc +++ b/examples/widgets/doc/src/fetchmore.qdoc @@ -34,9 +34,11 @@ \image fetchmore-example.png - The user of the example can enter a directory in the \uicontrol - Directory line edit. The contents of the directory will - be listed in the list view below. + + This example consists of a dialog where you can enter a directory + name in the \uicontrol Directory edit field. The application loads and + visualizes all files it finds as you are typing. It is not required + to press [Enter] to launch the search. When you have large - or perhaps even infinite - data sets, you will need to add items to the model in batches, and preferably only diff --git a/src/android/java/res/values-de/strings.xml b/src/android/java/res/values-de/strings.xml index 320d9ec33f..21881ec97f 100644 --- a/src/android/java/res/values-de/strings.xml +++ b/src/android/java/res/values-de/strings.xml @@ -3,4 +3,5 @@ <string name="ministro_not_found_msg">Ministro-Dienst wurde nicht gefunden.\nAnwendung kann nicht gestartet werden</string> <string name="ministro_needed_msg">Diese Anwendung benötigt den Ministro-Dienst. Möchten Sie ihn installieren?</string> <string name="fatal_error_msg">In Ihrer Anwendung ist ein schwerwiegender Fehler aufgetreten, sie kann nicht fortgesetzt werden</string> + <string name="unsupported_android_version">Diese Android-Version wird nicht unterstützt.</string> </resources> diff --git a/src/android/java/res/values-fr/strings.xml b/src/android/java/res/values-fr/strings.xml index efc0fb6e1e..ce8e5f5af1 100644 --- a/src/android/java/res/values-fr/strings.xml +++ b/src/android/java/res/values-fr/strings.xml @@ -3,4 +3,5 @@ <string name="ministro_not_found_msg">Le service Ministro est introuvable.\nL\'application ne peut pas démarrer.</string> <string name="ministro_needed_msg">Cette application requiert le service Ministro. Voulez-vous l\'installer?</string> <string name="fatal_error_msg">Votre application a rencontré une erreur fatale et ne peut pas continuer.</string> + <string name="unsupported_android_version">Cette version d\'Android n\'est pas supportée.</string> </resources> diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 0025c60c3b..8312318e4c 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -1923,7 +1923,10 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel) disconnect(d->model, SIGNAL(modelAboutToBeReset()), this, SLOT(_q_sourceAboutToBeReset())); disconnect(d->model, SIGNAL(modelReset()), this, SLOT(_q_sourceReset())); - d->_q_sourceModelDestroyed(); + // same as in _q_sourceReset() + d->invalidatePersistentIndexes(); + d->_q_clearMapping(); + QAbstractProxyModel::setSourceModel(sourceModel); connect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)), diff --git a/src/network/kernel/qnetworkinterface_linux.cpp b/src/network/kernel/qnetworkinterface_linux.cpp index b3b5e242b4..25aba5836e 100644 --- a/src/network/kernel/qnetworkinterface_linux.cpp +++ b/src/network/kernel/qnetworkinterface_linux.cpp @@ -201,7 +201,7 @@ template <typename Lambda> struct ProcessNetlinkRequest } #ifndef QT_NO_DEBUG - if (NLMSG_OK(hdr, len)) + if (NLMSG_OK(hdr, quint32(len))) qWarning("QNetworkInterface/AF_NETLINK: received unknown packet type (%d) or too short (%u)", hdr->nlmsg_type, hdr->nlmsg_len); else diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp index 7c77f5a910..6e5a4c76e9 100644 --- a/src/network/ssl/qsslkey_openssl.cpp +++ b/src/network/ssl/qsslkey_openssl.cpp @@ -193,6 +193,16 @@ QByteArray QSslKeyPrivate::toPem(const QByteArray &passPhrase) const if (!QSslSocket::supportsSsl() || isNull || algorithm == QSsl::Opaque) return QByteArray(); + // ### the cipher should be selectable in the API: + const EVP_CIPHER *cipher = nullptr; + if (type == QSsl::PrivateKey && !passPhrase.isEmpty()) { +#ifndef OPENSSL_NO_DES + cipher = q_EVP_des_ede3_cbc(); +#else + return QByteArray(); +#endif + } + BIO *bio = q_BIO_new(q_BIO_s_mem()); if (!bio) return QByteArray(); @@ -205,9 +215,7 @@ QByteArray QSslKeyPrivate::toPem(const QByteArray &passPhrase) const fail = true; } else { if (!q_PEM_write_bio_RSAPrivateKey( - bio, rsa, - // ### the cipher should be selectable in the API: - passPhrase.isEmpty() ? (const EVP_CIPHER *)0 : q_EVP_des_ede3_cbc(), + bio, rsa, cipher, const_cast<uchar *>((const uchar *)passPhrase.data()), passPhrase.size(), 0, 0)) { fail = true; } @@ -218,9 +226,7 @@ QByteArray QSslKeyPrivate::toPem(const QByteArray &passPhrase) const fail = true; } else { if (!q_PEM_write_bio_DSAPrivateKey( - bio, dsa, - // ### the cipher should be selectable in the API: - passPhrase.isEmpty() ? (const EVP_CIPHER *)0 : q_EVP_des_ede3_cbc(), + bio, dsa, cipher, const_cast<uchar *>((const uchar *)passPhrase.data()), passPhrase.size(), 0, 0)) { fail = true; } @@ -232,9 +238,7 @@ QByteArray QSslKeyPrivate::toPem(const QByteArray &passPhrase) const fail = true; } else { if (!q_PEM_write_bio_ECPrivateKey( - bio, ec, - // ### the cipher should be selectable in the API: - passPhrase.isEmpty() ? (const EVP_CIPHER *)0 : q_EVP_des_ede3_cbc(), + bio, ec, cipher, const_cast<uchar *>((const uchar *)passPhrase.data()), passPhrase.size(), 0, 0)) { fail = true; } @@ -274,34 +278,39 @@ Qt::HANDLE QSslKeyPrivate::handle() const static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv, int enc) { -#if QT_CONFIG(opensslv11) - EVP_CIPHER_CTX *ctx = q_EVP_CIPHER_CTX_new(); -#else - EVP_CIPHER_CTX evpCipherContext; - EVP_CIPHER_CTX *ctx = &evpCipherContext; -#endif - const EVP_CIPHER* type = 0; int i = 0, len = 0; switch (cipher) { case QSslKeyPrivate::DesCbc: +#ifndef OPENSSL_NO_DES type = q_EVP_des_cbc(); +#endif break; case QSslKeyPrivate::DesEde3Cbc: +#ifndef OPENSSL_NO_DES type = q_EVP_des_ede3_cbc(); +#endif break; case QSslKeyPrivate::Rc2Cbc: +#ifndef OPENSSL_NO_RC2 type = q_EVP_rc2_cbc(); +#endif break; } + if (type == nullptr) + return QByteArray(); + QByteArray output; output.resize(data.size() + EVP_MAX_BLOCK_LENGTH); #if QT_CONFIG(opensslv11) + EVP_CIPHER_CTX *ctx = q_EVP_CIPHER_CTX_new(); q_EVP_CIPHER_CTX_reset(ctx); #else + EVP_CIPHER_CTX evpCipherContext; + EVP_CIPHER_CTX *ctx = &evpCipherContext; q_EVP_CIPHER_CTX_init(ctx); #endif diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 0c24b5caac..a978dfc5f4 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -344,9 +344,13 @@ DEFINEFUNC5(int, EVP_CipherInit, EVP_CIPHER_CTX *ctx, ctx, const EVP_CIPHER *typ DEFINEFUNC6(int, EVP_CipherInit_ex, EVP_CIPHER_CTX *ctx, ctx, const EVP_CIPHER *cipher, cipher, ENGINE *impl, impl, const unsigned char *key, key, const unsigned char *iv, iv, int enc, enc, return 0, return) DEFINEFUNC5(int, EVP_CipherUpdate, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, const unsigned char *in, in, int inl, inl, return 0, return) DEFINEFUNC3(int, EVP_CipherFinal, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, return 0, return) +#ifndef OPENSSL_NO_DES DEFINEFUNC(const EVP_CIPHER *, EVP_des_cbc, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC(const EVP_CIPHER *, EVP_des_ede3_cbc, DUMMYARG, DUMMYARG, return 0, return) +#endif +#ifndef OPENSSL_NO_RC2 DEFINEFUNC(const EVP_CIPHER *, EVP_rc2_cbc, DUMMYARG, DUMMYARG, return 0, return) +#endif DEFINEFUNC(const EVP_MD *, EVP_sha1, DUMMYARG, DUMMYARG, return 0, return) DEFINEFUNC3(int, EVP_PKEY_assign, EVP_PKEY *a, a, int b, b, char *c, c, return -1, return) DEFINEFUNC2(int, EVP_PKEY_set1_RSA, EVP_PKEY *a, a, RSA *b, b, return -1, return) @@ -1108,9 +1112,13 @@ bool q_resolveOpenSslSymbols() RESOLVEFUNC(EVP_CipherInit_ex) RESOLVEFUNC(EVP_CipherUpdate) RESOLVEFUNC(EVP_CipherFinal) +#ifndef OPENSSL_NO_DES RESOLVEFUNC(EVP_des_cbc) RESOLVEFUNC(EVP_des_ede3_cbc) +#endif +#ifndef OPENSSL_NO_RC2 RESOLVEFUNC(EVP_rc2_cbc) +#endif RESOLVEFUNC(EVP_sha1) RESOLVEFUNC(EVP_PKEY_assign) RESOLVEFUNC(EVP_PKEY_set1_RSA) diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index 65823e3f3e..386ca746cf 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -267,9 +267,13 @@ int q_EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, const unsigned int q_EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, const unsigned char *key, const unsigned char *iv, int enc); int q_EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl); int q_EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); +#ifndef OPENSSL_NO_DES const EVP_CIPHER *q_EVP_des_cbc(); const EVP_CIPHER *q_EVP_des_ede3_cbc(); +#endif +#ifndef OPENSSL_NO_RC2 const EVP_CIPHER *q_EVP_rc2_cbc(); +#endif const EVP_MD *q_EVP_sha1(); int q_EVP_PKEY_assign(EVP_PKEY *a, int b, char *c); Q_AUTOTEST_EXPORT int q_EVP_PKEY_set1_RSA(EVP_PKEY *a, RSA *b); diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 8af6347f89..9bc558580b 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -4650,15 +4650,25 @@ void tst_QSortFilterProxyModel::checkSetNewModel() QTreeView tv; StepTreeModel model1; model1.setDepth(4); - StepTreeModel model2; - model2.setDepth(4); QSortFilterProxyModel proxy; proxy.setSourceModel(&model1); tv.setModel(&proxy); tv.show(); - tv.expandAll(); // create persistent indexes - proxy.setSourceModel(&model2); + QVERIFY(QTest::qWaitForWindowExposed(&tv)); + tv.expandAll(); + { + StepTreeModel model2; + model2.setDepth(4); + proxy.setSourceModel(&model2); + tv.expandAll(); + proxy.setSourceModel(&model1); + tv.expandAll(); + // the destruction of model2 here caused a proxy model reset due to + // missing disconnect in setSourceModel() + } + // handle repaint events, will assert when qsortfilterproxymodel is in wrong state + QCoreApplication::processEvents(); } QTEST_MAIN(tst_QSortFilterProxyModel) |