From 34af6fd31e29334e9ffe5d390d5a8b40c5a4a9c6 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 7 Nov 2011 11:58:04 +0100 Subject: Ensure that the RC_FILE is correctly handled in a single configuration With MSVC 2010 if a single configuration vcxproj file was created then it would not have an entry for the .rc file only the .res file that would be compiled from it. Without the entry for the .rc file then it would not compile the .res file. Task-number: QTBUG-22545 Merge-request: 1452 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msbuild_objectmodel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index c70d966..130f273 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -2896,6 +2896,7 @@ XmlOutput &operator<<(XmlOutput &xml, const VCXProjectSingleConfig &tool) tempProj.outputFilter(xml, xmlFilter, tempProj.ExtraCompilers.at(x)); } + tempProj.outputFilter(xml, xmlFilter, "Root Files"); xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets"); xml << tag("ImportGroup") -- cgit v0.12 From 2c072ae53ea4f90a32cfb8260f1bd0251ebab4f9 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 4 Nov 2011 18:35:41 +0100 Subject: Compile when -no-rtti is specified as a configure option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After discussing with Marko who did the original backport of the ShaderEffect to Qt 4.7 it was agreed that this is the correct thing to do in this case. Merge-request: 2713 Task-number: QTBUG-22419 Reviewed-by: Marko Niemelä --- src/imports/shaders/shadereffect.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/imports/shaders/shadereffect.cpp b/src/imports/shaders/shadereffect.cpp index f40d6b8..a5164e2 100644 --- a/src/imports/shaders/shadereffect.cpp +++ b/src/imports/shaders/shadereffect.cpp @@ -61,6 +61,7 @@ ShaderEffect::~ShaderEffect() void ShaderEffect::prepareBufferedDraw(QPainter *painter) { +#ifndef QT_NO_DYNAMIC_CAST // This workaround needed because QGraphicsEffect seems to always utilize default painters worldtransform // instead of the active painters worldtransform. const ShaderEffectBuffer *effectBuffer = dynamic_cast (painter->device()); @@ -70,6 +71,9 @@ void ShaderEffect::prepareBufferedDraw(QPainter *painter) } else { savedWorldTransform = painter->worldTransform(); } +#else + Q_UNUSED(painter); +#endif } void ShaderEffect::draw (QPainter *painter) -- cgit v0.12 From 3342cd1a4003912dfb419dbe4d3babd1f9c30173 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 17 Oct 2011 15:57:31 +0100 Subject: Symbian - fix compile error when default configured New code assumed building with OpenGL/OpenVG, which is the production configuration, but not the default configuration Reviewed-By: Jani Hautakangas Task-Number: QTBUG-21996 --- src/gui/painting/qgraphicssystemex_symbian.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp index 32e040f..5a182ff 100644 --- a/src/gui/painting/qgraphicssystemex_symbian.cpp +++ b/src/gui/painting/qgraphicssystemex_symbian.cpp @@ -46,7 +46,7 @@ #include -#ifdef Q_SYMBIAN_SUPPORTS_SURFACES +#if defined(Q_SYMBIAN_SUPPORTS_SURFACES) && !defined (QT_NO_EGL) #include "private/qegl_p.h" #endif @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE static bool bcm2727Initialized = false; static bool bcm2727 = false; -#ifdef Q_SYMBIAN_SUPPORTS_SURFACES +#if defined(Q_SYMBIAN_SUPPORTS_SURFACES) && !defined (QT_NO_EGL) typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*); #define EGL_PROF_TOTAL_MEMORY_NOK 0x3070 #endif @@ -69,7 +69,7 @@ bool QSymbianGraphicsSystemEx::hasBCM2727() if (bcm2727Initialized) return bcm2727; -#ifdef Q_SYMBIAN_SUPPORTS_SURFACES +#if defined(Q_SYMBIAN_SUPPORTS_SURFACES) && !defined (QT_NO_EGL) EGLDisplay display = QEgl::display(); #if 1 // Hacky but fast ~0ms. -- cgit v0.12 From 865ad5053f053c9274973bb07e9f0ca04fd043d3 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 7 Nov 2011 15:42:42 +0000 Subject: symbian - handle path being passed as part of filename in QTranslator Although incorrect API usage, this was a regression from 4.7.3 behaviour Task-number: QTBUG-22489 Reviewed-by: mread --- src/corelib/kernel/qtranslator.cpp | 18 ++++++++++--- tests/auto/qtranslator/i18n/hellotr_en.qm | Bin 0 -> 230 bytes tests/auto/qtranslator/qtranslator.pro | 1 + tests/auto/qtranslator/tst_qtranslator.cpp | 40 +++++++++++++++++++++++++++-- 4 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 tests/auto/qtranslator/i18n/hellotr_en.qm diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 8c08760..ca30db1 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -405,13 +405,26 @@ bool QTranslator::load(const QString & filename, const QString & directory, Q_D(QTranslator); d->clear(); + QString fname = filename; QString prefix; if (QFileInfo(filename).isRelative()) { #ifdef Q_OS_SYMBIAN - if (directory.isEmpty()) + //TFindFile doesn't like path in the filename + QString dir(directory); + int slash = filename.lastIndexOf(QLatin1Char('/')); + slash = qMax(slash, filename.lastIndexOf(QLatin1Char('\\'))); + if (slash >=0) { + //so move the path component into the directory prefix + if (dir.isEmpty()) + dir = filename.left(slash + 1); + else + dir = dir + QLatin1Char('/') + filename.left(slash + 1); + fname = fname.mid(slash + 1); + } + if (dir.isEmpty()) prefix = QCoreApplication::applicationDirPath(); else - prefix = QFileInfo(directory).absoluteFilePath(); //TFindFile doesn't like dirty paths + prefix = QFileInfo(dir).absoluteFilePath(); //TFindFile doesn't like dirty paths if (prefix.length() > 2 && prefix.at(1) == QLatin1Char(':') && prefix.at(0).isLetter()) prefix[0] = QLatin1Char('Y'); #else @@ -425,7 +438,6 @@ bool QTranslator::load(const QString & filename, const QString & directory, QString nativePrefix = QDir::toNativeSeparators(prefix); #endif - QString fname = filename; QString realname; QString delims; delims = search_delimiters.isNull() ? QString::fromLatin1("_.") : search_delimiters; diff --git a/tests/auto/qtranslator/i18n/hellotr_en.qm b/tests/auto/qtranslator/i18n/hellotr_en.qm new file mode 100644 index 0000000..cc42afe Binary files /dev/null and b/tests/auto/qtranslator/i18n/hellotr_en.qm differ diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro index 5b742f7..8ab1fd3 100644 --- a/tests/auto/qtranslator/qtranslator.pro +++ b/tests/auto/qtranslator/qtranslator.pro @@ -4,6 +4,7 @@ RESOURCES += qtranslator.qrc wince*|symbian: { addFiles.sources = hellotr_la.qm msgfmt_from_po.qm + addFiles.sources += i18n addFiles.path = . DEPLOYMENT += addFiles } diff --git a/tests/auto/qtranslator/tst_qtranslator.cpp b/tests/auto/qtranslator/tst_qtranslator.cpp index 8e2ed15..6f65e6a 100644 --- a/tests/auto/qtranslator/tst_qtranslator.cpp +++ b/tests/auto/qtranslator/tst_qtranslator.cpp @@ -66,6 +66,10 @@ protected: private slots: void load(); void load2(); + void loadSubdir(); + void loadSubdir2(); + void loadSubdir3(); + void loadSubdir4(); void threadLoad(); void testLanguageChange(); void plural(); @@ -124,6 +128,38 @@ void tst_QTranslator::load2() QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); } +void tst_QTranslator::loadSubdir() +{ + QTranslator tor( 0 ); + tor.load("hellotr_en_GB", "i18n"); + QVERIFY(!tor.isEmpty()); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); +} + +void tst_QTranslator::loadSubdir2() +{ + QTranslator tor( 0 ); + tor.load("i18n/hellotr_en_GB"); + QVERIFY(!tor.isEmpty()); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); +} + +void tst_QTranslator::loadSubdir3() +{ + QTranslator tor( 0 ); + tor.load(QString(QLatin1String("i18n%1hellotr_en_GB")).arg(QDir::separator())); + QVERIFY(!tor.isEmpty()); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); +} + +void tst_QTranslator::loadSubdir4() +{ + QTranslator tor( 0 ); + tor.load("./hellotr_en_GB", "i18n"); + QVERIFY(!tor.isEmpty()); + QCOMPARE(tor.translate("QPushButton", "Hello world!"), QString::fromLatin1("Hallo Welt!")); +} + class TranslatorThread : public QThread { void run() { @@ -249,10 +285,10 @@ void tst_QTranslator::loadFromResource() void tst_QTranslator::loadDirectory() { - QVERIFY(QFileInfo("../qtranslator").isDir()); + QVERIFY(QFileInfo("i18n").isDir()); QTranslator tor; - tor.load("qtranslator", ".."); + tor.load("qtranslator", "i18n"); QVERIFY(tor.isEmpty()); } -- cgit v0.12 From d278a522dc65046ad7215c333a4a1bf00c12196a Mon Sep 17 00:00:00 2001 From: Sami Rosendahl Date: Fri, 11 Nov 2011 13:17:54 +0100 Subject: Fix crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd If a HTTP server responds with gzip-encoded empty content without defining Content-Length in the response header QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd will crash because it calls zlib inflateEnd for an uninitialized stream. - Fixed the crash by adding a check if the stream is initialized to gunzipBodyPartiallyEnd. - Added a regression test tst_QNetworkReply::nb279420gzipNoContentLengthEmptyContentDisconnect PMO 279420 Task-number: QTBUG-22660 Signed-off-by: Sami Rosendahl Merge-request: 1465 Reviewed-by: Peter Hartmann --- src/network/access/qhttpnetworkreply.cpp | 6 ++++-- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index 129e2c6..b926afe 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -442,8 +442,10 @@ int QHttpNetworkReplyPrivate::gunzipBodyPartially(QByteArray &compressed, QByteA void QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd() { - inflateEnd(&inflateStrm); - initInflate = false; + if (initInflate) { + inflateEnd(&inflateStrm); + initInflate = false; + } } #endif diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 7e5b365..28832b2 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -332,6 +332,7 @@ private Q_SLOTS: void qtbug15311doubleContentLength(); void qtbug18232gzipContentLengthZero(); + void nb279420gzipNoContentLengthEmptyContentDisconnect(); void synchronousRequest_data(); void synchronousRequest(); @@ -5307,6 +5308,28 @@ void tst_QNetworkReply::qtbug18232gzipContentLengthZero() QCOMPARE(reply->readAll(), QByteArray()); } +// Reproduced a crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd +// where zlib inflateEnd was called for uninitialized zlib stream +void tst_QNetworkReply::nb279420gzipNoContentLengthEmptyContentDisconnect() +{ + // Response with no Content-Length in header and empty content + QByteArray response("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\n\r\n"); + MiniHttpServer server(response); + server.doClose = true; + + QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort()))); + QNetworkReplyPtr reply = manager.get(request); + + connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(reply->isFinished()); + QCOMPARE(reply->error(), QNetworkReply::NoError); + QCOMPARE(reply->size(), qint64(0)); + QVERIFY(!reply->header(QNetworkRequest::ContentLengthHeader).isValid()); + QCOMPARE(reply->readAll(), QByteArray()); +} + void tst_QNetworkReply::synchronousRequest_data() { QTest::addColumn("url"); -- cgit v0.12 From ee60e9c88c43cc33dc94a4cec79c62ffdf02ce58 Mon Sep 17 00:00:00 2001 From: Damian Jansen Date: Tue, 15 Nov 2011 14:01:13 +1000 Subject: Fix focusScopeItemChange setting crash Delay focusScopeItemChange to after reparenting, to prevent an invalid focusScopeItem pointer crash. Task-number: QTBUG-21640 Reviewed-by: Martin Jones --- src/gui/graphicsview/qgraphicsitem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 466cc47..9e1fd09 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1157,7 +1157,6 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) { parentFocusScopeItem = fsi; p->d_ptr->focusScopeItem = 0; - fsi->d_ptr->focusScopeItemChange(false); } break; } @@ -1259,6 +1258,10 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q if (!inDestructor && (transformData || (newParent && newParent->d_ptr->transformData))) transformChanged(); + // Reparenting is finished, now safe to notify the previous focusScopeItem about changes + if (parentFocusScopeItem) + parentFocusScopeItem->d_ptr->focusScopeItemChange(false); + // Restore the sub focus chain. if (subFocusItem) { subFocusItem->d_ptr->setSubFocus(newParent); -- cgit v0.12 From 9be94925138d11f9a2f191f9676665eb8f3e6d3a Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 19 May 2011 11:42:31 +1000 Subject: tests: allow unstable tests to be marked with CONFIG+=insignificant_test Marking a test with CONFIG+=insignificant_test will cause the exit code of the test to be discarded during `make check'. This is intended to be used for tests which are valuable to run, but are known to be unstable and are not feasible to immediately fix. Reviewed-by: Jason McDonald Change-Id: I50a712c33c2ebb0af39f1ea0bf2adef7f0936425 (cherry picked from commit b0a5a988900b777cb08012408eb108512a3e873b) --- mkspecs/features/testcase.prf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 7a7c9e3..eb0aa9f 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -38,6 +38,10 @@ embedded: check.commands += -qws # Allow for custom arguments to tests check.commands += $(TESTARGS) + +# If the test is marked as insignificant, discard the exit code +insignificant_test:check.commands = -$${check.commands} + QMAKE_EXTRA_TARGETS *= check !debug_and_release|build_pass { -- cgit v0.12