From 38dd2ed2b03656283a3c6170eda6d445ff1241f4 Mon Sep 17 00:00:00 2001 From: Markus Goetz <Markus.Goetz@nokia.com> Date: Tue, 10 Nov 2009 09:48:47 +0100 Subject: QNAM HTTP Code: Start authorization header with capital letter HTTP header names are case insensitive, but stick to what all browsers etc. use to work around buggy servers. Task-number: QTBUG-5618 Reviewed-by: Peter Hartmann --- src/network/access/qhttpnetworkconnection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 1124337..8dd7a00 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -372,7 +372,7 @@ void QHttpNetworkConnectionPrivate::createAuthorization(QAbstractSocket *socket, QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].authenticator); if (priv && priv->method != QAuthenticatorPrivate::None) { QByteArray response = priv->calculateResponse(request.d->methodName(), request.d->uri(false)); - request.setHeaderField("authorization", response); + request.setHeaderField("Authorization", response); } } } @@ -381,7 +381,7 @@ void QHttpNetworkConnectionPrivate::createAuthorization(QAbstractSocket *socket, QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].proxyAuthenticator); if (priv && priv->method != QAuthenticatorPrivate::None) { QByteArray response = priv->calculateResponse(request.d->methodName(), request.d->uri(false)); - request.setHeaderField("proxy-authorization", response); + request.setHeaderField("Proxy-Authorization", response); } } } -- cgit v0.12 From 45c197899b7444230c7eefbb6f208eb237b07ed2 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete <paul.tvete@nokia.com> Date: Tue, 10 Nov 2009 10:04:06 +0100 Subject: My changes for 4.6.0 --- dist/changes-4.6.0 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index 4635813..895421d 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -512,6 +512,16 @@ Qt for Embedded Linux - Remove obsolete OpenGL/ES screen drivers: hybrid, ahigl. +- Send enter/leave events also to child widgets + +- Fix crash when instantiating multiple QApplications + +- Optimize software cursor by using native image format instead of 8-bit + +- [255828] Avoid window decoration flicker on show + +- [255495] Fix blend function crash on AVR32 + Qt for Windows CE ----------------- - On Windows CE the link time code generation has been disabled by default to -- cgit v0.12 From d5db58127b16f3c2508975661ee7328f569b9518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= <joao@abecasis.name> Date: Fri, 6 Nov 2009 16:09:39 +0100 Subject: Make QScopedPointer::operator== and != non-member Non-member operator allows implicit conversions on both arguments. A single operator is enough to support QScopedArrayPointer, QCustomScopedPointer and QScopedSharedPointer since equality semantics don't change and the deleter is managed in the base class. Reviewed-by: Marius Storm-Olsen --- src/corelib/tools/qscopedpointer.h | 52 +++++++++----------------------------- 1 file changed, 12 insertions(+), 40 deletions(-) diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index 7cbdb6c..b433723 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -113,16 +113,6 @@ public: return d; } - inline bool operator==(const QScopedPointer<T, Cleanup> &other) const - { - return d == other.d; - } - - inline bool operator!=(const QScopedPointer<T, Cleanup> &other) const - { - return d != other.d; - } - inline bool operator!() const { return !d; @@ -181,6 +171,18 @@ private: }; template <class T, class Cleanup> +inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) +{ + return lhs.data() == rhs.data(); +} + +template <class T, class Cleanup> +inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) +{ + return lhs.data() != rhs.data(); +} + +template <class T, class Cleanup> Q_INLINE_TEMPLATE void qSwap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) { p1.swap(p2); } @@ -203,16 +205,6 @@ public: return this->d[i]; } - inline bool operator==(const QScopedArrayPointer<T, Cleanup> &other) const - { - return this->d == other.d; - } - - inline bool operator!=(const QScopedArrayPointer<T, Cleanup> &other) const - { - return this->d != other.d; - } - private: Q_DISABLE_COPY(QScopedArrayPointer) }; @@ -233,16 +225,6 @@ public: return this->d; } - inline bool operator==(const QCustomScopedPointer<T, Cleanup> &other) const - { - return this->d == other.d; - } - - inline bool operator!=(const QCustomScopedPointer<T, Cleanup> &other) const - { - return this->d != other.d; - } - private: Q_DISABLE_COPY(QCustomScopedPointer) }; @@ -287,16 +269,6 @@ public: QScopedPointerSharedDeleter<T>::cleanup(oldD); } - inline bool operator==(const QScopedSharedPointer<T> &other) const - { - return this->d == other.d; - } - - inline bool operator!=(const QScopedSharedPointer<T> &other) const - { - return this->d != other.d; - } - private: Q_DISABLE_COPY(QScopedSharedPointer) }; -- cgit v0.12 From 7bfdec392df263b15fb5661ab7d4f66f1cd8fbae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= <joao@abecasis.name> Date: Fri, 6 Nov 2009 17:35:10 +0100 Subject: Extending QScopedPointer test case ... to also test QScopedArrayPointer, QCustomScopedPointer and QScopedSharedPointer. Added one level of indirection to comparison test case to avoid double-delete in case of test failure. The test also tests other aspects of Q*Scoped*Pointer behavior. Reviewed-by: Olivier Goffart --- tests/auto/qscopedpointer/tst_qscopedpointer.cpp | 156 ++++++++++++++++++++--- 1 file changed, 139 insertions(+), 17 deletions(-) diff --git a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp index aeead15..f319891 100644 --- a/tests/auto/qscopedpointer/tst_qscopedpointer.cpp +++ b/tests/auto/qscopedpointer/tst_qscopedpointer.cpp @@ -313,30 +313,152 @@ void tst_QScopedPointer::objectSize() QCOMPARE(sizeof(QScopedPointer<int>), sizeof(void *)); } -void tst_QScopedPointer::comparison() +struct RefCounted { - int *a = new int(42); - int *b = new int(43); + RefCounted() + : ref(0) + { + instanceCount.ref(); + } + + RefCounted(RefCounted const &other) + : ref(0) + { + instanceCount.ref(); + } + + ~RefCounted() + { + QVERIFY( ref == 0 ); + instanceCount.deref(); + } + + RefCounted &operator=(RefCounted const &) + { + } + + QAtomicInt ref; + + static QAtomicInt instanceCount; +}; - QScopedPointer<int> pa(a); - QScopedPointer<int> pa2(a); - QScopedPointer<int> pb(b); +QAtomicInt RefCounted::instanceCount = 0; +template <class A1, class A2, class B> +void scopedPointerComparisonTest(const A1 &a1, const A2 &a2, const B &b) +{ // test equality on equal pointers - QVERIFY(pa == pa2); - QVERIFY(pa2 == pa); + QVERIFY(a1 == a2); + QVERIFY(a2 == a1); + + // test inequality on equal pointers + QVERIFY(!(a1 != a2)); + QVERIFY(!(a2 != a1)); + + // test equality on unequal pointers + QVERIFY(!(a1 == b)); + QVERIFY(!(a2 == b)); + QVERIFY(!(b == a1)); + QVERIFY(!(b == a2)); + + // test inequality on unequal pointers + QVERIFY(b != a1); + QVERIFY(b != a2); + QVERIFY(a1 != b); + QVERIFY(a2 != b); +} + +void tst_QScopedPointer::comparison() +{ + QCOMPARE( int(RefCounted::instanceCount), 0 ); + + { + RefCounted *a = new RefCounted; + RefCounted *b = new RefCounted; + + QCOMPARE( int(RefCounted::instanceCount), 2 ); + + QScopedPointer<RefCounted> pa1(a); + QScopedPointer<RefCounted> pa2(a); + QScopedPointer<RefCounted> pb(b); + + scopedPointerComparisonTest(pa1, pa1, pb); + scopedPointerComparisonTest(pa2, pa2, pb); + scopedPointerComparisonTest(pa1, pa2, pb); + + pa2.take(); + + QCOMPARE( int(RefCounted::instanceCount), 2 ); + } - // test unequality on equal pointers - QVERIFY(!(pa != pa2)); - QVERIFY(!(pa2 != pa)); + QCOMPARE( int(RefCounted::instanceCount), 0 ); - // test on unequal pointers - QVERIFY(!(pa == pb)); - QVERIFY(!(pb == pa)); - QVERIFY(pb != pa); - QVERIFY(pa != pb); + { + RefCounted *a = new RefCounted[42]; + RefCounted *b = new RefCounted[43]; + + QCOMPARE( int(RefCounted::instanceCount), 85 ); + + QScopedArrayPointer<RefCounted> pa1(a); + QScopedArrayPointer<RefCounted> pa2(a); + QScopedArrayPointer<RefCounted> pb(b); + + scopedPointerComparisonTest(pa1, pa2, pb); + + pa2.take(); + + QCOMPARE( int(RefCounted::instanceCount), 85 ); + } + + QCOMPARE( int(RefCounted::instanceCount), 0 ); + + { + // QCustomScopedPointer is an internal helper class -- it is unsupported! + + RefCounted *a = new RefCounted; + RefCounted *b = new RefCounted; + + QCOMPARE( int(RefCounted::instanceCount), 2 ); + + QCustomScopedPointer<RefCounted> pa1(a); + QCustomScopedPointer<RefCounted> pa2(a); + QCustomScopedPointer<RefCounted> pb(b); + + scopedPointerComparisonTest(pa1, pa2, pb); + + pa2.take(); + + QCOMPARE( int(RefCounted::instanceCount), 2 ); + } + + QCOMPARE( int(RefCounted::instanceCount), 0 ); + + { + // QScopedSharedPointer is an internal helper class -- it is unsupported! + + RefCounted *a = new RefCounted; + RefCounted *b = new RefCounted; + + QCOMPARE( int(RefCounted::instanceCount), 2 ); + + a->ref.ref(); + QScopedSharedPointer<RefCounted> pa1(a); + a->ref.ref(); + QScopedSharedPointer<RefCounted> pa2(a); + b->ref.ref(); + QScopedSharedPointer<RefCounted> pb(b); + + + QCOMPARE( int(a->ref), 2 ); + QCOMPARE( int(b->ref), 1 ); + QCOMPARE( int(RefCounted::instanceCount), 2 ); + + scopedPointerComparisonTest(pa1, pa2, pb); + + QCOMPARE( int(RefCounted::instanceCount), 2 ); + } - pa2.take(); + QCOMPARE( int(RefCounted::instanceCount), 0 ); } QTEST_MAIN(tst_QScopedPointer) -- cgit v0.12