diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-03 20:58:24 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-03 20:58:24 (GMT) |
commit | ab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e (patch) | |
tree | eaf8d4c7f886f463b22c17d27352829728d95fc8 | |
parent | 671eb89e41c90cc4cb11eca1c76181d1186db2b2 (diff) | |
parent | b37fa034257673a43783a54bb66328c82a0c7ef1 (diff) | |
download | Qt-ab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e.zip Qt-ab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e.tar.gz Qt-ab672d88f906b0d6f2d45f9ebbfbf12fdcfba51e.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
The lastCenterPoint should be equal to centerPoint for new gestures.
PinchGesture: lastRotationAngle should start at 0.
tst_qnetworkreply: Add testcase for unknown authentication method
QNAM: Reset authenticator state properly between requests
msvc: enable unreferenced code elimination in release with debuginfo builds
exclude headers in builddir from -copy option
more elegant treatment of qconfig.h special case
simplify recursive symlinking
-rwxr-xr-x | bin/syncqt | 14 | ||||
-rwxr-xr-x | configure | 10 | ||||
-rw-r--r-- | mkspecs/win32-msvc2003/qmake.conf | 2 | ||||
-rw-r--r-- | mkspecs/win32-msvc2005/qmake.conf | 2 | ||||
-rw-r--r-- | mkspecs/win32-msvc2008/qmake.conf | 2 | ||||
-rw-r--r-- | mkspecs/win32-msvc2010/qmake.conf | 2 | ||||
-rw-r--r-- | src/gui/kernel/qstandardgestures.cpp | 10 | ||||
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 7 | ||||
-rw-r--r-- | src/network/kernel/qauthenticator.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 32 |
10 files changed, 66 insertions, 25 deletions
@@ -695,10 +695,7 @@ my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dis my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" ); my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" ); my %colliding_headers = (); -my %inject_headers; -# Force generation of forwarding header for qconfig.h if (and only if) we can't -# find the header by normal means. -%inject_headers = ( "$basedir/src/corelib/global" => ( "*qconfig.h" ) ) unless (-e "$basedir/src/corelib/global/qconfig.h"); +my %inject_headers = ( "$basedir/src/corelib/global" => ( "qconfig.h" ) ); # all from build dir foreach my $lib (@modules_to_sync) { #iteration info @@ -800,7 +797,12 @@ foreach my $lib (@modules_to_sync) { #calc files and "copy" them foreach my $subdir (@subdirs) { my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0); - push @headers, $inject_headers{$subdir} if (defined $inject_headers{$subdir}); + if (defined $inject_headers{$subdir}) { + foreach my $if ($inject_headers{$subdir}) { + @headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously + push @headers, "*".$if; + } + } foreach my $header (@headers) { my $shadow = ($header =~ s/^\*//); $header = 0 if($header =~ /^ui_.*.h/); @@ -878,7 +880,7 @@ foreach my $lib (@modules_to_sync) { @headers = ( "$out_basedir/include/$lib/private/$header" ); } foreach(@headers) { #sync them - $header_copies++ if(syncHeader($_, $iheader, $copy_headers, $ts)); + $header_copies++ if(syncHeader($_, $iheader, $copy_headers && !$shadow, $ts)); } if($public_header) { @@ -2429,14 +2429,8 @@ if [ "$OPT_SHADOW" = "yes" ]; then ShadowMkspecs() { rm -rf "$outpath/mkspecs/$1" - if [ "$UNAME_SYSTEM" = "Linux" ]; then - # This works with GNU coreutils, and is needed for ScratchBox - cp -rs "$relpath/mkspecs/$1" "$outpath/mkspecs/$1" - else - # A simple "cp -rs" doesn't work on Mac. :( - find "$relpath/mkspecs/$1" -type d | sed "s,^$relpath,$outpath," | xargs mkdir -p - find "$relpath/mkspecs/$1" -type f | sed "s,^$relpath/,," | xargs -n 1 -I % ln -s "$relpath/%" "$outpath/%" - fi + find "$relpath/mkspecs/$1" -type d | sed "s,^$relpath,$outpath," | xargs mkdir -p + find "$relpath/mkspecs/$1" -type f | sed "s,^$relpath/,," | while read f; do ln -s "$relpath/$f" "$outpath/$f"; done } # Special case for mkspecs/features directory. diff --git a/mkspecs/win32-msvc2003/qmake.conf b/mkspecs/win32-msvc2003/qmake.conf index 63d1ffd..a573a4d 100644 --- a/mkspecs/win32-msvc2003/qmake.conf +++ b/mkspecs/win32-msvc2003/qmake.conf @@ -53,7 +53,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO -QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /INCREMENTAL:NO /DEBUG +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf index 265d028..aa58e30 100644 --- a/mkspecs/win32-msvc2005/qmake.conf +++ b/mkspecs/win32-msvc2005/qmake.conf @@ -55,7 +55,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO -QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /INCREMENTAL:NO /DEBUG +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf index 1432645..ee7b99a 100644 --- a/mkspecs/win32-msvc2008/qmake.conf +++ b/mkspecs/win32-msvc2008/qmake.conf @@ -57,7 +57,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO -QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /INCREMENTAL:NO /DEBUG +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf index 84086e2..44e460e 100644 --- a/mkspecs/win32-msvc2010/qmake.conf +++ b/mkspecs/win32-msvc2010/qmake.conf @@ -57,7 +57,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO -QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /INCREMENTAL:NO /DEBUG +QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp index 1821c3d..48b7ac1 100644 --- a/src/gui/kernel/qstandardgestures.cpp +++ b/src/gui/kernel/qstandardgestures.cpp @@ -194,13 +194,15 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state, d->hotSpot = p1.screenPos(); d->isHotSpotSet = true; + QPointF centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0; if (d->isNewSequence) { d->startPosition[0] = p1.screenPos(); d->startPosition[1] = p2.screenPos(); + d->lastCenterPoint = centerPoint; + } else { + d->lastCenterPoint = d->centerPoint; } - - d->lastCenterPoint = d->centerPoint; - d->centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0; + d->centerPoint = centerPoint; d->changeFlags |= QPinchGesture::CenterPointChanged; @@ -224,7 +226,7 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state, startAngle -= 360; const qreal rotationAngle = startAngle - angle; if (d->isNewSequence) - d->lastRotationAngle = rotationAngle; + d->lastRotationAngle = 0.0; else d->lastRotationAngle = d->rotationAngle; d->rotationAngle = rotationAngle; diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 89f9b03..4d27531 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -373,6 +373,13 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket // - If withCredentials has been set to false (e.g. by QtWebKit for a cross-origin XMLHttpRequest) then // we need to bail out if authentication is required. if (priv->phase == QAuthenticatorPrivate::Done || !reply->request().withCredentials()) { + // Reset authenticator so the next request on that channel does not get messed up + auth = 0; + if (isProxy) + channels[i].proxyAuthenticator = QAuthenticator(); + else + channels[i].authenticator = QAuthenticator(); + // authentication is cancelled, send the current contents to the user. emit channels[i].reply->headerChanged(); emit channels[i].reply->readyRead(); diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index 220f7da..73f6b94 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -164,9 +164,13 @@ QAuthenticator &QAuthenticator::operator=(const QAuthenticator &other) { if (d == other.d) return *this; - detach(); - d->user = other.d->user; - d->password = other.d->password; + + if (d && !d->ref.deref()) + delete d; + + d = other.d; + if (d) + d->ref.ref(); return *this; } diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 5196ed2..8850e6e 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -295,6 +295,8 @@ private Q_SLOTS: void getFromUnreachableIp(); + void qtbug4121unknownAuthentication(); + // NOTE: This test must be last! void parentingRepliesToTheApp(); }; @@ -4598,6 +4600,7 @@ void tst_QNetworkReply::qtbug12908compressedHttpReply() QCOMPARE(reply->error(), QNetworkReply::NoError); } +// TODO add similar test for FTP void tst_QNetworkReply::getFromUnreachableIp() { QNetworkAccessManager manager; @@ -4612,6 +4615,35 @@ void tst_QNetworkReply::getFromUnreachableIp() QVERIFY(reply->error() != QNetworkReply::NoError); } +void tst_QNetworkReply::qtbug4121unknownAuthentication() +{ + MiniHttpServer server(QByteArray("HTTP/1.1 401 bla\r\nWWW-Authenticate: crap\r\nContent-Length: 0\r\n\r\n")); + server.doClose = false; + + QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); + QNetworkAccessManager manager; + QNetworkReplyPtr reply = manager.get(request); + + qRegisterMetaType<QNetworkReply*>("QNetworkReply*"); + qRegisterMetaType<QAuthenticator*>("QAuthenticator*"); + QSignalSpy authSpy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*))); + QSignalSpy finishedSpy(&manager, SIGNAL(finished(QNetworkReply*))); + qRegisterMetaType<QNetworkReply::NetworkError>("QNetworkReply::NetworkError"); + QSignalSpy errorSpy(reply, SIGNAL(error(QNetworkReply::NetworkError))); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QCOMPARE(authSpy.count(), 0); + QCOMPARE(finishedSpy.count(), 1); + QCOMPARE(errorSpy.count(), 1); + + QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError); +} + + + // NOTE: This test must be last testcase in tst_qnetworkreply! void tst_QNetworkReply::parentingRepliesToTheApp() { |