From 49a55be9730bb30f36ba0e031717cc1f709ddd20 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 3 Jul 2013 12:28:56 +0200 Subject: Windows: Synthesize expose event for shrinking windows. Synthesize expose events for all Windows except ANGLE-windows. Task-number: QTBUG-32121 Change-Id: Ifbff2730ec8f2e8cfe23eeb4022b76a6e432598e Reviewed-by: Oliver Wolff Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowswindow.cpp | 13 +++++++++++- src/plugins/platforms/windows/qwindowswindow.h | 25 ++++++++++++------------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index c3ec949eef..dc51dbfc88 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -808,8 +808,12 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const WindowData &data) : const Qt::WindowType type = aWindow->type(); if (type == Qt::Desktop) return; // No further handling for Qt::Desktop - if (aWindow->surfaceType() == QWindow::OpenGLSurface) + if (aWindow->surfaceType() == QWindow::OpenGLSurface) { setFlag(OpenGLSurface); +#ifdef QT_OPENGL_ES_2 + setFlag(OpenGL_ES2); +#endif + } if (aWindow->isTopLevel()) { switch (type) { case Qt::Window: @@ -1233,9 +1237,16 @@ void QWindowsWindow::handleGeometryChange() //Prevent recursive resizes for Windows CE if (testFlag(WithinSetStyle)) return; + const QRect previousGeometry = m_data.geometry; m_data.geometry = geometry_sys(); QPlatformWindow::setGeometry(m_data.geometry); QWindowSystemInterface::handleGeometryChange(window(), m_data.geometry); + // QTBUG-32121: OpenGL/normal windows (with exception of ANGLE) do not receive + // expose events when shrinking, synthesize. + if (!testFlag(OpenGL_ES2) && isExposed() + && !(m_data.geometry.width() > previousGeometry.width() || m_data.geometry.height() > previousGeometry.height())) { + fireExpose(QRegion(m_data.geometry), true); + } if (testFlag(SynchronousGeometryChangeEvent)) QWindowSystemInterface::flushWindowSystemEvents(); diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 07f3976d87..996542f92a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -124,18 +124,19 @@ public: WithinSetParent = 0x2, FrameDirty = 0x4, //! Frame outdated by setStyle, recalculate in next query. OpenGLSurface = 0x10, - OpenGLDoubleBuffered = 0x20, - OpenGlPixelFormatInitialized = 0x40, - BlockedByModal = 0x80, - SizeGripOperation = 0x100, - FrameStrutEventsEnabled = 0x200, - SynchronousGeometryChangeEvent = 0x400, - WithinSetStyle = 0x800, - WithinDestroy = 0x1000, - TouchRegistered = 0x2000, - AlertState = 0x4000, - Exposed = 0x08000, - WithinCreate = 0x10000 + OpenGL_ES2 = 0x20, + OpenGLDoubleBuffered = 0x40, + OpenGlPixelFormatInitialized = 0x80, + BlockedByModal = 0x100, + SizeGripOperation = 0x200, + FrameStrutEventsEnabled = 0x400, + SynchronousGeometryChangeEvent = 0x800, + WithinSetStyle = 0x1000, + WithinDestroy = 0x2000, + TouchRegistered = 0x4000, + AlertState = 0x8000, + Exposed = 0x10000, + WithinCreate = 0x20000 }; struct WindowData -- cgit v1.2.3 From a0640d328fc80885837578362d3d6fc011b576a6 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 15 Jul 2013 13:13:28 +0200 Subject: test: organize tst_qnetworkreply .pro file a bit - Don't run this test in parallel - Remove redundant QT=-gui - Place the insignificant_test marks together Change-Id: I078fa29a4dccef9af8798792d06d51835b4b8934 Reviewed-by: Friedemann Kleint --- tests/auto/network/access/qnetworkreply/test/test.pro | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/auto/network/access/qnetworkreply/test/test.pro b/tests/auto/network/access/qnetworkreply/test/test.pro index 93a8cbad55..cc58843eef 100644 --- a/tests/auto/network/access/qnetworkreply/test/test.pro +++ b/tests/auto/network/access/qnetworkreply/test/test.pro @@ -1,19 +1,16 @@ CONFIG += testcase testcase.timeout = 600 # this test is slow -CONFIG += parallel_test CONFIG -= app_bundle debug_and_release_target -QT -= gui SOURCES += ../tst_qnetworkreply.cpp TARGET = ../tst_qnetworkreply -contains(QT_CONFIG,xcb): CONFIG+=insignificant_test # unstable, QTBUG-21102 - QT = core-private network-private testlib RESOURCES += ../qnetworkreply.qrc TESTDATA += ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg ../certs \ ../index.html ../smb-file.txt +contains(QT_CONFIG,xcb): CONFIG+=insignificant_test # unstable, QTBUG-21102 win32:CONFIG += insignificant_test # QTBUG-24226 TEST_HELPER_INSTALLS = ../echo/echo -- cgit v1.2.3 From 83de0910c1afb149f04e50db48b6c9abfc35e445 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 15 Jul 2013 13:08:29 +0200 Subject: test: Mark tst_QNetworkReply::backgroundRequestInterruption() as XFAIL on OS X 10.8 Task-number: QTBUG-32435 Change-Id: Ibc4495126b066c17e6a4477f403677b9fc9da453 Reviewed-by: Jake Petroules Reviewed-by: Friedemann Kleint --- tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index bcc0641973..5c04ac8a01 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -7478,6 +7478,10 @@ void tst_QNetworkReply::backgroundRequestInterruption() QNetworkSessionPrivate::setUsagePolicies(*const_cast(session.data()), original); QVERIFY(reply->isFinished()); +#ifdef Q_OS_MACX + if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_8) + QEXPECT_FAIL("ftp, bg, nobg", "See QTBUG-32435", Abort); +#endif QCOMPARE(reply->error(), error); #endif } -- cgit v1.2.3 From d309574c03820beeb60f668fdace1817106b0bd9 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 15 Jul 2013 05:10:17 -0700 Subject: tst_QIcon: Fix availableSizes() and task223279_inconsistentAddFile() Copy some needed files into a local folder when QtWidgets is not available. Task-number: QTBUG-31993 Change-Id: I93b65bda198c22a60e979c119de8de683a78bb53 Reviewed-by: Friedemann Kleint --- .../commonstyle/images/standardbutton-open-128.png | Bin 0 -> 5415 bytes .../commonstyle/images/standardbutton-open-16.png | Bin 0 -> 629 bytes .../commonstyle/images/standardbutton-open-32.png | Bin 0 -> 1154 bytes .../commonstyle/images/standardbutton-save-128.png | Bin 0 -> 4398 bytes .../commonstyle/images/standardbutton-save-16.png | Bin 0 -> 583 bytes .../commonstyle/images/standardbutton-save-32.png | Bin 0 -> 1092 bytes tests/auto/gui/image/qicon/tst_qicon.cpp | 42 +++++++++------------ tests/auto/gui/image/qicon/tst_qicon.qrc | 6 +++ 8 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-128.png create mode 100644 tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-16.png create mode 100644 tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-32.png create mode 100644 tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-128.png create mode 100644 tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-16.png create mode 100644 tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-32.png diff --git a/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-128.png b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-128.png new file mode 100644 index 0000000000..8a052e829d Binary files /dev/null and b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-128.png differ diff --git a/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-16.png b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-16.png new file mode 100644 index 0000000000..08cdc2b91f Binary files /dev/null and b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-16.png differ diff --git a/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-32.png b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-32.png new file mode 100644 index 0000000000..db33c79852 Binary files /dev/null and b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-open-32.png differ diff --git a/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-128.png b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-128.png new file mode 100644 index 0000000000..fc6fd7ce1d Binary files /dev/null and b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-128.png differ diff --git a/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-16.png b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-16.png new file mode 100644 index 0000000000..dd4e228280 Binary files /dev/null and b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-16.png differ diff --git a/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-32.png b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-32.png new file mode 100644 index 0000000000..177678c963 Binary files /dev/null and b/tests/auto/gui/image/qicon/styles/commonstyle/images/standardbutton-save-32.png differ diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp index 6c62d6f1b4..2ce6fc5058 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.cpp +++ b/tests/auto/gui/image/qicon/tst_qicon.cpp @@ -375,32 +375,32 @@ void tst_QIcon::detach() void tst_QIcon::addFile() { QIcon icon; - icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")); - icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-32.png")); - icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-128.png")); - icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"), QSize(), QIcon::Selected); - icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-32.png"), QSize(), QIcon::Selected); - icon.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-128.png"), QSize(), QIcon::Selected); + icon.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")); + icon.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-open-32.png")); + icon.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-open-128.png")); + icon.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-save-16.png"), QSize(), QIcon::Selected); + icon.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-save-32.png"), QSize(), QIcon::Selected); + icon.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-save-128.png"), QSize(), QIcon::Selected); #ifndef Q_OS_WINCE QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() == - QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); + QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); QVERIFY(icon.pixmap(32, QIcon::Normal).toImage() == - QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-32.png")).toImage()); + QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-open-32.png")).toImage()); QVERIFY(icon.pixmap(128, QIcon::Normal).toImage() == - QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-128.png")).toImage()); + QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-open-128.png")).toImage()); QVERIFY(icon.pixmap(16, QIcon::Selected).toImage() == - QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png")).toImage()); + QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-save-16.png")).toImage()); QVERIFY(icon.pixmap(32, QIcon::Selected).toImage() == - QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-32.png")).toImage()); + QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-save-32.png")).toImage()); QVERIFY(icon.pixmap(128, QIcon::Selected).toImage() == - QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-128.png")).toImage()); + QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-save-128.png")).toImage()); #else // WinCE only includes the 16x16 images for size reasons QVERIFY(icon.pixmap(16, QIcon::Normal).toImage() == - QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); + QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")).toImage()); QVERIFY(icon.pixmap(16, QIcon::Selected).toImage() == - QPixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png")).toImage()); + QPixmap(QLatin1String(":/styles/commonstyle/images/standardbutton-save-16.png")).toImage()); #endif } @@ -437,11 +437,8 @@ void tst_QIcon::availableSizes() { // we try to load an icon from resources - QIcon icon(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")); + QIcon icon(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")); QList availableSizes = icon.availableSizes(); -#ifdef QT_NO_WIDGETS - QEXPECT_FAIL("", "See QTBUG-31993", Abort); -#endif QCOMPARE(availableSizes.size(), 1); QCOMPARE(availableSizes.at(0), QSize(16, 16)); } @@ -449,7 +446,7 @@ void tst_QIcon::availableSizes() { // load an icon from binary data. QPixmap pix; - QFile file(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")); + QFile file(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")); QVERIFY(file.open(QIODevice::ReadOnly)); uchar *data = file.map(0, file.size()); QVERIFY(data != 0); @@ -629,18 +626,15 @@ void tst_QIcon::fromTheme() void tst_QIcon::task223279_inconsistentAddFile() { QIcon icon1; - icon1.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")); + icon1.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")); icon1.addFile(QLatin1String("IconThatDoesntExist"), QSize(32, 32)); QPixmap pm1 = icon1.pixmap(32, 32); QIcon icon2; - icon2.addFile(QLatin1String(":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png")); + icon2.addFile(QLatin1String(":/styles/commonstyle/images/standardbutton-open-16.png")); icon2.addFile(QLatin1String("IconThatDoesntExist")); QPixmap pm2 = icon1.pixmap(32, 32); -#ifdef QT_NO_WIDGETS - QEXPECT_FAIL("", "See QTBUG-31993", Abort); -#endif QCOMPARE(pm1.isNull(), false); QCOMPARE(pm1.size(), QSize(16,16)); QCOMPARE(pm1.isNull(), pm2.isNull()); diff --git a/tests/auto/gui/image/qicon/tst_qicon.qrc b/tests/auto/gui/image/qicon/tst_qicon.qrc index 7925a33c84..469a0a21b4 100644 --- a/tests/auto/gui/image/qicon/tst_qicon.qrc +++ b/tests/auto/gui/image/qicon/tst_qicon.qrc @@ -16,5 +16,11 @@ ./icons/themeparent/index.theme ./icons/themeparent/scalable/actions/address-book-new.svg ./icons/themeparent/scalable/actions/appointment-new.svg +./styles/commonstyle/images/standardbutton-open-16.png +./styles/commonstyle/images/standardbutton-open-32.png +./styles/commonstyle/images/standardbutton-open-128.png +./styles/commonstyle/images/standardbutton-save-16.png +./styles/commonstyle/images/standardbutton-save-32.png +./styles/commonstyle/images/standardbutton-save-128.png -- cgit v1.2.3 From 79fcc7787a7d52dbd33f3a5e64ea4b2e61d0ddee Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 Jul 2013 18:15:40 +0200 Subject: undo accidental string merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit amends 51980595e1. Change-Id: Ie4fd4a6d762f4c87dabd7d3124f3397b0f853b77 Reviewed-by: Tor Arne Vestbø --- qmake/generators/mac/pbuilder_pbx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 227aeb53d3..d82327737b 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -516,7 +516,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) //HEADER const int pbVersion = pbuilderVersion(); ProStringList buildConfigGroups; - buildConfigGroups << "PROJECTTARGET"; + buildConfigGroups << "PROJECT" << "TARGET"; t << "// !$*UTF8*$!\n" << "{\n" -- cgit v1.2.3 From 8a245c9fc2b4cb1a228d300f9dfbfea28806350f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 Jul 2013 16:01:36 +0200 Subject: prune unused filesDiffer() and writeToFile() functions Change-Id: I470a5b3514260a02e73389d057d89c64b08e05d0 Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 43 ---------------------------------------- tools/configure/configureapp.h | 1 - 2 files changed, 44 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 349281dd1e..abc1ba4407 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -92,22 +92,6 @@ static inline void promptKeyPress() exit(0); // Exit cleanly for Ctrl+C } -bool writeToFile(const char* text, const QString &filename) -{ - QByteArray symFile(text); - QFile file(filename); - QDir dir(QFileInfo(file).absoluteDir()); - if (!dir.exists()) - dir.mkpath(dir.absolutePath()); - if (!file.open(QFile::WriteOnly | QFile::Text)) { - cout << "Couldn't write to " << qPrintable(filename) << ": " << qPrintable(file.errorString()) - << endl; - return false; - } - file.write(symFile); - return true; -} - Configure::Configure(int& argc, char** argv) { // Default values for indentation @@ -4286,31 +4270,4 @@ int Configure::platform() const return WINDOWS; } -bool -Configure::filesDiffer(const QString &fn1, const QString &fn2) -{ - QFile file1(fn1), file2(fn2); - if (!file1.open(QFile::ReadOnly) || !file2.open(QFile::ReadOnly)) - return true; - const int chunk = 2048; - int used1 = 0, used2 = 0; - char b1[chunk], b2[chunk]; - while (!file1.atEnd() && !file2.atEnd()) { - if (!used1) - used1 = file1.read(b1, chunk); - if (!used2) - used2 = file2.read(b2, chunk); - if (used1 > 0 && used2 > 0) { - const int cmp = qMin(used1, used2); - if (memcmp(b1, b2, cmp)) - return true; - if ((used1 -= cmp)) - memcpy(b1, b1+cmp, used1); - if ((used2 -= cmp)) - memcpy(b2, b2+cmp, used2); - } - } - return !file1.atEnd() || !file2.atEnd(); -} - QT_END_NAMESPACE diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 8f95e1fb95..d77b136ac8 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -159,7 +159,6 @@ private: QString formatPath(const QString &path); QString formatPaths(const QStringList &paths); - bool filesDiffer(const QString &file1, const QString &file2); QString locateFile(const QString &fileName) const; bool findFile(const QString &fileName) const { return !locateFile(fileName).isEmpty(); } -- cgit v1.2.3 From ca645afdc4f51a4002d715ae02c4c38520257774 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 Jul 2013 16:45:44 +0200 Subject: de-duplicate writeout of config files Change-Id: Iaad06f170cf2be3d3fca533a735b69316347ed5b Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 169 ++++++++++++++++++--------------------- tools/configure/configureapp.h | 10 +++ 2 files changed, 90 insertions(+), 89 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index abc1ba4407..50b31bbb95 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2806,21 +2806,19 @@ void Configure::generateOutputVars() void Configure::generateCachefile() { // Generate .qmake.cache - QFile cacheFile(buildPath + "/.qmake.cache"); - if (cacheFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file. - QTextStream cacheStream(&cacheFile); + { + FileWriter cacheStream(buildPath + "/.qmake.cache"); cacheStream << "QT_SOURCE_TREE = " << formatPath(dictionary["QT_SOURCE_TREE"]) << endl; cacheStream << "QT_BUILD_TREE = " << formatPath(dictionary["QT_BUILD_TREE"]) << endl; - cacheStream.flush(); - cacheFile.close(); + if (!cacheStream.flush()) + dictionary[ "DONE" ] = "error"; } // Generate qmodule.pri - QFile moduleFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qmodule.pri"); - if (moduleFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file. - QTextStream moduleStream(&moduleFile); + { + FileWriter moduleStream(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qmodule.pri"); moduleStream << "QT_BUILD_PARTS += " << buildParts.join(' ') << endl; if (!skipModules.isEmpty()) @@ -2882,8 +2880,8 @@ void Configure::generateCachefile() for (QStringList::Iterator var = qmakeVars.begin(); var != qmakeVars.end(); ++var) moduleStream << (*var) << endl; - moduleStream.flush(); - moduleFile.close(); + if (!moduleStream.flush()) + dictionary[ "DONE" ] = "error"; } } @@ -3079,9 +3077,8 @@ bool Configure::compilerSupportsFlag(const QString &compilerAndArgs) void Configure::generateQConfigPri() { // Generate qconfig.pri - QFile configFile(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qconfig.pri"); - if (configFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file. - QTextStream configStream(&configFile); + { + FileWriter configStream(dictionary[ "QT_BUILD_TREE" ] + "/mkspecs/qconfig.pri"); configStream << "CONFIG+= "; configStream << dictionary[ "BUILD" ]; @@ -3151,8 +3148,8 @@ void Configure::generateQConfigPri() if (dictionary[ "SHARED" ] == "no") configStream << "QT_DEFAULT_QPA_PLUGIN = q" << qpaPlatformName() << endl; - configStream.flush(); - configFile.close(); + if (!configStream.flush()) + dictionary[ "DONE" ] = "error"; } } @@ -3190,13 +3187,8 @@ QString Configure::addDefine(QString def) void Configure::generateConfigfiles() { - QDir(buildPath).mkpath("src/corelib/global"); - QString outName(buildPath + "/src/corelib/global/qconfig.h"); - QTemporaryFile tmpFile; - QTextStream tmpStream; - - if (tmpFile.open()) { - tmpStream.setDevice(&tmpFile); + { + FileWriter tmpStream(buildPath + "/src/corelib/global/qconfig.h"); if (dictionary[ "QCONFIG" ] == "full") { tmpStream << "/* Everything */" << endl; @@ -3206,8 +3198,7 @@ void Configure::generateConfigfiles() tmpStream << "#ifndef QT_BOOTSTRAPPED" << endl; QFile inFile(sourcePath + "/src/corelib/global/" + configName); if (inFile.open(QFile::ReadOnly)) { - QByteArray buffer = inFile.readAll(); - tmpFile.write(buffer.constData(), buffer.size()); + tmpStream << QTextStream(&inFile).readAll(); inFile.close(); } tmpStream << "#endif // QT_BOOTSTRAPPED" << endl; @@ -3338,68 +3329,40 @@ void Configure::generateConfigfiles() tmpStream<<"#define QT_QPA_DEFAULT_PLATFORM_NAME \"" << qpaPlatformName() << "\""< #include #include +#include #include #include @@ -191,5 +192,14 @@ public: Configure::ProjectType qmakeTemplate; }; +class FileWriter : public QTextStream +{ +public: + FileWriter(const QString &name); + bool flush(); +private: + QString m_name; + QBuffer m_buffer; +}; QT_END_NAMESPACE -- cgit v1.2.3 From 922df2c2339288299fe8d9d5c781397f18532ba3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 Jul 2013 16:46:28 +0200 Subject: don't change timestamp of unchanged files Change-Id: Ifa5c15a37d072c6c8edb50f8a4343d99ee0dccf9 Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 50b31bbb95..5b62e8f106 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -4235,6 +4235,12 @@ FileWriter::FileWriter(const QString &name) bool FileWriter::flush() { QTextStream::flush(); + QFile oldFile(m_name); + if (oldFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + if (oldFile.readAll() == m_buffer.data()) + return true; + oldFile.close(); + } QString dir = QFileInfo(m_name).absolutePath(); if (!QDir().mkpath(dir)) { cout << "Cannot create directory " << qPrintable(QDir::toNativeSeparators(dir)) << ".\n"; -- cgit v1.2.3 From 94e42cb7727cf0415c0f79d860228ad362aa4fb5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 Jul 2013 15:09:11 +0200 Subject: un-clash iterator names Change-Id: I96b995c7f6dec06f75a61e109c419c9204744d90 Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index a08c76416b..1f2ebcf50e 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1987,10 +1987,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if(!exists(file)) { QString localFile; QList depdirs = QMakeSourceFileInfo::dependencyPaths(); - for(QList::Iterator it = depdirs.begin(); - it != depdirs.end(); ++it) { - if(exists((*it).real() + Option::dir_sep + file)) { - localFile = (*it).local() + Option::dir_sep + file; + for (QList::Iterator dit = depdirs.begin(); + dit != depdirs.end(); ++dit) { + if (exists((*dit).real() + Option::dir_sep + file)) { + localFile = (*dit).local() + Option::dir_sep + file; break; } } @@ -2065,10 +2065,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if(!exists(file)) { QString localFile; QList depdirs = QMakeSourceFileInfo::dependencyPaths(); - for(QList::Iterator it = depdirs.begin(); - it != depdirs.end(); ++it) { - if(exists((*it).real() + Option::dir_sep + file)) { - localFile = (*it).local() + Option::dir_sep + file; + for (QList::Iterator dit = depdirs.begin(); + dit != depdirs.end(); ++dit) { + if (exists((*dit).real() + Option::dir_sep + file)) { + localFile = (*dit).local() + Option::dir_sep + file; break; } } -- cgit v1.2.3 From c843fac5df6989d06b37a7d90da6eb220f3ac0b8 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 13 Jul 2013 10:02:02 +0200 Subject: Define QT_NO_DEBUG with RelWithDebInfo and MinSizeRel builds. Task-number: QTBUG-32403 Change-Id: I709ca32ca5bc1a342593357735ef3911ef849eb9 Reviewed-by: Clinton Stimpson Reviewed-by: Stephen Kelly --- src/corelib/Qt5CoreMacros.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index b6124b40cd..f549fead59 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -244,6 +244,8 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_module}_INCLUDE_DIRS}) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_module}_COMPILE_DEFINITIONS}) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG) + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG) + set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG) if (Qt5_POSITION_INDEPENDENT_CODE) set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE}) -- cgit v1.2.3 From 4a212be6f0837b45800ca86e8658b8842af0af18 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 15 Jul 2013 10:54:55 +0200 Subject: Only run the cmake test in the install location if not already done. For developer builds, there is no need to run the test a second time. Change-Id: I3564874cb2e9d6cc243e25a89ecd7f89df23b0bd Reviewed-by: Oswald Buddenhagen --- mkspecs/features/ctest_testcase_installed.prf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/ctest_testcase_installed.prf b/mkspecs/features/ctest_testcase_installed.prf index be741b4a0b..b54f321008 100644 --- a/mkspecs/features/ctest_testcase_installed.prf +++ b/mkspecs/features/ctest_testcase_installed.prf @@ -1,8 +1,10 @@ -CMAKE_TEST_LOCATION = $$_PRO_FILE_PWD_/../cmake +prefix_build { + CMAKE_TEST_LOCATION = $$_PRO_FILE_PWD_/../cmake -CMAKE_PREFIX_PATH = $$[QT_INSTALL_PREFIX] + CMAKE_PREFIX_PATH = $$[QT_INSTALL_PREFIX] -CONFIG += insignificant_test + CONFIG += insignificant_test -include(ctest_testcase_common.prf) + include(ctest_testcase_common.prf) +} -- cgit v1.2.3 From ef93397d7039ef7b4f4f1d41dcb4e5f50cb8481b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Jul 2013 11:34:20 +0200 Subject: Mac OS: Fix a crash in tst_qgraphicsproxywidget. Change-Id: Ie93d77f00ee1e6a04ac20794e4d2d1e63cbdb636 Reviewed-by: Andreas Aardal Hanssen --- src/widgets/graphicsview/qgraphicsproxywidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index 1898ecba68..0ed0b0ec3f 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -356,6 +356,9 @@ QWidget *QGraphicsProxyWidgetPrivate::findFocusChild(QWidget *child, bool next) } } + if (!child) + return 0; + QWidget *oldChild = child; uint focus_flag = qt_tab_all_widgets() ? Qt::TabFocus : Qt::StrongFocus; do { -- cgit v1.2.3 From e89547fff44b5558039c04397d7dc8a03cd504e3 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 15 Jul 2013 11:55:24 +0200 Subject: Doc: Update description of QAbstractItemModel::supportedDragActions() Update documentation for the QAbstractItemModel::supportedDragActions() (virtual since 5.0) and the obsoleted setter function. Task-number: QTBUG-32410 Change-Id: I4f77601bca63e5f782ade1f577104500f541bbb1 Reviewed-by: Stephen Kelly Reviewed-by: Geir Vattekar --- src/corelib/itemmodels/qabstractitemmodel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index f152dec5e6..4162e843a7 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -1911,8 +1911,8 @@ Qt::DropActions QAbstractItemModel::supportedDropActions() const /*! Returns the actions supported by the data in this model. - The default implementation returns supportedDropActions() unless specific - values have been set with setSupportedDragActions(). + The default implementation returns supportedDropActions(). Reimplement + this function if you wish to support additional actions. supportedDragActions() is used by QAbstractItemView::startDrag() as the default values when a drag occurs. @@ -1941,6 +1941,8 @@ void QAbstractItemModel::doSetSupportedDragActions(Qt::DropActions actions) \obsolete \fn void QAbstractItemModel::setSupportedDragActions(Qt::DropActions actions) + This function is obsolete. Reimplement supportedDragActions() instead. + Sets the supported drag \a actions for the items in the model. \sa supportedDragActions(), {Using drag and drop with item views} -- cgit v1.2.3 From aab50ad061dfaff7a0a30a4164163fdd41571270 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Jul 2013 13:11:06 +0200 Subject: QGuiApplicationPrivate::updateBlockedStatus(): Recurse over children. Task-number: QTBUG-32242 Change-Id: Ia43257a998507b9a367f41dc2395ab92cc89a118 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qguiapplication.cpp | 21 ++++++++++++++------- .../kernel/qguiapplication/tst_qguiapplication.cpp | 9 +++++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 118b481fa3..901f47c584 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -477,18 +477,25 @@ QWindow *QGuiApplication::modalWindow() return QGuiApplicationPrivate::self->modalWindowList.first(); } +static void updateBlockedStatusRecursion(QWindow *window, bool shouldBeBlocked) +{ + QWindowPrivate *p = qt_window_private(window); + if (p->blockedByModalWindow != shouldBeBlocked) { + p->blockedByModalWindow = shouldBeBlocked; + QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked); + QGuiApplication::sendEvent(window, &e); + foreach (QObject *c, window->children()) + if (c->isWindowType()) + updateBlockedStatusRecursion(static_cast(c), shouldBeBlocked); + } +} + void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window) { bool shouldBeBlocked = false; if ((window->type() & Qt::Popup) != Qt::Popup && !self->modalWindowList.isEmpty()) shouldBeBlocked = self->isWindowBlocked(window); - - if (shouldBeBlocked != window->d_func()->blockedByModalWindow) { - QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked); - - window->d_func()->blockedByModalWindow = shouldBeBlocked; - QGuiApplication::sendEvent(window, &e); - } + updateBlockedStatusRecursion(window, shouldBeBlocked); } void QGuiApplicationPrivate::showModalWindow(QWindow *modal) diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index ed07b3fab5..29f198f1ba 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -372,8 +372,8 @@ public: int leaves; int enters; - inline BlockableWindow() - : QWindow(), blocked(false), leaves(0), enters(0) {} + inline explicit BlockableWindow(QWindow *parent = 0) + : QWindow(parent), blocked(false), leaves(0), enters(0) {} bool event(QEvent *e) { @@ -416,6 +416,8 @@ void tst_QGuiApplication::modalWindow() window1->setTitle(QStringLiteral("window1")); window1->resize(windowSize, windowSize); window1->setFramePosition(QPoint(x, y)); + BlockableWindow *childWindow1 = new BlockableWindow(window1.data()); + childWindow1->resize(windowSize / 2, windowSize / 2); x += spacing + windowSize; QScopedPointer window2(new BlockableWindow); @@ -458,6 +460,7 @@ void tst_QGuiApplication::modalWindow() QVERIFY(QTest::qWaitForWindowExposed(window2.data())); QCOMPARE(app.modalWindow(), static_cast(0)); QCOMPARE(window1->blocked, 0); + QCOMPARE(childWindow1->blocked, 0); QCOMPARE(window2->blocked, 0); QCOMPARE(windowModalWindow1->blocked, 0); QCOMPARE(windowModalWindow2->blocked, 0); @@ -473,6 +476,7 @@ void tst_QGuiApplication::modalWindow() applicationModalWindow1->show(); QCOMPARE(app.modalWindow(), applicationModalWindow1.data()); QCOMPARE(window1->blocked, 1); + QCOMPARE(childWindow1->blocked, 1); // QTBUG-32242, blocked status needs to be set on children as well. QCOMPARE(window2->blocked, 1); QCOMPARE(windowModalWindow1->blocked, 1); QCOMPARE(windowModalWindow2->blocked, 1); @@ -500,6 +504,7 @@ void tst_QGuiApplication::modalWindow() applicationModalWindow1->hide(); QCOMPARE(app.modalWindow(), static_cast(0)); QCOMPARE(window1->blocked, 0); + QCOMPARE(childWindow1->blocked, 0); // QTBUG-32242, blocked status needs to be set on children as well. QCOMPARE(window2->blocked, 0); QCOMPARE(windowModalWindow1->blocked, 0); QCOMPARE(windowModalWindow2->blocked, 0); -- cgit v1.2.3 From 4315f270e6d553f0c6537617b8efff8988f1f083 Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 16 Jul 2013 10:25:00 +0200 Subject: Fix compilation of QLockFile on Solaris flock isn't available but we use fcnlt already (which is the recommended alternative on Solaris) Change-Id: I718e59c4804950a26eeb610888e17ce666522dcc Reviewed-by: Thiago Macieira --- src/corelib/io/qlockfile_unix.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index db81d65565..1676b71133 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -86,8 +86,10 @@ int QLockFilePrivate::checkFcntlWorksAfterFlock() if (!file.open()) return 0; const int fd = file.d_func()->engine()->handle(); +#if defined(LOCK_EX) && defined(LOCK_NB) if (flock(fd, LOCK_EX | LOCK_NB) == -1) // other threads, and other processes on a local fs return 0; +#endif struct flock flockData; flockData.l_type = F_WRLCK; flockData.l_whence = SEEK_SET; @@ -121,8 +123,10 @@ static bool fcntlWorksAfterFlock() static bool setNativeLocks(int fd) { +#if defined(LOCK_EX) && defined(LOCK_NB) if (flock(fd, LOCK_EX | LOCK_NB) == -1) // other threads, and other processes on a local fs return false; +#endif struct flock flockData; flockData.l_type = F_WRLCK; flockData.l_whence = SEEK_SET; -- cgit v1.2.3 From 8493f5d6a343c9a754ce439fed77c7e1a901747e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Jul 2013 16:03:13 +0200 Subject: Detect popup window correctly in modal window blocked handling. Task-number: QTBUG-32433 Change-Id: Ida8f6237a383311bc2e231de90fd54b90ebd1508 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qguiapplication.cpp | 9 +++++++-- tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 901f47c584..bf8440cccf 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -210,6 +210,11 @@ static inline void clearFontUnlocked() QGuiApplicationPrivate::app_font = 0; } +static inline bool isPopupWindow(const QWindow *w) +{ + return (w->flags() & Qt::WindowType_Mask) == Qt::Popup; +} + /*! \class QGuiApplication \brief The QGuiApplication class manages the GUI application's control @@ -493,7 +498,7 @@ static void updateBlockedStatusRecursion(QWindow *window, bool shouldBeBlocked) void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window) { bool shouldBeBlocked = false; - if ((window->type() & Qt::Popup) != Qt::Popup && !self->modalWindowList.isEmpty()) + if (!isPopupWindow(window) && !self->modalWindowList.isEmpty()) shouldBeBlocked = self->isWindowBlocked(window); updateBlockedStatusRecursion(window, shouldBeBlocked); } @@ -503,7 +508,7 @@ void QGuiApplicationPrivate::showModalWindow(QWindow *modal) self->modalWindowList.prepend(modal); // Send leave for currently entered window if it should be blocked - if (currentMouseWindow && (currentMouseWindow->type() & Qt::Popup) != Qt::Popup) { + if (currentMouseWindow && !isPopupWindow(currentMouseWindow)) { bool shouldBeBlocked = self->isWindowBlocked(currentMouseWindow); if (shouldBeBlocked) { // Remove the new window from modalWindowList temporarily so leave can go through diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index 29f198f1ba..663f664d94 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -422,6 +422,7 @@ void tst_QGuiApplication::modalWindow() QScopedPointer window2(new BlockableWindow); window2->setTitle(QStringLiteral("window2")); + window2->setFlags(window2->flags() & Qt::Tool); // QTBUG-32433, don't be fooled by unusual window flags. window2->resize(windowSize, windowSize); window2->setFramePosition(QPoint(x, y)); x += spacing + windowSize; -- cgit v1.2.3 From 9b8b6c7db834fe36f9effdac466decb3cf4a71b7 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Mon, 15 Jul 2013 12:12:08 +0300 Subject: Fix QDBusAbstractInterface::isValid() for peer connections Do not attempt to lookup the service owner on peer connections (it will fail). Make QDBusAbstractInterface::isValid() return a sensible result on peer connections, instead of always returning false. Task-number: QTBUG-32374 Change-Id: I1b02feaffb3b255188f8d63306f89f5034a32f22 Reviewed-by: Thiago Macieira --- src/dbus/qdbusabstractinterface.cpp | 14 +++++++++--- .../tst_qdbusabstractinterface.cpp | 26 ++++++++++++++++++++-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index 53def1beb6..0b584963ee 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -288,7 +288,8 @@ QDBusAbstractInterface::QDBusAbstractInterface(QDBusAbstractInterfacePrivate &d, if (d.isValid && d.connection.isConnected() && !d.service.isEmpty() - && !d.service.startsWith(QLatin1Char(':'))) + && !d.service.startsWith(QLatin1Char(':')) + && d.connectionPrivate()->mode != QDBusConnectionPrivate::PeerMode) d_func()->connection.connect(QLatin1String(DBUS_SERVICE_DBUS), // service QString(), // path QLatin1String(DBUS_INTERFACE_DBUS), // interface @@ -313,7 +314,8 @@ QDBusAbstractInterface::QDBusAbstractInterface(const QString &service, const QSt if (d_func()->isValid && d_func()->connection.isConnected() && !service.isEmpty() - && !service.startsWith(QLatin1Char(':'))) + && !service.startsWith(QLatin1Char(':')) + && d_func()->connectionPrivate()->mode != QDBusConnectionPrivate::PeerMode) d_func()->connection.connect(QLatin1String(DBUS_SERVICE_DBUS), // service QString(), // path QLatin1String(DBUS_INTERFACE_DBUS), // interface @@ -340,7 +342,13 @@ QDBusAbstractInterface::~QDBusAbstractInterface() */ bool QDBusAbstractInterface::isValid() const { - return !d_func()->currentOwner.isEmpty(); + Q_D(const QDBusAbstractInterface); + /* We don't retrieve the owner name for peer connections */ + if (d->connectionPrivate() && d->connectionPrivate()->mode == QDBusConnectionPrivate::PeerMode) { + return d->isValid; + } else { + return !d->currentOwner.isEmpty(); + } } /*! diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 308e12b9ab..5f3cf539e9 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -70,12 +70,12 @@ class tst_QDBusAbstractInterface: public QObject return Pinger(new com::trolltech::QtDBus::Pinger(service, path, con)); } - Pinger getPingerPeer(const QString &path = "/") + Pinger getPingerPeer(const QString &path = "/", const QString &service = "") { QDBusConnection con = QDBusConnection("peer"); if (!con.isConnected()) return Pinger(); - return Pinger(new com::trolltech::QtDBus::Pinger("", path, con)); + return Pinger(new com::trolltech::QtDBus::Pinger(service, path, con)); } void resetServer() @@ -197,6 +197,10 @@ private slots: void directPropertyReadErrorsPeer(); void directPropertyWriteErrorsPeer_data(); void directPropertyWriteErrorsPeer(); + + void validity_data(); + void validity(); + private: QProcess proc; }; @@ -1381,5 +1385,23 @@ void tst_QDBusAbstractInterface::directPropertyWriteErrorsPeer() QTEST(p->lastError().name(), "errorName"); } +void tst_QDBusAbstractInterface::validity_data() +{ + QTest::addColumn("service"); + + QTest::newRow("null-service") << ""; + QTest::newRow("ignored-service") << "org.example.anyservice"; +} + +void tst_QDBusAbstractInterface::validity() +{ + /* Test case for QTBUG-32374 */ + QFETCH(QString, service); + Pinger p = getPingerPeer("/", service); + QVERIFY2(p, "Not connected to D-Bus"); + + QVERIFY(p->isValid()); +} + QTEST_MAIN(tst_QDBusAbstractInterface) #include "tst_qdbusabstractinterface.moc" -- cgit v1.2.3 From 5ec344cc7796b8708e2ae722f7cd184c56844504 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 16 Jul 2013 10:44:48 +0200 Subject: Make *ItemBoundingRect modes work with custom shapes. Currently, calling QGraphicsScene::items(QPointF(0, 0), Qt::IntersectsItemBoundingRect) or QGraphicsScene::items(QPointF(0, 0), Qt::ContainsItemBoundingRect) will exclude items whose shape does not contain QPointF(0, 0). This is because QGraphicsSceneIndexPointIntersector::intersect() also checks if the point is contained within the shape, instead of just checking if it is contained within the bounding rect. Task-number: QTBUG-19036 Change-Id: Ie701af2a5694d40cf9b3c9c19adbb09a53a4e398 Reviewed-by: Giuseppe D'Angelo Reviewed-by: Andreas Aardal Hanssen --- src/widgets/graphicsview/qgraphicssceneindex.cpp | 2 +- .../tst_qgraphicssceneindex.cpp | 52 ++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/widgets/graphicsview/qgraphicssceneindex.cpp b/src/widgets/graphicsview/qgraphicssceneindex.cpp index 4b1c990578..398e72e4c3 100644 --- a/src/widgets/graphicsview/qgraphicssceneindex.cpp +++ b/src/widgets/graphicsview/qgraphicssceneindex.cpp @@ -151,7 +151,7 @@ public: itemd->sceneTransform.dy()) : itemd->sceneTransform.mapRect(brect); keep = sceneBoundingRect.intersects(QRectF(scenePoint, QSizeF(1, 1))); - if (keep) { + if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) { QPointF p = itemd->sceneTransformTranslateOnly ? QPointF(scenePoint.x() - itemd->sceneTransform.dx(), scenePoint.y() - itemd->sceneTransform.dy()) diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp index dd432912f3..55fcd96dc0 100644 --- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp @@ -61,6 +61,8 @@ private slots: void movingItems(); void connectedToSceneRectChanged(); void items(); + void boundingRectPointIntersection_data(); + void boundingRectPointIntersection(); void removeItems(); void clear(); @@ -233,6 +235,56 @@ void tst_QGraphicsSceneIndex::items() QCOMPARE(scene.items().size(), 3); } +class CustomShapeItem : public QGraphicsItem +{ +public: + CustomShapeItem(const QPainterPath &shape) : QGraphicsItem(0), mShape(shape) {} + + QPainterPath shape() const { return mShape; } + QRectF boundingRect() const { return mShape.boundingRect(); } + void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) {} +private: + QPainterPath mShape; +}; + +Q_DECLARE_METATYPE(Qt::ItemSelectionMode) +Q_DECLARE_METATYPE(QPainterPath) + +void tst_QGraphicsSceneIndex::boundingRectPointIntersection_data() +{ + QTest::addColumn("itemShape"); + QTest::addColumn("mode"); + + QTest::newRow("zero shape - intersects rect") << QPainterPath() << Qt::IntersectsItemBoundingRect; + QTest::newRow("zero shape - contains rect") << QPainterPath() << Qt::ContainsItemBoundingRect; + + QPainterPath triangle; + triangle.moveTo(50, 0); + triangle.lineTo(0, 50); + triangle.lineTo(100, 50); + triangle.lineTo(50, 0); + QTest::newRow("triangle shape - intersects rect") << triangle << Qt::IntersectsItemBoundingRect; + QTest::newRow("triangle shape - contains rect") << triangle << Qt::ContainsItemBoundingRect; + + QPainterPath rect; + rect.addRect(QRectF(0, 0, 100, 100)); + QTest::newRow("rectangle shape - intersects rect") << rect << Qt::IntersectsItemBoundingRect; + QTest::newRow("rectangle shape - contains rect") << rect << Qt::ContainsItemBoundingRect; +} + +void tst_QGraphicsSceneIndex::boundingRectPointIntersection() +{ + QFETCH(QPainterPath, itemShape); + QFETCH(Qt::ItemSelectionMode, mode); + + QGraphicsScene scene; + CustomShapeItem *item = new CustomShapeItem(itemShape); + scene.addItem(item); + QList items = scene.items(QPointF(0, 0), mode, Qt::AscendingOrder); + QVERIFY(!items.isEmpty()); + QCOMPARE(items.first(), item); +} + class RectWidget : public QGraphicsWidget { Q_OBJECT -- cgit v1.2.3 From c9182bc11b77675405941a0a163603cac064d8bc Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 17 Jul 2013 11:13:08 +0200 Subject: OSX: Disable window restoration for the Mac font panel because if it is automatically restored it's out of the application's control, so the user's interaction will be ignored. Change I8ce3cd94f5ae81d7877a346743ca4e0e188baa02 did this for normal windows by default, but the dialog helpers generate windows which aren't affected by that. Change-Id: I819d7ab4e51e90783d55cee0676dbc33b38c5b00 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index e7cf47395b..a70ba3749f 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -140,6 +140,11 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) mDialogIsExecuting = false; mResultSet = false; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) + [mFontPanel setRestorable:NO]; +#endif + [mFontPanel setTitle:QCFString::toNSString(helper->options()->windowTitle())]; if (mHelper->options()->testOption(QFontDialogOptions::NoButtons)) { -- cgit v1.2.3 From 12e97b5fb4bedbc945b4d5409ba9044a7046488c Mon Sep 17 00:00:00 2001 From: Takumi Asaki Date: Wed, 17 Jul 2013 16:42:30 +0900 Subject: Fix typo in qdoc's messages. Change-Id: I837eaef4fb114c20a75ffc188b49aa612f07f507 Reviewed-by: Friedemann Kleint Reviewed-by: Martin Smith --- src/tools/qdoc/doc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index 12056502d5..42b98502e0 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -1068,7 +1068,7 @@ void DocParser::parse(const QString& source, } if (!inTableHeader && !inTableRow) { - location().warning(tr("Missing '\\%1' or '\\%1' before '\\%3'") + location().warning(tr("Missing '\\%1' or '\\%2' before '\\%3'") .arg(cmdName(CMD_HEADER)) .arg(cmdName(CMD_ROW)) .arg(cmdName(CMD_LI))); @@ -1190,7 +1190,7 @@ void DocParser::parse(const QString& source, leavePara(); p1 = getRestOfLine(); if (p1.isEmpty()) - location().warning(tr("Missing format name after '\\%1") + location().warning(tr("Missing format name after '\\%1'") .arg(cmdName(CMD_RAW))); append(Atom::FormatIf, p1); append(Atom::RawString, untabifyEtc(getUntilEnd(cmd))); -- cgit v1.2.3 From 183cc501d66336e419740cb176f8a351d3477d02 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 17 Jul 2013 11:22:45 +0200 Subject: QNX: Handle Qt::WindowDoesNotAcceptFocus correctly. Discovered while working on: Task-number: QTBUG-32385 Change-Id: Id1ff31ea6a367983676125810b4f49629233d374 Reviewed-by: Andreas Holzammer Reviewed-by: Frank Osterfeld Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 87e59dac61..5aa1c970fd 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -135,7 +135,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context) if (result != 0) qFatal("QQnxWindow: failed to set window swap interval, errno=%d", errno); - if (window->flags() && Qt::WindowDoesNotAcceptFocus) { + if (window->flags() & Qt::WindowDoesNotAcceptFocus) { errno = 0; val = SCREEN_SENSITIVITY_NO_FOCUS; result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SENSITIVITY, &val); -- cgit v1.2.3 From 07bc5302503ef855541f5bc39296798127a06de1 Mon Sep 17 00:00:00 2001 From: Bjoern Breitmeyer Date: Thu, 18 Jul 2013 13:51:08 +0200 Subject: Better errorhandling for the fontengine on WINCE. The CE fontengine only supports translations, scaled Text would only work if its an isometric scale and would require to create a new font from the old one. Rotations and more aren't supported at all. The freetype fontengine for CE supports this, so we give a warning that the font might be rendered incorrect, but could render correct with the freetype engine. Task-number: QTBUG-32189 Change-Id: I3581c3fef8e4ee118c0038a6ccc237e66b583731 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsfontengine.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 792e79df19..33ddcaffc5 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -1128,11 +1128,10 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph, } #else // else wince unsigned int options = 0; -#ifdef DEBUG - Q_ASSERT(!has_transformation); -#else - Q_UNUSED(has_transformation); -#endif + if (has_transformation) { + qWarning() << "QWindowsFontEngine is unable to apply transformations other than translations for fonts on Windows CE." + << "If you need them anyway, start your application with -platform windows:fontengine=freetype."; + } #endif // wince QWindowsNativeImage *ni = new QWindowsNativeImage(iw + 2 * margin + 4, ih + 2 * margin + 4, -- cgit v1.2.3 From 81addcc1edddaefa19080ad90c27df49f92b53a6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 17 Jul 2013 14:39:42 +0200 Subject: XCB: Set WM_CLASS. Set the instance name and class name of the application windows. Task-number: QTBUG-29396 Change-Id: Ia1fb492ab169108c3779deb8964bb731b322dd89 Reviewed-by: Uli Schlachter Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbconnection.cpp | 1 + src/plugins/platforms/xcb/qxcbconnection.h | 1 + src/plugins/platforms/xcb/qxcbintegration.cpp | 44 +++++++++++++++++++++++++++ src/plugins/platforms/xcb/qxcbintegration.h | 4 +++ src/plugins/platforms/xcb/qxcbwindow.cpp | 7 +++++ 5 files changed, 57 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index f944b65a57..01af23377e 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1232,6 +1232,7 @@ static const char * xcb_atomnames = { // ICCCM window state "WM_STATE\0" "WM_CHANGE_STATE\0" + "WM_CLASS\0" // Session management "WM_CLIENT_LEADER\0" diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 883ee95e22..2a5ff0b1cb 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -102,6 +102,7 @@ namespace QXcbAtom { // ICCCM window state WM_STATE, WM_CHANGE_STATE, + WM_CLASS, // Session management WM_CLIENT_LEADER, diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 77c265fd09..cf7e99023a 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -369,4 +369,48 @@ QVariant QXcbIntegration::styleHint(QPlatformIntegration::StyleHint hint) const return QPlatformIntegration::styleHint(hint); } +static QString argv0BaseName() +{ + QString result; + const QStringList arguments = QCoreApplication::arguments(); + if (!arguments.isEmpty() && !arguments.front().isEmpty()) { + result = arguments.front(); + const int lastSlashPos = result.lastIndexOf(QLatin1Char('/')); + if (lastSlashPos != -1) + result.remove(0, lastSlashPos + 1); + } + return result; +} + +static const char resourceNameVar[] = "RESOURCE_NAME"; + +QByteArray QXcbIntegration::wmClass() const +{ + if (m_wmClass.isEmpty()) { + // Instance name according to ICCCM 4.1.2.5 + QString name; + if (name.isEmpty() && qEnvironmentVariableIsSet(resourceNameVar)) + name = QString::fromLocal8Bit(qgetenv(resourceNameVar)); + if (name.isEmpty()) + name = argv0BaseName(); + + // Note: QCoreApplication::applicationName() cannot be called from the QGuiApplication constructor, + // hence this delayed initialization. + QString className = QCoreApplication::applicationName(); + if (className.isEmpty()) { + className = argv0BaseName(); + if (!className.isEmpty() && className.at(0).isLower()) + className[0] = className.at(0).toUpper(); + } + + if (!name.isEmpty() && !className.isEmpty()) { + m_wmClass = name.toLocal8Bit(); + m_wmClass.append('\0'); + m_wmClass.append(className.toLocal8Bit()); + m_wmClass.append('\0'); + } + } + return m_wmClass; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index 7042628203..07b6b8d678 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -99,6 +99,8 @@ public: QXcbConnection *defaultConnection() const { return m_connections.first(); } + QByteArray wmClass() const; + private: QList m_connections; @@ -115,6 +117,8 @@ private: QScopedPointer m_services; friend class QXcbConnection; // access QPlatformIntegration::screenAdded() + + mutable QByteArray m_wmClass; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 3a19788316..3b818d78d8 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -379,6 +379,13 @@ void QXcbWindow::create() m_syncValue.hi = 0; m_syncValue.lo = 0; + const QByteArray wmClass = static_cast(QGuiApplicationPrivate::platformIntegration())->wmClass(); + if (!wmClass.isEmpty()) { + Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, + m_window, atom(QXcbAtom::WM_CLASS), + XCB_ATOM_STRING, 8, wmClass.size(), wmClass.constData())); + } + if (m_usingSyncProtocol) { m_syncCounter = xcb_generate_id(xcb_connection()); Q_XCB_CALL(xcb_sync_create_counter(xcb_connection(), m_syncCounter, m_syncValue)); -- cgit v1.2.3 From 5d6dbc66370cfd66a2613e8668415e2adc254b24 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 18 Jul 2013 11:22:17 +0200 Subject: fix endless loop in QProcess/Win drainOutputPipes Commit 568f82fba397e06a26b4fd40f074e4432d02d248 was incomplete. If drainOutputPipes detected some readyRead it wouldn't end the loop. Task-number: QTBUG-32354 Change-Id: I4e594f1e148abe9ef36c047a55eee1b22fd5064b Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess_win.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index bcc3fe0b0d..f16025752e 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -630,8 +630,9 @@ bool QProcessPrivate::drainOutputPipes() if (!stdoutReader && !stderrReader) return false; - bool readyReadEmitted = false; + bool someReadyReadEmitted = false; forever { + bool readyReadEmitted = false; bool readOperationActive = false; if (stdoutReader) { readyReadEmitted |= stdoutReader->waitForReadyRead(0); @@ -641,12 +642,13 @@ bool QProcessPrivate::drainOutputPipes() readyReadEmitted |= stderrReader->waitForReadyRead(0); readOperationActive |= stderrReader->isReadOperationActive(); } + someReadyReadEmitted |= readyReadEmitted; if (!readOperationActive || !readyReadEmitted) break; Sleep(100); } - return readyReadEmitted; + return someReadyReadEmitted; } bool QProcessPrivate::waitForReadyRead(int msecs) -- cgit v1.2.3 From 8609a6329798057e96306a967868e489965be7ec Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 16 Jul 2013 16:02:37 +0200 Subject: Add manual test for UNC paths Change-Id: I25949b6fb04dc4bb976f4daea96cbab2897e15af Reviewed-by: Friedemann Kleint --- tests/manual/manual.pro | 3 +- tests/manual/unc/main.cpp | 89 ++++++++++++++++++++++++++++++++++++++++++++++ tests/manual/unc/test.html | 10 ++++++ tests/manual/unc/unc.pro | 6 ++++ 4 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 tests/manual/unc/main.cpp create mode 100644 tests/manual/unc/test.html create mode 100644 tests/manual/unc/unc.pro diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 8d99d17e41..2fa05f65e0 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -40,7 +40,8 @@ widgetgrab \ xembed-raster \ xembed-widgets \ dialogs \ -windowtransparency +windowtransparency \ +unc !contains(QT_CONFIG, openssl):!contains(QT_CONFIG, openssl-linked):SUBDIRS -= qssloptions diff --git a/tests/manual/unc/main.cpp b/tests/manual/unc/main.cpp new file mode 100644 index 0000000000..51ceb87e28 --- /dev/null +++ b/tests/manual/unc/main.cpp @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +class Dialog : public QDialog +{ +public: + Dialog() + { + QString localFile("test.html"); + // server/shared/test.html should be replaced to point to a real file + QString UNCPath("file://server/shared/test.html"); + + QVBoxLayout* vBox = new QVBoxLayout(); + vBox->addWidget(new QLabel("Clicking on the links should open their" + " contents in the default browser !")); + vBox->addWidget(createLink(localFile)); + vBox->addWidget(new QLabel("The following link must point to " + "a file in a shared folder on a network !")); + vBox->addWidget(createLink(UNCPath)); + setLayout(vBox); + } + +protected: + QLabel* createLink(QString path) + { + QLabel *label = new QLabel(); + label->setTextFormat(Qt::RichText); + label->setTextInteractionFlags(Qt::TextBrowserInteraction); + label->setOpenExternalLinks(true); + + QString link("" + path + ""); + + label->setText(link); + return label; + } +}; + +int main(int argc, char* argv[]) +{ + QApplication app(argc, argv); + + Dialog dlg; + dlg.show(); + + return app.exec(); +} diff --git a/tests/manual/unc/test.html b/tests/manual/unc/test.html new file mode 100644 index 0000000000..2e84ad5385 --- /dev/null +++ b/tests/manual/unc/test.html @@ -0,0 +1,10 @@ + + + + A Small Hello + + + +

This is first html document.

+ + diff --git a/tests/manual/unc/unc.pro b/tests/manual/unc/unc.pro new file mode 100644 index 0000000000..977bd0c177 --- /dev/null +++ b/tests/manual/unc/unc.pro @@ -0,0 +1,6 @@ +QT += core gui +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TEMPLATE = app + +SOURCES += main.cpp -- cgit v1.2.3 From 61fbdc00fb03eba82309860487954d87460852a3 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 18 Jul 2013 14:42:14 +0200 Subject: Fix compilation of run-time-resolved SSL on Android We need the same code for both the no-sdk and the sdk case for the OpenSSL code, since this is not covered by a system library, but by an external dependency in both cases. Task-number: QTBUG-32130 Change-Id: I976835556fcb0e6c32cfb3da4dd585e45490061b Reviewed-by: Thiago Macieira --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 812703b21a..d2a349455e 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -67,7 +67,7 @@ #if defined(Q_OS_UNIX) #include #endif -#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID_NO_SDK) +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) #include #endif @@ -387,7 +387,7 @@ static bool libGreaterThan(const QString &lhs, const QString &rhs) return true; } -#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID_NO_SDK) +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) static int dlIterateCallback(struct dl_phdr_info *info, size_t size, void *data) { if (size < sizeof (info->dlpi_addr) + sizeof (info->dlpi_name)) @@ -418,7 +418,7 @@ static QStringList libraryPathList() paths << QLatin1String("/lib64") << QLatin1String("/usr/lib64") << QLatin1String("/usr/local/lib64"); paths << QLatin1String("/lib32") << QLatin1String("/usr/lib32") << QLatin1String("/usr/local/lib32"); -#if defined(Q_OS_ANDROID_NO_SDK) +#if defined(Q_OS_ANDROID) paths << QLatin1String("/system/lib"); #elif defined(Q_OS_LINUX) // discover paths of already loaded libraries -- cgit v1.2.3 From 87db2fdef30643e734501bc725f3b731c1faab7c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 19 Jul 2013 08:43:53 +0200 Subject: Use the compilers used by Qt for the CMake tests. Task-number: QTQAINFRA-609 Change-Id: I32ad70a4b31baf1815c2c08ac16e35e78052e569 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- mkspecs/features/ctest_testcase_common.prf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf index 2f66909bb4..118eed1e94 100644 --- a/mkspecs/features/ctest_testcase_common.prf +++ b/mkspecs/features/ctest_testcase_common.prf @@ -83,6 +83,8 @@ CMAKE_MODULES_UNDER_TEST = $$join(CMAKE_MODULES_UNDER_TEST, ;) check.commands = \ $(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \ cmake $$CMAKE_TEST_LOCATION $$CMAKE_GENERATOR \ + -DCMAKE_C_COMPILER=$$QMAKE_CC \ + -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \ -DCMAKE_VERBOSE_MAKEFILE=1 \ $$CMAKE_MODULE_DEFINES \ $$CMAKE_GL_DEFINES \ -- cgit v1.2.3 From 4a7e37b0a3741f11dad3cca435badaaf42e59741 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 7 Jul 2013 10:22:15 -0700 Subject: Add a test for QLocalSocket::open This should have been done in the commit that introduced open (953255abab0f99afe7559da93ba18a876805d78d), but was missing. Change-Id: I1c2de4ad5fa42aa5b90646e7d4d7d1b1570a0f87 Reviewed-by: Giuseppe D'Angelo --- .../socket/qlocalsocket/tst_qlocalsocket.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 159f276c77..70fb7dc9fe 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -78,6 +78,8 @@ private slots: void listenAndConnect_data(); void listenAndConnect(); + void connectWithOpen(); + void sendData_data(); void sendData(); @@ -452,6 +454,27 @@ void tst_QLocalSocket::listenAndConnect() QCOMPARE(spyNewConnection.count(), (canListen ? connections : 0)); } +void tst_QLocalSocket::connectWithOpen() +{ + LocalServer server; + QVERIFY(server.listen("tst_qlocalsocket")); + + LocalSocket socket; + socket.setServerName("tst_qlocalsocket"); + QVERIFY(socket.open()); + + bool timedOut = true; + QVERIFY(server.waitForNewConnection(3000, &timedOut)); + +#if defined(QT_LOCALSOCKET_TCP) + QTest::qWait(250); +#endif + QVERIFY(!timedOut); + + socket.close(); + server.close(); +} + void tst_QLocalSocket::sendData_data() { listenAndConnect_data(); -- cgit v1.2.3 From 674e79416fefe7b5acf2a8c18d3c91d8feddcc18 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 7 Jul 2013 10:12:24 -0700 Subject: Fix incomplete override of QIODevice::open in QProcess and QLocalSocket The rule for a new override is that it must still work if the old implementation is called. The catch is that any class that derives from QProcess and isn't recompiled will still have QIODevice::open in its virtual table. That is equivalent to overriding open() and calling QIODevice::open() (like the tests). In Qt 5.0, QProcess::start() called QIODevice::open directly, not the virtual open(), so there's no expectation that a user-overridden open() be called. With that in mind, simply fix QProcess::start to not call the virtual open at all. Similarly with QLocalSocket, the calls to open were always non-virtual. Task-number: QTBUG-32284 Change-Id: I88925f0ba08bc23c849658b54582744997e69a4c Reviewed-by: Giuseppe D'Angelo --- src/corelib/io/qprocess.cpp | 59 ++++++++++++++-------- src/corelib/io/qprocess_p.h | 1 + src/network/socket/qlocalsocket.cpp | 37 +++++++------- src/network/socket/qlocalsocket_tcp.cpp | 9 ++-- src/network/socket/qlocalsocket_unix.cpp | 12 ++--- src/network/socket/qlocalsocket_win.cpp | 9 ++-- tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 20 ++++++++ .../socket/qlocalsocket/tst_qlocalsocket.cpp | 28 ++++++++++ 8 files changed, 120 insertions(+), 55 deletions(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index b1861d8038..d8cd1f5fae 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1959,7 +1959,7 @@ void QProcess::start(const QString &program, const QStringList &arguments, OpenM d->program = program; d->arguments = arguments; - open(mode); + d->start(mode); } /*! @@ -1975,7 +1975,17 @@ void QProcess::start(const QString &program, const QStringList &arguments, OpenM */ void QProcess::start(OpenMode mode) { - open(mode); + Q_D(QProcess); + if (d->processState != NotRunning) { + qWarning("QProcess::start: Process is already running"); + return; + } + if (d->program.isEmpty()) { + qWarning("QProcess::start: program not set"); + return; + } + + d->start(mode); } /*! @@ -2008,34 +2018,39 @@ bool QProcess::open(OpenMode mode) return false; } + d->start(mode); + return true; +} + +void QProcessPrivate::start(QIODevice::OpenMode mode) +{ + Q_Q(QProcess); #if defined QPROCESS_DEBUG qDebug() << "QProcess::start(" << program << ',' << arguments << ',' << mode << ')'; #endif - d->outputReadBuffer.clear(); - d->errorReadBuffer.clear(); + outputReadBuffer.clear(); + errorReadBuffer.clear(); - if (d->stdinChannel.type != QProcessPrivate::Channel::Normal) - mode &= ~WriteOnly; // not open for writing - if (d->stdoutChannel.type != QProcessPrivate::Channel::Normal && - (d->stderrChannel.type != QProcessPrivate::Channel::Normal || - d->processChannelMode == MergedChannels)) - mode &= ~ReadOnly; // not open for reading + if (stdinChannel.type != QProcessPrivate::Channel::Normal) + mode &= ~QIODevice::WriteOnly; // not open for writing + if (stdoutChannel.type != QProcessPrivate::Channel::Normal && + (stderrChannel.type != QProcessPrivate::Channel::Normal || + processChannelMode == QProcess::MergedChannels)) + mode &= ~QIODevice::ReadOnly; // not open for reading if (mode == 0) - mode = Unbuffered; - QIODevice::open(mode); + mode = QIODevice::Unbuffered; + q->QIODevice::open(mode); - d->stdinChannel.closed = false; - d->stdoutChannel.closed = false; - d->stderrChannel.closed = false; + stdinChannel.closed = false; + stdoutChannel.closed = false; + stderrChannel.closed = false; - d->exitCode = 0; - d->exitStatus = NormalExit; - d->processError = QProcess::UnknownError; - d->errorString.clear(); - d->startProcess(); - - return true; + exitCode = 0; + exitStatus = QProcess::NormalExit; + processError = QProcess::UnknownError; + errorString.clear(); + startProcess(); } diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h index 2a2cc9fb84..e96cb42f94 100644 --- a/src/corelib/io/qprocess_p.h +++ b/src/corelib/io/qprocess_p.h @@ -346,6 +346,7 @@ public: QWinEventNotifier *processFinishedNotifier; #endif + void start(QIODevice::OpenMode mode); void startProcess(); #if defined(Q_OS_UNIX) && !defined(Q_OS_QNX) void execChild(const char *workingDirectory, char **path, char **argv, char **envp); diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp index 1ce6568364..f516b932e7 100644 --- a/src/network/socket/qlocalsocket.cpp +++ b/src/network/socket/qlocalsocket.cpp @@ -70,6 +70,22 @@ QT_BEGIN_NAMESPACE \sa QLocalServer */ +/*! + \fn void QLocalSocket::connectToServer(OpenMode openMode) + \since 5.1 + + Attempts to make a connection to serverName(). + setServerName() must be called before you open the connection. + Alternatively you can use connectToServer(const QString &name, OpenMode openMode); + + The socket is opened in the given \a openMode and first enters ConnectingState. + If a connection is established, QLocalSocket enters ConnectedState and emits connected(). + + After calling this function, the socket can emit error() to signal that an error occurred. + + \sa state(), serverName(), waitForConnected() +*/ + /*! \fn void QLocalSocket::open(OpenMode openMode) @@ -352,23 +368,10 @@ QLocalSocket::~QLocalSocket() #endif } -/*! - \since 5.1 - - Attempts to make a connection to serverName(). - setServerName() must be called before you open the connection. - Alternatively you can use connectToServer(const QString &name, OpenMode openMode); - - The socket is opened in the given \a openMode and first enters ConnectingState. - If a connection is established, QLocalSocket enters ConnectedState and emits connected(). - - After calling this function, the socket can emit error() to signal that an error occurred. - - \sa state(), serverName(), waitForConnected() -*/ -void QLocalSocket::connectToServer(OpenMode openMode) +bool QLocalSocket::open(OpenMode openMode) { - open(openMode); + connectToServer(openMode); + return isOpen(); } /*! \overload @@ -385,7 +388,7 @@ void QLocalSocket::connectToServer(OpenMode openMode) void QLocalSocket::connectToServer(const QString &name, OpenMode openMode) { setServerName(name); - open(openMode); + connectToServer(openMode); } /*! diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp index 31aaa6e1c5..1a61a54a76 100644 --- a/src/network/socket/qlocalsocket_tcp.cpp +++ b/src/network/socket/qlocalsocket_tcp.cpp @@ -214,13 +214,13 @@ void QLocalSocketPrivate::errorOccurred(QLocalSocket::LocalSocketError error, co q->emit stateChanged(state); } -bool QLocalSocket::open(OpenMode openMode) +void QLocalSocket::connectToServer(OpenMode openMode) { Q_D(QLocalSocket); if (state() == ConnectedState || state() == ConnectingState) { setErrorString(tr("Trying to connect while connection is in progress")); emit error(QLocalSocket::OperationError); - return false; + return; } d->errorString.clear(); @@ -230,7 +230,7 @@ bool QLocalSocket::open(OpenMode openMode) if (d->serverName.isEmpty()) { d->errorOccurred(ServerNotFoundError, QLatin1String("QLocalSocket::connectToServer")); - return false; + return; } const QLatin1String prefix("QLocalServer/"); @@ -245,11 +245,10 @@ bool QLocalSocket::open(OpenMode openMode) if (!ok) { d->errorOccurred(ServerNotFoundError, QLatin1String("QLocalSocket::connectToServer")); - return false; + return; } d->tcpSocket->connectToHost(QHostAddress::LocalHost, port, openMode); QIODevice::open(openMode); - return true; } bool QLocalSocket::setSocketDescriptor(qintptr socketDescriptor, diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 67182e57b0..31780a27ec 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -221,14 +221,14 @@ void QLocalSocketPrivate::errorOccurred(QLocalSocket::LocalSocketError error, co q->emit stateChanged(state); } -bool QLocalSocket::open(OpenMode openMode) +void QLocalSocket::connectToServer(OpenMode openMode) { Q_D(QLocalSocket); if (state() == ConnectedState || state() == ConnectingState) { QString errorString = d->generateErrorString(QLocalSocket::OperationError, QLatin1String("QLocalSocket::connectToserver")); setErrorString(errorString); emit error(QLocalSocket::OperationError); - return false; + return; } d->errorString.clear(); @@ -239,14 +239,14 @@ bool QLocalSocket::open(OpenMode openMode) if (d->serverName.isEmpty()) { d->errorOccurred(ServerNotFoundError, QLatin1String("QLocalSocket::connectToServer")); - return false; + return; } // create the socket if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))) { d->errorOccurred(UnsupportedSocketOperationError, QLatin1String("QLocalSocket::connectToServer")); - return false; + return; } // set non blocking so we can try to connect and it won't wait int flags = fcntl(d->connectingSocket, F_GETFL, 0); @@ -254,14 +254,14 @@ bool QLocalSocket::open(OpenMode openMode) || -1 == (fcntl(d->connectingSocket, F_SETFL, flags | O_NONBLOCK))) { d->errorOccurred(UnknownSocketError, QLatin1String("QLocalSocket::connectToServer")); - return false; + return; } // _q_connectToSocket does the actual connecting d->connectingName = d->serverName; d->connectingOpenMode = openMode; d->_q_connectToSocket(); - return true; + return; } /*! diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index cdfa18377d..c907ce6ada 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -128,13 +128,13 @@ void QLocalSocketPrivate::destroyPipeHandles() } } -bool QLocalSocket::open(OpenMode openMode) +void QLocalSocket::connectToServer(OpenMode openMode) { Q_D(QLocalSocket); if (state() == ConnectedState || state() == ConnectingState) { setErrorString(tr("Trying to connect while connection is in progress")); emit error(QLocalSocket::OperationError); - return false; + return; } d->error = QLocalSocket::UnknownSocketError; @@ -147,7 +147,7 @@ bool QLocalSocket::open(OpenMode openMode) d->state = UnconnectedState; emit error(d->error); emit stateChanged(d->state); - return false; + return; } QString pipePath = QLatin1String("\\\\.\\pipe\\"); @@ -184,7 +184,7 @@ bool QLocalSocket::open(OpenMode openMode) if (localSocket == INVALID_HANDLE_VALUE) { d->setErrorString(QLatin1String("QLocalSocket::connectToServer")); d->fullServerName = QString(); - return false; + return; } // we have a valid handle @@ -192,7 +192,6 @@ bool QLocalSocket::open(OpenMode openMode) d->handle = localSocket; emit connected(); } - return true; } // This is reading from the buffer diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 3862553a4b..f2759dfd6e 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -82,6 +82,7 @@ private slots: void constructing(); void simpleStart(); void startWithOpen(); + void startWithOldOpen(); void execute(); void startDetached(); void crashTest(); @@ -296,6 +297,25 @@ void tst_QProcess::startWithOpen() QVERIFY(p.waitForFinished(5000)); } +//----------------------------------------------------------------------------- +void tst_QProcess::startWithOldOpen() +{ + // similar to the above, but we start with start() actually + // while open() is overridden to call QIODevice::open(). + // This tests the BC requirement that "it works with the old implementation" + class OverriddenOpen : public QProcess + { + public: + virtual bool open(OpenMode mode) Q_DECL_OVERRIDE + { return QIODevice::open(mode); } + }; + + OverriddenOpen p; + p.start("testProcessNormal/testProcessNormal"); + QVERIFY(p.waitForStarted(5000)); + QVERIFY(p.waitForFinished(5000)); +} + //----------------------------------------------------------------------------- void tst_QProcess::execute() { diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 70fb7dc9fe..7065f5be36 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -79,6 +79,7 @@ private slots: void listenAndConnect(); void connectWithOpen(); + void connectWithOldOpen(); void sendData_data(); void sendData(); @@ -475,6 +476,33 @@ void tst_QLocalSocket::connectWithOpen() server.close(); } +void tst_QLocalSocket::connectWithOldOpen() +{ + class OverriddenOpen : public LocalSocket + { + public: + virtual bool open(OpenMode mode) Q_DECL_OVERRIDE + { return QIODevice::open(mode); } + }; + + LocalServer server; + QCOMPARE(server.listen("tst_qlocalsocket"), true); + + OverriddenOpen socket; + socket.connectToServer("tst_qlocalsocket"); + + bool timedOut = true; + QVERIFY(server.waitForNewConnection(3000, &timedOut)); + +#if defined(QT_LOCALSOCKET_TCP) + QTest::qWait(250); +#endif + QVERIFY(!timedOut); + + socket.close(); + server.close(); +} + void tst_QLocalSocket::sendData_data() { listenAndConnect_data(); -- cgit v1.2.3 From bfc5bb09c4b79c17e1d846f6c46611d83cc7de4a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 7 Jul 2013 16:00:43 -0700 Subject: Ignore or suppress warning and debug messages in tst_QLocalSocket The one in tst_QLocalSocket::writeToClientAndDisconnect just needed proper ordering: that's what waitForDisconnect is for. At the same time, we need to make sure we get the same message from all three implementations of QLocalSocket::waitForDisconnect (and without the useless space at the end). Change-Id: I21364263cf908df022df814a6a39fcb5783e84e6 Reviewed-by: Shane Kearns --- src/network/socket/qlocalsocket_tcp.cpp | 2 +- src/network/socket/qlocalsocket_unix.cpp | 2 +- src/network/socket/qlocalsocket_win.cpp | 4 +++- tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 9 ++++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp index 1a61a54a76..0bf0cc0654 100644 --- a/src/network/socket/qlocalsocket_tcp.cpp +++ b/src/network/socket/qlocalsocket_tcp.cpp @@ -424,7 +424,7 @@ bool QLocalSocket::waitForDisconnected(int msecs) { Q_D(QLocalSocket); if (state() == UnconnectedState) { - qWarning() << "QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState"; + qWarning("QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState"); return false; } return (d->tcpSocket->waitForDisconnected(msecs)); diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 31780a27ec..4af584b345 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -560,7 +560,7 @@ bool QLocalSocket::waitForDisconnected(int msecs) { Q_D(QLocalSocket); if (state() == UnconnectedState) { - qWarning() << "QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState"; + qWarning("QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState"); return false; } return (d->unixSocket.waitForDisconnected(msecs)); diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp index c907ce6ada..96c6c0f6ea 100644 --- a/src/network/socket/qlocalsocket_win.cpp +++ b/src/network/socket/qlocalsocket_win.cpp @@ -378,8 +378,10 @@ bool QLocalSocket::waitForConnected(int msecs) bool QLocalSocket::waitForDisconnected(int msecs) { Q_D(QLocalSocket); - if (state() == UnconnectedState) + if (state() == UnconnectedState) { + qWarning("QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState"); return false; + } if (!openMode().testFlag(QIODevice::ReadOnly)) { qWarning("QLocalSocket::waitForDisconnected isn't supported for write only pipes."); return false; diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 7065f5be36..9887acf7dd 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -270,6 +270,7 @@ void tst_QLocalSocket::socket_basic() //QCOMPARE(socket.socketDescriptor(), (qintptr)-1); QCOMPARE(socket.state(), QLocalSocket::UnconnectedState); QCOMPARE(socket.waitForConnected(0), false); + QTest::ignoreMessage(QtWarningMsg, "QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState"); QCOMPARE(socket.waitForDisconnected(0), false); QCOMPARE(socket.waitForReadyRead(0), false); @@ -313,6 +314,7 @@ void tst_QLocalSocket::listen() QVERIFY(server.errorString().isEmpty()); QCOMPARE(server.serverError(), QAbstractSocket::UnknownSocketError); // already isListening + QTest::ignoreMessage(QtWarningMsg, "QLocalServer::listen() called when already listening"); QVERIFY(!server.listen(name)); } else { QVERIFY(!server.errorString().isEmpty()); @@ -1015,15 +1017,16 @@ void tst_QLocalSocket::writeToClientAndDisconnect() clientSocket->close(); server.close(); - QTRY_COMPARE(readChannelFinishedSpy.count(), 1); - QCOMPARE(client.read(buffer, sizeof(buffer)), (qint64)sizeof(buffer)); client.waitForDisconnected(); + QCOMPARE(readChannelFinishedSpy.count(), 1); + QCOMPARE(client.read(buffer, sizeof(buffer)), (qint64)sizeof(buffer)); QCOMPARE(client.state(), QLocalSocket::UnconnectedState); } void tst_QLocalSocket::debug() { // Make sure this compiles + QTest::ignoreMessage(QtDebugMsg, "QLocalSocket::ConnectionRefusedError QLocalSocket::UnconnectedState "); qDebug() << QLocalSocket::ConnectionRefusedError << QLocalSocket::UnconnectedState; } @@ -1155,7 +1158,7 @@ void tst_QLocalSocket::verifyListenWithDescriptor() QFETCH(bool, abstract); QFETCH(bool, bound); - qDebug() << "socket" << path << abstract; +// qDebug() << "socket" << path << abstract; int listenSocket; -- cgit v1.2.3 From f5b3cbb8f78c351eb1efbdde169cfe99c51f9c3e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 28 Jun 2013 17:23:41 -0700 Subject: Fix warning about using QString's const char* constructor on Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I20ca50fdcdcfb075ad317247f147e4eb007a0c44 Reviewed-by: Tor Arne Vestbø --- src/corelib/plugin/qfactoryloader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index c617325e9e..3c8e00519b 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -137,7 +137,8 @@ void QFactoryLoader::update() // // ### FIXME find a proper solution // - const bool isLoadingDebugAndReleaseCocoa = plugins.contains("libqcocoa_debug.dylib") && plugins.contains("libqcocoa.dylib"); + const bool isLoadingDebugAndReleaseCocoa = plugins.contains(QStringLiteral("libqcocoa_debug.dylib")) + && plugins.contains(QStringLiteral("libqcocoa.dylib")); #endif for (int j = 0; j < plugins.count(); ++j) { QString fileName = QDir::cleanPath(path + QLatin1Char('/') + plugins.at(j)); -- cgit v1.2.3 From db5631484b91156be5b1a348dc224e8b4a8f5380 Mon Sep 17 00:00:00 2001 From: Teemu Kaukoranta Date: Tue, 28 May 2013 13:57:44 +0300 Subject: Changed digia contact details to */legal, updated licenses Scripts are available in internal mkdist repo. Added license tags, updated licenses and copyrights/contacts Change-Id: Ibc734275f3000987eaa4f5c57f19d4e1fda2c479 Reviewed-by: Sergio Ahumada --- examples/webkit/webkit-guide/_image_assets.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/anim_accord.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/anim_demo-rotate.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/anim_demo-scale.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/anim_demo-skew.htm | 74 +++++++++++----------- examples/webkit/webkit-guide/anim_gallery.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/anim_panel.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/anim_pulse.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/anim_skew.htm | 74 +++++++++++----------- examples/webkit/webkit-guide/anim_slide1.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/anim_slide2.htm | 74 +++++++++++----------- examples/webkit/webkit-guide/anim_slide3.htm | 74 +++++++++++----------- examples/webkit/webkit-guide/anim_tabbedSkew.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_backgrounds.htm | 74 +++++++++++----------- examples/webkit/webkit-guide/css3_border-img.htm | 74 +++++++++++----------- examples/webkit/webkit-guide/css3_grad-radial.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_gradientBack.htm | 74 +++++++++++----------- .../webkit/webkit-guide/css3_gradientBackStop.htm | 73 ++++++++++----------- .../webkit/webkit-guide/css3_gradientButton.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_mask-grad.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_mask-img.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_multicol.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_reflect.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_scroll.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_sel-nth.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_shadow.htm | 73 ++++++++++----------- .../webkit/webkit-guide/css3_text-overflow.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_text-shadow.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/css3_text-stroke.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/form_tapper.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/form_toggler.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/layout_link-fmt.htm | 73 ++++++++++----------- .../webkit/webkit-guide/layout_tbl-keyhole.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/mob_condjs.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/mob_layout.htm | 74 +++++++++++----------- examples/webkit/webkit-guide/mob_mediaquery.htm | 73 ++++++++++----------- examples/webkit/webkit-guide/storage.htm | 73 ++++++++++----------- qmake/generators/projectgenerator.cpp | 2 +- qmake/generators/projectgenerator.h | 2 +- src/corelib/statemachine/qsignaleventgenerator_p.h | 2 +- src/dbus/qdbusxmlgenerator.cpp | 2 +- src/tools/moc/generator.cpp | 2 +- src/tools/moc/generator.h | 2 +- src/tools/qdoc/ditaxmlgenerator.cpp | 2 +- src/tools/qdoc/ditaxmlgenerator.h | 2 +- src/tools/qdoc/generator.cpp | 2 +- src/tools/qdoc/generator.h | 2 +- src/tools/qdoc/htmlgenerator.cpp | 2 +- src/tools/qdoc/htmlgenerator.h | 2 +- 49 files changed, 1381 insertions(+), 1352 deletions(-) diff --git a/examples/webkit/webkit-guide/_image_assets.htm b/examples/webkit/webkit-guide/_image_assets.htm index f8ff8c6870..c9b7a49039 100644 --- a/examples/webkit/webkit-guide/_image_assets.htm +++ b/examples/webkit/webkit-guide/_image_assets.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/anim_accord.htm b/examples/webkit/webkit-guide/anim_accord.htm index 139f9f2c1a..1940632b03 100644 --- a/examples/webkit/webkit-guide/anim_accord.htm +++ b/examples/webkit/webkit-guide/anim_accord.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/anim_demo-rotate.htm b/examples/webkit/webkit-guide/anim_demo-rotate.htm index 35fa65385a..41d89d626b 100644 --- a/examples/webkit/webkit-guide/anim_demo-rotate.htm +++ b/examples/webkit/webkit-guide/anim_demo-rotate.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/anim_demo-scale.htm b/examples/webkit/webkit-guide/anim_demo-scale.htm index 4d3c173299..59e50405ae 100644 --- a/examples/webkit/webkit-guide/anim_demo-scale.htm +++ b/examples/webkit/webkit-guide/anim_demo-scale.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/anim_demo-skew.htm b/examples/webkit/webkit-guide/anim_demo-skew.htm index 0b7a6b6c04..81ee79062e 100644 --- a/examples/webkit/webkit-guide/anim_demo-skew.htm +++ b/examples/webkit/webkit-guide/anim_demo-skew.htm @@ -1,42 +1,42 @@ - diff --git a/examples/webkit/webkit-guide/anim_gallery.htm b/examples/webkit/webkit-guide/anim_gallery.htm index 75a2ee0927..0edbfff3c7 100644 --- a/examples/webkit/webkit-guide/anim_gallery.htm +++ b/examples/webkit/webkit-guide/anim_gallery.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/anim_panel.htm b/examples/webkit/webkit-guide/anim_panel.htm index f79c95a214..5cb442aab8 100644 --- a/examples/webkit/webkit-guide/anim_panel.htm +++ b/examples/webkit/webkit-guide/anim_panel.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/anim_pulse.htm b/examples/webkit/webkit-guide/anim_pulse.htm index 57e7cf5918..decd44183f 100644 --- a/examples/webkit/webkit-guide/anim_pulse.htm +++ b/examples/webkit/webkit-guide/anim_pulse.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/anim_skew.htm b/examples/webkit/webkit-guide/anim_skew.htm index 458155b827..abd1c2922f 100644 --- a/examples/webkit/webkit-guide/anim_skew.htm +++ b/examples/webkit/webkit-guide/anim_skew.htm @@ -1,42 +1,42 @@ - diff --git a/examples/webkit/webkit-guide/anim_slide1.htm b/examples/webkit/webkit-guide/anim_slide1.htm index 0e5ba71706..dd4a551109 100644 --- a/examples/webkit/webkit-guide/anim_slide1.htm +++ b/examples/webkit/webkit-guide/anim_slide1.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/anim_slide2.htm b/examples/webkit/webkit-guide/anim_slide2.htm index 0fad61a938..25ca25c785 100644 --- a/examples/webkit/webkit-guide/anim_slide2.htm +++ b/examples/webkit/webkit-guide/anim_slide2.htm @@ -1,42 +1,42 @@ - diff --git a/examples/webkit/webkit-guide/anim_slide3.htm b/examples/webkit/webkit-guide/anim_slide3.htm index b7aecfd6b8..1d612aa16d 100644 --- a/examples/webkit/webkit-guide/anim_slide3.htm +++ b/examples/webkit/webkit-guide/anim_slide3.htm @@ -1,42 +1,42 @@ - diff --git a/examples/webkit/webkit-guide/anim_tabbedSkew.htm b/examples/webkit/webkit-guide/anim_tabbedSkew.htm index 56565848cc..1000103dd6 100644 --- a/examples/webkit/webkit-guide/anim_tabbedSkew.htm +++ b/examples/webkit/webkit-guide/anim_tabbedSkew.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_backgrounds.htm b/examples/webkit/webkit-guide/css3_backgrounds.htm index 4b7ea24691..89cb096bb7 100644 --- a/examples/webkit/webkit-guide/css3_backgrounds.htm +++ b/examples/webkit/webkit-guide/css3_backgrounds.htm @@ -1,42 +1,42 @@ - diff --git a/examples/webkit/webkit-guide/css3_border-img.htm b/examples/webkit/webkit-guide/css3_border-img.htm index 8b3d81753c..ac255bed91 100644 --- a/examples/webkit/webkit-guide/css3_border-img.htm +++ b/examples/webkit/webkit-guide/css3_border-img.htm @@ -1,42 +1,42 @@ - diff --git a/examples/webkit/webkit-guide/css3_grad-radial.htm b/examples/webkit/webkit-guide/css3_grad-radial.htm index ba3be544e8..bf35a2a541 100644 --- a/examples/webkit/webkit-guide/css3_grad-radial.htm +++ b/examples/webkit/webkit-guide/css3_grad-radial.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_gradientBack.htm b/examples/webkit/webkit-guide/css3_gradientBack.htm index 760a698eb9..7364590186 100644 --- a/examples/webkit/webkit-guide/css3_gradientBack.htm +++ b/examples/webkit/webkit-guide/css3_gradientBack.htm @@ -1,42 +1,42 @@ - diff --git a/examples/webkit/webkit-guide/css3_gradientBackStop.htm b/examples/webkit/webkit-guide/css3_gradientBackStop.htm index e9456dbc8f..4f6974a158 100644 --- a/examples/webkit/webkit-guide/css3_gradientBackStop.htm +++ b/examples/webkit/webkit-guide/css3_gradientBackStop.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_gradientButton.htm b/examples/webkit/webkit-guide/css3_gradientButton.htm index 86245f4884..f34ba37ad5 100644 --- a/examples/webkit/webkit-guide/css3_gradientButton.htm +++ b/examples/webkit/webkit-guide/css3_gradientButton.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_mask-grad.htm b/examples/webkit/webkit-guide/css3_mask-grad.htm index db6894b394..d71fb4f1fd 100644 --- a/examples/webkit/webkit-guide/css3_mask-grad.htm +++ b/examples/webkit/webkit-guide/css3_mask-grad.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_mask-img.htm b/examples/webkit/webkit-guide/css3_mask-img.htm index df089dae31..b109021a88 100644 --- a/examples/webkit/webkit-guide/css3_mask-img.htm +++ b/examples/webkit/webkit-guide/css3_mask-img.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_multicol.htm b/examples/webkit/webkit-guide/css3_multicol.htm index 5120261568..d721f202b8 100644 --- a/examples/webkit/webkit-guide/css3_multicol.htm +++ b/examples/webkit/webkit-guide/css3_multicol.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_reflect.htm b/examples/webkit/webkit-guide/css3_reflect.htm index 106e5dd6d9..ffeba18e72 100644 --- a/examples/webkit/webkit-guide/css3_reflect.htm +++ b/examples/webkit/webkit-guide/css3_reflect.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_scroll.htm b/examples/webkit/webkit-guide/css3_scroll.htm index cecc6350a9..7e1ee8e660 100644 --- a/examples/webkit/webkit-guide/css3_scroll.htm +++ b/examples/webkit/webkit-guide/css3_scroll.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_sel-nth.htm b/examples/webkit/webkit-guide/css3_sel-nth.htm index a65f1075e6..32c5425ac9 100644 --- a/examples/webkit/webkit-guide/css3_sel-nth.htm +++ b/examples/webkit/webkit-guide/css3_sel-nth.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_shadow.htm b/examples/webkit/webkit-guide/css3_shadow.htm index 0af8289ccd..995ea5a34c 100644 --- a/examples/webkit/webkit-guide/css3_shadow.htm +++ b/examples/webkit/webkit-guide/css3_shadow.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_text-overflow.htm b/examples/webkit/webkit-guide/css3_text-overflow.htm index 0d119710cc..a062e99181 100644 --- a/examples/webkit/webkit-guide/css3_text-overflow.htm +++ b/examples/webkit/webkit-guide/css3_text-overflow.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_text-shadow.htm b/examples/webkit/webkit-guide/css3_text-shadow.htm index 35cae2ce31..9527c70811 100644 --- a/examples/webkit/webkit-guide/css3_text-shadow.htm +++ b/examples/webkit/webkit-guide/css3_text-shadow.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/css3_text-stroke.htm b/examples/webkit/webkit-guide/css3_text-stroke.htm index 170f423b10..73e06117ba 100644 --- a/examples/webkit/webkit-guide/css3_text-stroke.htm +++ b/examples/webkit/webkit-guide/css3_text-stroke.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/form_tapper.htm b/examples/webkit/webkit-guide/form_tapper.htm index 8490970857..73b88c336d 100644 --- a/examples/webkit/webkit-guide/form_tapper.htm +++ b/examples/webkit/webkit-guide/form_tapper.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/form_toggler.htm b/examples/webkit/webkit-guide/form_toggler.htm index 31218ed07e..8674a26728 100644 --- a/examples/webkit/webkit-guide/form_toggler.htm +++ b/examples/webkit/webkit-guide/form_toggler.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/layout_link-fmt.htm b/examples/webkit/webkit-guide/layout_link-fmt.htm index dcb9e23dea..1f927bf8f5 100644 --- a/examples/webkit/webkit-guide/layout_link-fmt.htm +++ b/examples/webkit/webkit-guide/layout_link-fmt.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm b/examples/webkit/webkit-guide/layout_tbl-keyhole.htm index d313da990e..5daeb36ce7 100644 --- a/examples/webkit/webkit-guide/layout_tbl-keyhole.htm +++ b/examples/webkit/webkit-guide/layout_tbl-keyhole.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/mob_condjs.htm b/examples/webkit/webkit-guide/mob_condjs.htm index ddaac12e88..89d3fa50d8 100644 --- a/examples/webkit/webkit-guide/mob_condjs.htm +++ b/examples/webkit/webkit-guide/mob_condjs.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/mob_layout.htm b/examples/webkit/webkit-guide/mob_layout.htm index 72199f7a05..768374983d 100644 --- a/examples/webkit/webkit-guide/mob_layout.htm +++ b/examples/webkit/webkit-guide/mob_layout.htm @@ -1,41 +1,41 @@ diff --git a/examples/webkit/webkit-guide/mob_mediaquery.htm b/examples/webkit/webkit-guide/mob_mediaquery.htm index 9c8397a4fb..79436399f1 100644 --- a/examples/webkit/webkit-guide/mob_mediaquery.htm +++ b/examples/webkit/webkit-guide/mob_mediaquery.htm @@ -1,40 +1,41 @@ diff --git a/examples/webkit/webkit-guide/storage.htm b/examples/webkit/webkit-guide/storage.htm index 6168aec6d1..9070eade58 100644 --- a/examples/webkit/webkit-guide/storage.htm +++ b/examples/webkit/webkit-guide/storage.htm @@ -1,40 +1,41 @@ diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp index 54208de27e..3cd5a22a33 100644 --- a/qmake/generators/projectgenerator.cpp +++ b/qmake/generators/projectgenerator.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the qmake application of the Qt Toolkit. ** diff --git a/qmake/generators/projectgenerator.h b/qmake/generators/projectgenerator.h index 019ff9de44..621a9eb977 100644 --- a/qmake/generators/projectgenerator.h +++ b/qmake/generators/projectgenerator.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the qmake application of the Qt Toolkit. ** diff --git a/src/corelib/statemachine/qsignaleventgenerator_p.h b/src/corelib/statemachine/qsignaleventgenerator_p.h index 4ed43c4edb..160a24e7a3 100644 --- a/src/corelib/statemachine/qsignaleventgenerator_p.h +++ b/src/corelib/statemachine/qsignaleventgenerator_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. ** diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp index 387caae957..8c822162e4 100644 --- a/src/dbus/qdbusxmlgenerator.cpp +++ b/src/dbus/qdbusxmlgenerator.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtDBus module of the Qt Toolkit. ** diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 44eb4f65e8..4757fdad93 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2013 Olivier Goffart -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h index aece7152b3..203c856b7c 100644 --- a/src/tools/moc/generator.h +++ b/src/tools/moc/generator.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index af8ac505f8..96f5519be4 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** diff --git a/src/tools/qdoc/ditaxmlgenerator.h b/src/tools/qdoc/ditaxmlgenerator.h index a55ccf81c8..a58504d7c7 100644 --- a/src/tools/qdoc/ditaxmlgenerator.h +++ b/src/tools/qdoc/ditaxmlgenerator.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 187253df50..889f0f55ca 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h index 2fb3117765..58e9073922 100644 --- a/src/tools/qdoc/generator.h +++ b/src/tools/qdoc/generator.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 618547809e..7cb56974d5 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h index cdf296e783..0a6717461e 100644 --- a/src/tools/qdoc/htmlgenerator.h +++ b/src/tools/qdoc/htmlgenerator.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** -- cgit v1.2.3 From bd1dc60d6555a901fb3005273d7a86efe470739a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Thu, 18 Jul 2013 08:43:45 +0300 Subject: Expect tst_QEasingCurve::setCustomType() failing on 32 bit Ubuntu 11.10 Currently tst_QEasingCurve::setCustomType() is always failing on CI when ran on 32 bit 11.10 Ubuntu. Task-number: QTBUG-32432 Change-Id: Iaf346c14985f14716692fe996714b7040fb70930 Reviewed-by: Sergio Ahumada --- tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro | 1 + tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro b/tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro index 679f9bbda4..bec6c1e17e 100644 --- a/tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro +++ b/tests/auto/corelib/tools/qeasingcurve/qeasingcurve.pro @@ -3,3 +3,4 @@ TARGET = tst_qeasingcurve QT = core testlib SOURCES = tst_qeasingcurve.cpp DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):DEFINES+=UBUNTU_ONEIRIC # QTBUG-32432 diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp index 2099d978c0..fa747b3c18 100644 --- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp @@ -434,6 +434,9 @@ void tst_QEasingCurve::setCustomType() QCOMPARE(curve.valueForProgress(0.15), 0.1); QCOMPARE(curve.valueForProgress(0.20), 0.2); QCOMPARE(curve.valueForProgress(0.25), 0.2); +#if defined(UBUNTU_ONEIRIC) && defined(__i386__) + QEXPECT_FAIL("", "QTBUG-32432: Fails on Ubuntu 11.10 32 bit configurations", Abort); +#endif QCOMPARE(curve.valueForProgress(0.30), 0.3); QCOMPARE(curve.valueForProgress(0.35), 0.3); QCOMPARE(curve.valueForProgress(0.999999), 0.9); -- cgit v1.2.3 From 2ff2a7c32d76b9e58b800f12469f112cfdb6ad3c Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Fri, 19 Jul 2013 14:35:19 +0200 Subject: Fix wayland-scanner to work with CONFIG+=silent Use "_" instead of "-" in variables so variable replacement works properly. Change-Id: I2b17dca8f2351bc0933c165017f3fbb9393b0514 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/wayland-scanner.prf | 106 +++++++++++++++++------------------ 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/mkspecs/features/wayland-scanner.prf b/mkspecs/features/wayland-scanner.prf index 2ec064f29d..b2eca41695 100644 --- a/mkspecs/features/wayland-scanner.prf +++ b/mkspecs/features/wayland-scanner.prf @@ -5,64 +5,64 @@ isEmpty(QMAKE_WAYLAND_SCANNER):error("QMAKE_WAYLAND_SCANNER not defined for this mkspec") -wayland-server-header.name = wayland ${QMAKE_FILE_BASE} -wayland-server-header.input = WAYLANDSERVERSOURCES -wayland-server-header.variable_out = HEADERS -wayland-server-header.output = wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)} -wayland-server-header.commands = $$QMAKE_WAYLAND_SCANNER server-header < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} -silent:wayland-server-header.commands = @echo Wayland server header ${QMAKE_FILE_IN} && $$wayland-server-header.commands -QMAKE_EXTRA_COMPILERS += wayland-server-header +wayland_server_header.name = wayland ${QMAKE_FILE_BASE} +wayland_server_header.input = WAYLANDSERVERSOURCES +wayland_server_header.variable_out = HEADERS +wayland_server_header.output = wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)} +wayland_server_header.commands = $$QMAKE_WAYLAND_SCANNER server-header < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} +silent:wayland_server_header.commands = @echo Wayland server header ${QMAKE_FILE_IN} && $$wayland_server_header.commands +QMAKE_EXTRA_COMPILERS += wayland_server_header -wayland-client-header.name = wayland ${QMAKE_FILE_BASE} -wayland-client-header.input = WAYLANDCLIENTSOURCES -wayland-client-header.variable_out = HEADERS -wayland-client-header.output = wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} -wayland-client-header.commands = $$QMAKE_WAYLAND_SCANNER client-header < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} -silent:wayland-client-header.commands = @echo Wayland client header ${QMAKE_FILE_IN} && $$wayland-client-header.commands -QMAKE_EXTRA_COMPILERS += wayland-client-header +wayland_client_header.name = wayland ${QMAKE_FILE_BASE} +wayland_client_header.input = WAYLANDCLIENTSOURCES +wayland_client_header.variable_out = HEADERS +wayland_client_header.output = wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} +wayland_client_header.commands = $$QMAKE_WAYLAND_SCANNER client-header < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} +silent:wayland_client_header.commands = @echo Wayland client header ${QMAKE_FILE_IN} && $$wayland_client_header.commands +QMAKE_EXTRA_COMPILERS += wayland_client_header -wayland-code.name = wayland ${QMAKE_FILE_BASE} -wayland-code.input = WAYLANDCLIENTSOURCES WAYLANDSERVERSOURCES -wayland-code.variable_out = SOURCES -wayland-code.output = wayland-${QMAKE_FILE_BASE}-protocol.c -wayland-code.commands = $$QMAKE_WAYLAND_SCANNER code < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} -silent:wayland-code.commands = @echo Wayland code header ${QMAKE_FILE_IN} && $$wayland-code.commands -QMAKE_EXTRA_COMPILERS += wayland-code +wayland_code.name = wayland ${QMAKE_FILE_BASE} +wayland_code.input = WAYLANDCLIENTSOURCES WAYLANDSERVERSOURCES +wayland_code.variable_out = SOURCES +wayland_code.output = wayland-${QMAKE_FILE_BASE}-protocol.c +wayland_code.commands = $$QMAKE_WAYLAND_SCANNER code < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} +silent:wayland_code.commands = @echo Wayland code header ${QMAKE_FILE_IN} && $$wayland_code.commands +QMAKE_EXTRA_COMPILERS += wayland_code qtPrepareTool(QMAKE_QTWAYLANDSCANNER, qtwaylandscanner) -qtwayland-client-header.name = qtwayland ${QMAKE_FILE_BASE} -qtwayland-client-header.input = WAYLANDCLIENTSOURCES -qtwayland-client-header.variable_out = HEADERS -qtwayland-client-header.depends = wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} -qtwayland-client-header.output = qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} -qtwayland-client-header.commands = $$QMAKE_QTWAYLANDSCANNER client-header ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} -silent:qtwayland-client-header.commands = @echo QtWayland client header ${QMAKE_FILE_IN} && $$qtwayland-client-header.commands -QMAKE_EXTRA_COMPILERS += qtwayland-client-header +qtwayland_client_header.name = qtwayland ${QMAKE_FILE_BASE} +qtwayland_client_header.input = WAYLANDCLIENTSOURCES +qtwayland_client_header.variable_out = HEADERS +qtwayland_client_header.depends = wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)} +qtwayland_client_header.output = qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} +qtwayland_client_header.commands = $$QMAKE_QTWAYLANDSCANNER client-header ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} +silent:qtwayland_client_header.commands = @echo QtWayland client header ${QMAKE_FILE_IN} && $$qtwayland_client_header.commands +QMAKE_EXTRA_COMPILERS += qtwayland_client_header -qtwayland-client-code.name = qtwayland ${QMAKE_FILE_BASE} -qtwayland-client-code.input = WAYLANDCLIENTSOURCES -qtwayland-client-code.variable_out = SOURCES -qtwayland-client-code.depends = qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} -qtwayland-client-code.output = qwayland-${QMAKE_FILE_BASE}.cpp -qtwayland-client-code.commands = $$QMAKE_QTWAYLANDSCANNER client-code ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} -silent:qtwayland-client-code.commands = @echo QtWayland client code ${QMAKE_FILE_IN} && $$qtwayland-client-code.commands -QMAKE_EXTRA_COMPILERS += qtwayland-client-code +qtwayland_client_code.name = qtwayland ${QMAKE_FILE_BASE} +qtwayland_client_code.input = WAYLANDCLIENTSOURCES +qtwayland_client_code.variable_out = SOURCES +qtwayland_client_code.depends = qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} +qtwayland_client_code.output = qwayland-${QMAKE_FILE_BASE}.cpp +qtwayland_client_code.commands = $$QMAKE_QTWAYLANDSCANNER client-code ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} +silent:qtwayland_client_code.commands = @echo QtWayland client code ${QMAKE_FILE_IN} && $$qtwayland_client_code.commands +QMAKE_EXTRA_COMPILERS += qtwayland_client_code -qtwayland-server-header.name = qtwayland ${QMAKE_FILE_BASE} -qtwayland-server-header.input = WAYLANDSERVERSOURCES -qtwayland-server-header.variable_out = HEADERS -qtwayland-server-header.depends = wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)} -qtwayland-server-header.output = qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} -qtwayland-server-header.commands = $$QMAKE_QTWAYLANDSCANNER server-header ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} -silent:qtwayland-server-header.commands = @echo QtWayland server header ${QMAKE_FILE_IN} && $$qtwayland-server-header.commands -QMAKE_EXTRA_COMPILERS += qtwayland-server-header +qtwayland_server_header.name = qtwayland ${QMAKE_FILE_BASE} +qtwayland_server_header.input = WAYLANDSERVERSOURCES +qtwayland_server_header.variable_out = HEADERS +qtwayland_server_header.depends = wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)} +qtwayland_server_header.output = qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} +qtwayland_server_header.commands = $$QMAKE_QTWAYLANDSCANNER server-header ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} +silent:qtwayland_server_header.commands = @echo QtWayland server header ${QMAKE_FILE_IN} && $$qtwayland_server_header.commands +QMAKE_EXTRA_COMPILERS += qtwayland_server_header -qtwayland-server-code.name = qtwayland ${QMAKE_FILE_BASE} -qtwayland-server-code.input = WAYLANDSERVERSOURCES -qtwayland-server-code.variable_out = SOURCES -qtwayland-server-code.depends = qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} -qtwayland-server-code.output = qwayland-server-${QMAKE_FILE_BASE}.cpp -qtwayland-server-code.commands = $$QMAKE_QTWAYLANDSCANNER server-code ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} -silent:qtwayland-server-code.commands = @echo QtWayland server code ${QMAKE_FILE_IN} && $$qtwayland-server-code.commands -QMAKE_EXTRA_COMPILERS += qtwayland-server-code +qtwayland_server_code.name = qtwayland ${QMAKE_FILE_BASE} +qtwayland_server_code.input = WAYLANDSERVERSOURCES +qtwayland_server_code.variable_out = SOURCES +qtwayland_server_code.depends = qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} +qtwayland_server_code.output = qwayland-server-${QMAKE_FILE_BASE}.cpp +qtwayland_server_code.commands = $$QMAKE_QTWAYLANDSCANNER server-code ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT} +silent:qtwayland_server_code.commands = @echo QtWayland server code ${QMAKE_FILE_IN} && $$qtwayland_server_code.commands +QMAKE_EXTRA_COMPILERS += qtwayland_server_code -- cgit v1.2.3 From bad93acfba492954543a293dbf87769a6953d630 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 19 Jul 2013 13:43:30 -0700 Subject: Fix compilation of QtTest on Linux systems with old kernel headers Hardcode our perf_event_open(2) function to simply return -1 and set errno to ENOSYS. This will disable the functionality. People compiling Qt with such old headers will probably carry quite a bit of dead code in QtTest. They should upgrade. Task-number: QTBUG-32507 Change-Id: I774b4a81bee5c3e2ddc75fa52520d123a6bebed9 Reviewed-by: Jason McDonald --- src/testlib/qbenchmarkperfevents.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/testlib/qbenchmarkperfevents.cpp b/src/testlib/qbenchmarkperfevents.cpp index e3034d1f94..acc11b09ac 100644 --- a/src/testlib/qbenchmarkperfevents.cpp +++ b/src/testlib/qbenchmarkperfevents.cpp @@ -130,7 +130,17 @@ static void initPerf() static int perf_event_open(perf_event_attr *attr, pid_t pid, int cpu, int group_fd, unsigned long flags) { +#ifdef SYS_perf_event_open return syscall(SYS_perf_event_open, attr, pid, cpu, group_fd, flags); +#else + Q_UNUSED(attr); + Q_UNUSED(pid); + Q_UNUSED(cpu); + Q_UNUSED(group_fd); + Q_UNUSED(flags); + errno = ENOSYS; + return -1; +#endif } bool QBenchmarkPerfEventsMeasurer::isAvailable() -- cgit v1.2.3 From b02eb3b436b49054fe972023c220b7760a0f48f5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 19 Jul 2013 14:08:14 -0700 Subject: Ensure that the user codecs are listed in QTextCodec::availableCodecs Codecs registered by creating new QTextCodec instances should be listed there. Task-number: QTBUG-32500 Change-Id: I56c00e0d6bbfef55a6cbd571bcf9aa2cf333ef3a Reviewed-by: David Faure --- src/corelib/codecs/qtextcodec.cpp | 8 ++-- .../corelib/codecs/qtextcodec/tst_qtextcodec.cpp | 48 ++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 4ed7b00e53..766e48358d 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -600,9 +600,6 @@ QTextCodec* QTextCodec::codecForMib(int mib) */ QList QTextCodec::availableCodecs() { -#ifdef QT_USE_ICU - return QIcuCodec::availableCodecs(); -#else QMutexLocker locker(textCodecsMutex()); QCoreGlobalData *globalData = QCoreGlobalData::instance(); @@ -616,8 +613,11 @@ QList QTextCodec::availableCodecs() codecs += globalData->allCodecs.at(i)->aliases(); } - return codecs; +#ifdef QT_USE_ICU + codecs += QIcuCodec::availableCodecs(); #endif + + return codecs; } /*! diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index 616fe33309..6329160998 100644 --- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp @@ -102,6 +102,7 @@ private slots: void moreToFromUnicode(); void shiftJis(); + void userCodec(); }; void tst_QTextCodec::toUnicode_data() @@ -2312,6 +2313,53 @@ void tst_QTextCodec::shiftJis() QCOMPARE(encoded, backslashTilde); } +struct UserCodec : public QTextCodec +{ + // implement pure virtuals + QByteArray name() const Q_DECL_OVERRIDE + { return "UserCodec"; } + QList aliases() const Q_DECL_OVERRIDE + { return QList() << "usercodec" << "user-codec"; } + int mibEnum() const Q_DECL_OVERRIDE + { return 5000; } + + virtual QString convertToUnicode(const char *, int, ConverterState *) const Q_DECL_OVERRIDE + { return QString(); } + virtual QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const Q_DECL_OVERRIDE + { return QByteArray(); } +}; + +void tst_QTextCodec::userCodec() +{ + // check that it isn't there + static bool executedOnce = false; + if (executedOnce) + QSKIP("Test already executed once"); + + QVERIFY(!QTextCodec::availableCodecs().contains("UserCodec")); + QVERIFY(!QTextCodec::codecForName("UserCodec")); + + QTextCodec *codec = new UserCodec; + executedOnce = true; + + QList availableCodecs = QTextCodec::availableCodecs(); + QVERIFY(availableCodecs.contains("UserCodec")); + QVERIFY(availableCodecs.contains("usercodec")); + QVERIFY(availableCodecs.contains("user-codec")); + + QTextCodec *pcodec = QTextCodec::codecForName("UserCodec"); + QCOMPARE(pcodec, codec); + + pcodec = QTextCodec::codecForName("user-codec"); + QCOMPARE(pcodec, codec); + + pcodec = QTextCodec::codecForName("User-Codec"); + QCOMPARE(pcodec, codec); + + pcodec = QTextCodec::codecForMib(5000); + QCOMPARE(pcodec, codec); +} + struct DontCrashAtExit { ~DontCrashAtExit() { QTextCodec *c = QTextCodec::codecForName("utf8"); -- cgit v1.2.3 From a0996b8b606d9d54fe4ba3a02615a26b196f0547 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 17 Jul 2013 13:26:55 +0200 Subject: Prevent activation of windows with Qt::WindowDoesNotAcceptFocus. Task-number: QTBUG-32385 Change-Id: I307e2a3e5157b351663940d5d02fc16b3127b5dd Reviewed-by: Shawn Rutledge --- src/gui/kernel/qwindow.cpp | 4 ++++ src/plugins/platforms/xcb/qxcbwindow.cpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 392407d86d..9ef19715ed 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -871,6 +871,10 @@ QRegion QWindow::mask() const void QWindow::requestActivate() { Q_D(QWindow); + if (flags() & Qt::WindowDoesNotAcceptFocus) { + qWarning() << "requestActivate() called for " << this << " which has Qt::WindowDoesNotAcceptFocus set."; + return; + } if (d->platformWindow) d->platformWindow->requestActivateWindow(); } diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 3b818d78d8..0325338a13 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1643,7 +1643,8 @@ void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event) { if (window() != QGuiApplication::focusWindow()) { QWindow *w = static_cast(QObjectPrivate::get(window()))->eventReceiver(); - w->requestActivate(); + if (!(w->flags() & Qt::WindowDoesNotAcceptFocus)) + w->requestActivate(); } updateNetWmUserTime(event->time); -- cgit v1.2.3 From 3ff441d30570fd38f62d858b8c8e86e9d1ca3d8d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 1 Jun 2013 16:57:19 +0200 Subject: xcb: Don't use Xlib's XBell() function XBell() just sends a Bell request to the X11 server. This can be done equally well (and with less ifdefs) through xcb's xcb_bell(). Change-Id: If41d955aa97acfe9e0a8b9fce05c11ebc146ce8e Signed-off-by: Uli Schlachter Reviewed-by: Friedemann Kleint Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 7d832a1c08..9e9fd2914f 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -95,12 +95,9 @@ QXcbNativeInterface::QXcbNativeInterface() : void QXcbNativeInterface::beep() // For QApplication::beep() { -#ifdef XCB_USE_XLIB - ::Display *display = (::Display *)nativeResourceForScreen(QByteArrayLiteral("display"), QGuiApplication::primaryScreen()); - XBell(display, 0); -#else - fputc(7, stdout); -#endif + QPlatformScreen *screen = QGuiApplication::primaryScreen()->handle(); + xcb_connection_t *connection = static_cast(screen)->xcb_connection(); + xcb_bell(connection, 0); } void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString) -- cgit v1.2.3 From 782ed5eebbe38e41cd0a9b9faf90817d72efda8f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 18 Jul 2013 11:11:31 +0200 Subject: Don't check for the existence of private include directories. Some packagers don't want to install the private headers. Check the existence of private headers only if the 'Private' component is specified when finding the package. Task-number: QTBUG-32466 Change-Id: I1fdbfb25e8ce485cd051564b937f766b2733741a Reviewed-by: Stephen Kelly --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 17 ++++++++++++----- tests/auto/cmake/test_private_includes/CMakeLists.txt | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 38623349be..bcff3166d3 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -119,14 +119,21 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) !!ENDIF - foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS} -!!IF isEmpty(CMAKE_BUILD_IS_FRAMEWORK) - ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS} -!!ENDIF - ) + foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS}) _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir}) endforeach() +!!IF isEmpty(CMAKE_BUILD_IS_FRAMEWORK) + # Only check existence of private includes if the Private component is + # specified. + list(FIND Qt5$${CMAKE_MODULE_NAME}_FIND_COMPONENTS Private _check_private) + if (NOT _check_private STREQUAL -1) + foreach(_dir ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS}) + _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir}) + endforeach() + endif() +!!ENDIF + set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS}) set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -D$${MODULE_DEFINE}) diff --git a/tests/auto/cmake/test_private_includes/CMakeLists.txt b/tests/auto/cmake/test_private_includes/CMakeLists.txt index f283bc21b3..9095836ed8 100644 --- a/tests/auto/cmake/test_private_includes/CMakeLists.txt +++ b/tests/auto/cmake/test_private_includes/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8) project(test_private_includes) -find_package(Qt5Gui REQUIRED) +find_package(Qt5Gui REQUIRED Private) include_directories( ${Qt5Gui_INCLUDE_DIRS} -- cgit v1.2.3 From 08db2caf6344bad88675c58250fc6b04399c29f5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 9 Jul 2013 14:18:10 +0200 Subject: document that validity of exitCode() depends on exitStatus() == NormalExit Change-Id: Ied16681f08c59de16ac365b9ae76c2eacf6bc29c Reviewed-by: Christian Kandeler --- src/corelib/io/qprocess.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index d8cd1f5fae..1be108d0a7 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -727,9 +727,11 @@ void QProcessPrivate::Channel::clear() \fn void QProcess::finished(int exitCode, QProcess::ExitStatus exitStatus) This signal is emitted when the process finishes. \a exitCode is the exit - code of the process, and \a exitStatus is the exit status. After the - process has finished, the buffers in QProcess are still intact. You can - still read any data that the process may have written before it finished. + code of the process (only valid for normal exits), and \a exitStatus is + the exit status. + After the process has finished, the buffers in QProcess are still intact. + You can still read any data that the process may have written before it + finished. \sa exitStatus() */ @@ -2234,6 +2236,8 @@ void QProcess::kill() /*! Returns the exit code of the last process that finished. + + This value is not valid unless exitStatus() returns NormalExit. */ int QProcess::exitCode() const { -- cgit v1.2.3 From f57e2f5667c1eb72b5cbe3ad650dac2f6ca4f8a0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 Jul 2013 15:10:09 +0200 Subject: resolve output of .depend_command relative to $$OUT_PWD ... as that is the CWD of the command (since b139e7e96e5c). leave the resolution relative to $$PWD as a fallback with a warning. Investigated-by: Harald Hvaal Task-number: QTBUG-19352 Change-Id: I75de9444a647cd9e6f509e3d8eb3382dc985e5ca Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 1f2ebcf50e..0ec4a5f235 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1984,7 +1984,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' '); for(int i = 0; i < dep_cmd_deps.count(); ++i) { QString &file = dep_cmd_deps[i]; - if(!exists(file)) { + QString absFile = QDir(Option::output_dir).absoluteFilePath(file); + if (exists(absFile)) { + file = absFile; + } else { QString localFile; QList depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList::Iterator dit = depdirs.begin(); @@ -1994,7 +1997,16 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) break; } } - file = localFile; + if (localFile.isEmpty()) { + if (exists(file)) + warn_msg(WarnDeprecated, ".depend_command for extra compiler %s" + " prints paths relative to source directory", + (*it).toLatin1().constData()); + else + file.clear(); + } else { + file = localFile; + } } if(!file.isEmpty()) file = fileFixify(file); @@ -2062,7 +2074,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' '); for(int i = 0; i < dep_cmd_deps.count(); ++i) { QString &file = dep_cmd_deps[i]; - if(!exists(file)) { + QString absFile = QDir(Option::output_dir).absoluteFilePath(file); + if (exists(absFile)) { + file = absFile; + } else { QString localFile; QList depdirs = QMakeSourceFileInfo::dependencyPaths(); for (QList::Iterator dit = depdirs.begin(); @@ -2072,7 +2087,16 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) break; } } - file = localFile; + if (localFile.isEmpty()) { + if (exists(file)) + warn_msg(WarnDeprecated, ".depend_command for extra compiler %s" + " prints paths relative to source directory", + (*it).toLatin1().constData()); + else + file.clear(); + } else { + file = localFile; + } } if(!file.isEmpty()) file = fileFixify(file); -- cgit v1.2.3 From ff6265bfc2b5130cd6e76e57250f3ac604867303 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 17 Jul 2013 16:15:17 +0200 Subject: fix c-quoting of strings which contain quotes escape backslashes before the quotes, as otherwise we'd escape the backslashes we just used to escape the quotes. Change-Id: I88e12c0c2cfc53e0ab8dce9807b06dfce6aa6e78 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/winmakefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index fe85efc8ba..e48ef9bacd 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -899,8 +899,8 @@ QString Win32MakefileGenerator::escapeFilePath(const QString &path) const QString Win32MakefileGenerator::cQuoted(const QString &str) { QString ret = str; - ret.replace(QLatin1Char('"'), QStringLiteral("\\\"")); ret.replace(QLatin1Char('\\'), QStringLiteral("\\\\")); + ret.replace(QLatin1Char('"'), QStringLiteral("\\\"")); ret.prepend(QLatin1Char('"')); ret.append(QLatin1Char('"')); return ret; -- cgit v1.2.3 From f216caa52cac04bd4ed560ae2b5249a45e75070a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 17 Jul 2013 16:49:23 +0200 Subject: unbreak use of not-overquoted ICON entries amends 0e548b5856. Change-Id: I88a5b8c681f7508aecf02b913e64816b712d97a2 Reviewed-by: Joerg Bornemann --- qmake/generators/mac/pbuilder_pbx.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index d82327737b..41e5754251 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1099,10 +1099,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (useCopyResourcesPhase) { if (!project->isEmpty("ICON")) { ProString icon = project->first("ICON"); - if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0))) { + if (icon.length() >= 2 && (icon.at(0) == '"' || icon.at(0) == '\'') && icon.endsWith(icon.at(0))) icon = icon.mid(1, icon.length() - 2); - bundle_resources_files += keyFor(icon + ".BUILDABLE"); - } + bundle_resources_files += keyFor(icon + ".BUILDABLE"); } QString grp("Copy Bundle Resources"), key = keyFor(grp); -- cgit v1.2.3 From cc0c394682470eac534822578cb432620a8779a8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 18 Jul 2013 11:57:21 +0200 Subject: escape paths coming from prl files qmake has the rather bizarre logic that QMAKE_LIBS* is escaped rather early (instead of right before being written out the the Makefile). consequently, we need to explicitly escape the paths from the prl files as well. Task-number: QTBUG-32326 Change-Id: Ieaf81113d3ca3cf5d8a1ef87c83c5721d6b473ee Reviewed-by: Joerg Bornemann --- qmake/generators/unix/unixmake.cpp | 2 +- qmake/generators/win32/winmakefile.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 948fd2b79c..bbaecbfd72 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -641,7 +641,7 @@ UnixMakefileGenerator::processPrlFiles() ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS"); if(!prl_libs.isEmpty()) { for(int prl = 0; prl < prl_libs.size(); ++prl) - l.insert(lit+prl+1, prl_libs.at(prl)); + l.insert(lit+prl+1, escapeFilePath(prl_libs.at(prl).toQString())); prl_libs.clear(); } } diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index e48ef9bacd..2ef2d82b5a 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -241,8 +241,14 @@ Win32MakefileGenerator::processPrlFiles() } } ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS"); - for (int prl = 0; prl < prl_libs.size(); ++prl) - l.insert(lit + prl + 1, prl_libs.at(prl)); + for (int prl = 0; prl < prl_libs.size(); ++prl) { + ProString arg = prl_libs.at(prl); + if (arg.startsWith(libArg)) + arg = arg.left(libArg.length()) + escapeFilePath(arg.mid(libArg.length()).toQString()); + else if (!arg.startsWith('/')) + arg = escapeFilePath(arg.toQString()); + l.insert(lit + prl + 1, arg); + } prl_libs.clear(); } -- cgit v1.2.3 From 944e1d7b6a34098146fc4868909cb8b457c56eb6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 17 Jul 2013 16:44:18 +0200 Subject: make unescapeFilePath() less inefficient replace() doesn't detach if there is nothing to do. Change-Id: I845b585c766f44a670ca3af1fc11ba03e7317622 Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 0ec4a5f235..98b5a328e4 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2763,12 +2763,8 @@ QString MakefileGenerator::unescapeFilePath(const QString &path) const { QString ret = path; - if(!ret.isEmpty()) { - if(ret.contains(QLatin1String("\\ "))) - ret.replace(QLatin1String("\\ "), QLatin1String(" ")); - if(ret.contains(QLatin1Char('\"'))) - ret.remove(QLatin1Char('\"')); - } + ret.replace(QLatin1String("\\ "), QLatin1String(" ")); + ret.remove(QLatin1Char('\"')); return ret; } -- cgit v1.2.3 From 1cbb228a10140184c2430ffc160310384c58f5c0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 4 Jul 2013 16:09:05 +0200 Subject: fix target strip-ing inside mac bundles this went unnoticed so far, because the mac qmakespecs don't define a strip command to start with. Change-Id: Iac3e7ffa6f400373552134a44b9713aaf5f44589 Reviewed-by: Joerg Bornemann --- qmake/generators/unix/unixmake.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index bbaecbfd72..507a3a42c7 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -818,15 +818,20 @@ UnixMakefileGenerator::defaultInstall(const QString &t) if(!project->isEmpty("QMAKE_RANLIB")) ret += QString("\n\t$(RANLIB) \"") + dst_targ + "\""; } else if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") && !project->isEmpty("QMAKE_STRIP")) { + QString suffix; ret += "\n\t-$(STRIP)"; - if(project->first("TEMPLATE") == "lib" && !project->isEmpty("QMAKE_STRIPFLAGS_LIB")) - ret += " " + var("QMAKE_STRIPFLAGS_LIB"); - else if(project->first("TEMPLATE") == "app" && !project->isEmpty("QMAKE_STRIPFLAGS_APP")) - ret += " " + var("QMAKE_STRIPFLAGS_APP"); - if(bundle) - ret = " \"" + dst_targ + "/Contents/MacOS/$(QMAKE_TARGET)\""; - else - ret += " \"" + dst_targ + "\""; + if (project->first("TEMPLATE") == "lib") { + if (!project->isEmpty("QMAKE_STRIPFLAGS_LIB")) + ret += " " + var("QMAKE_STRIPFLAGS_LIB"); + if (bundle) + suffix = "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/$(TARGET)"; + } else if (project->first("TEMPLATE") == "app") { + if (!project->isEmpty("QMAKE_STRIPFLAGS_APP")) + ret += " " + var("QMAKE_STRIPFLAGS_APP"); + if (bundle) + suffix = "/" + project->first("QMAKE_BUNDLE_LOCATION") + "/$(QMAKE_TARGET)"; + } + ret += " \"" + dst_targ + suffix + "\""; } if(!uninst.isEmpty()) uninst.append("\n\t"); -- cgit v1.2.3 From 9e4dcbac05f3a62d4cdc5d4b9d76fa3e93bf7501 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 12 Jul 2013 11:55:28 +0200 Subject: mac frameworks: link target alias to Current version by convention, $target.framework/$target links to Versions/Current/$target, not Versions/$version/$target. Versions/Current already links to $version. so this adds one indirection, but is otherwise the same. Change-Id: If3d1a3713712f4221ec31883977e50bce6f91764 Reviewed-by: Jake Petroules Reviewed-by: Joerg Bornemann --- qmake/generators/unix/unixmake2.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index c81b7d8d12..8d63ccdf2a 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -561,9 +561,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGETD)`\"", false) << "\n\t" << "-$(MOVE) $(TARGET) $(DESTDIR)$(TARGETD)\n\t" << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t" - << varGlue("QMAKE_LN_SHLIB","-"," "," Versions/" + - project->first("QMAKE_FRAMEWORK_VERSION") + - "/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t" + << varGlue("QMAKE_LN_SHLIB", "-", " ", + " Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t" << "-$(DEL_FILE) " << destdir << "Versions/Current\n\t" << varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") + " " + destdir + "Versions/Current") << "\n\t"; -- cgit v1.2.3 From c9568da9697adc50b1417dff3e040aefb934522b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 11 Jul 2013 15:43:32 +0200 Subject: don't install mac bundles atomically ... as that causes debug+release installs to overwrite each other's postprocessed files. introduces CONFIG+=sliced_bundle, which instructs qmake to create file-by-file install commands. we don't know whether people are not putting files outside qmake's knowledge into the bundle build dir, so this mode is not necessarily backwards-compatible, and thus off by default. Task-number: QTBUG-28336 Change-Id: I23e90985ccd3311f0237ed61aadca6d7ed8325b7 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module.prf | 2 +- qmake/generators/unix/unixmake.cpp | 69 ++++++++++++++++++++++++------------- qmake/generators/unix/unixmake2.cpp | 16 +++++++-- 3 files changed, 60 insertions(+), 27 deletions(-) diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 7f7de85bb6..390fb49930 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -90,7 +90,7 @@ else: \ # OS X and iOS frameworks mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { #QMAKE_FRAMEWORK_VERSION = 4.0 - CONFIG += lib_bundle qt_framework + CONFIG += lib_bundle sliced_bundle qt_framework !debug_and_release|if(build_all:CONFIG(release, debug|release)) { FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 507a3a42c7..adeb55af86 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -727,7 +727,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) if(t != "target" || project->first("TEMPLATE") == "subdirs") return QString(); - bool bundle = false; + enum { NoBundle, SolidBundle, SlicedBundle } bundle = NoBundle; const QString root = "$(INSTALL_ROOT)"; ProStringList &uninst = project->values(ProKey(t + ".uninstall")); QString ret, destdir = project->first("DESTDIR").toQString(); @@ -743,7 +743,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) const ProStringList &targets = project->values(ProKey(t + ".targets")); if(!project->isEmpty("QMAKE_BUNDLE")) { target = project->first("QMAKE_BUNDLE").toQString(); - bundle = true; + bundle = project->isActiveConfig("sliced_bundle") ? SlicedBundle : SolidBundle; } else if(project->first("TEMPLATE") == "app") { target = "$(QMAKE_TARGET)"; } else if(project->first("TEMPLATE") == "lib") { @@ -768,7 +768,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) uninst.append("-$(DEL_FILE) \"" + dst + "\""); } - if(!bundle && project->isActiveConfig("compile_libtool")) { + if (bundle == NoBundle && project->isActiveConfig("compile_libtool")) { QString src_targ = target; if(src_targ == "$(TARGET)") src_targ = "$(TARGETL)"; @@ -781,23 +781,36 @@ UnixMakefileGenerator::defaultInstall(const QString &t) QString src_targ = target; if(!destdir.isEmpty()) src_targ = Option::fixPathToTargetOS(destdir + target, false); - QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + target, FileFixifyAbsolute)); - if(bundle) { - if(!ret.isEmpty()) - ret += "\n\t"; - ret += "$(DEL_FILE) -r \"" + dst_targ + "\"\n\t"; + QString plain_targ = filePrefixRoot(root, fileFixify(targetdir + target, FileFixifyAbsolute)); + QString dst_targ = plain_targ; + if (bundle != NoBundle) { + QString suffix; + if (project->first("TEMPLATE") == "lib") + suffix = "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/$(TARGET)"; + else + suffix = "/" + project->first("QMAKE_BUNDLE_LOCATION") + "/$(QMAKE_TARGET)"; + dst_targ += suffix; + if (bundle == SolidBundle) { + if (!ret.isEmpty()) + ret += "\n\t"; + ret += "$(DEL_FILE) -r \"" + plain_targ + "\"\n\t"; + } else { + src_targ += suffix; + } } if(!ret.isEmpty()) ret += "\n\t"; QString copy_cmd("-"); - if (bundle) - copy_cmd += "$(INSTALL_DIR)"; - else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) - copy_cmd += "$(INSTALL_FILE)"; - else - copy_cmd += "$(INSTALL_PROGRAM)"; - copy_cmd += " \"" + src_targ + "\" \"" + dst_targ + "\""; + if (bundle == SolidBundle) { + copy_cmd += "$(INSTALL_DIR) \"" + src_targ + "\" \"" + plain_targ + "\""; + } else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) { + copy_cmd += "$(INSTALL_FILE) \"" + src_targ + "\" \"" + dst_targ + "\""; + } else { + if (bundle == SlicedBundle) + ret += mkdir_p_asstring("\"`dirname \"" + dst_targ + "\"`\"", false) + "\n\t"; + copy_cmd += "$(INSTALL_PROGRAM) \"" + src_targ + "\" \"" + dst_targ + "\""; + } if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") && project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) { if(!project->isEmpty("QMAKE_FIX_RPATH")) { @@ -818,27 +831,37 @@ UnixMakefileGenerator::defaultInstall(const QString &t) if(!project->isEmpty("QMAKE_RANLIB")) ret += QString("\n\t$(RANLIB) \"") + dst_targ + "\""; } else if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") && !project->isEmpty("QMAKE_STRIP")) { - QString suffix; ret += "\n\t-$(STRIP)"; if (project->first("TEMPLATE") == "lib") { if (!project->isEmpty("QMAKE_STRIPFLAGS_LIB")) ret += " " + var("QMAKE_STRIPFLAGS_LIB"); - if (bundle) - suffix = "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/$(TARGET)"; } else if (project->first("TEMPLATE") == "app") { if (!project->isEmpty("QMAKE_STRIPFLAGS_APP")) ret += " " + var("QMAKE_STRIPFLAGS_APP"); - if (bundle) - suffix = "/" + project->first("QMAKE_BUNDLE_LOCATION") + "/$(QMAKE_TARGET)"; } - ret += " \"" + dst_targ + suffix + "\""; + ret += " \"" + dst_targ + "\""; } if(!uninst.isEmpty()) uninst.append("\n\t"); - if(bundle) - uninst.append("-$(DEL_FILE) -r \"" + dst_targ + "\""); + if (bundle == SolidBundle) + uninst.append("-$(DEL_FILE) -r \"" + plain_targ + "\""); else uninst.append("-$(DEL_FILE) \"" + dst_targ + "\""); + if (bundle == SlicedBundle) { + int dstlen = project->first("DESTDIR").length(); + foreach (const ProString &src, project->values("QMAKE_BUNDLED_FILES")) { + QString file = unescapeFilePath(src.toQString()).mid(dstlen); + QString dst = filePrefixRoot(root, fileFixify(targetdir + file, FileFixifyAbsolute)); + if (!ret.isEmpty()) + ret += "\n\t"; + ret += mkdir_p_asstring("\"`dirname \"" + dst + "\"`\"", false) + "\n\t"; + ret += "-$(DEL_FILE) \"" + dst + "\"\n\t"; // Can't overwrite symlinks to directories + ret += "-$(INSTALL_DIR) " + src + " \"" + dst + "\""; // Use cp -R to copy symlinks + if (!uninst.isEmpty()) + uninst.append("\n\t"); + uninst.append("-$(DEL_FILE) \"" + dst + "\""); + } + } if(!links.isEmpty()) { for(int i = 0; i < links.size(); ++i) { if (target_mode == TARG_UNIX_MODE || target_mode == TARG_MAC_MODE) { diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 8d63ccdf2a..e4d33e2d4e 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -118,6 +118,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) (!project->isActiveConfig("staticlib")))), src_incremental=false; + ProStringList &bundledFiles = project->values("QMAKE_BUNDLED_FILES"); + t << "####### Compiler, tools and options\n\n"; t << "CC = " << var("QMAKE_CC") << endl; t << "CXX = " << var("QMAKE_CXX") << endl; @@ -555,6 +557,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else if(!project->isEmpty("QMAKE_BUNDLE")) { + QString currentLink = destdir + "Versions/Current"; + bundledFiles << currentLink << destdir + "$(TARGET)"; t << "\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)\n\t" << var("QMAKE_LINK_SHLIB_CMD") << "\n\t" @@ -563,9 +567,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t" << varGlue("QMAKE_LN_SHLIB", "-", " ", " Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t" - << "-$(DEL_FILE) " << destdir << "Versions/Current\n\t" + << "-$(DEL_FILE) " << currentLink << "\n\t" << varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") + - " " + destdir + "Versions/Current") << "\n\t"; + " " + currentLink) << "\n\t"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; @@ -703,6 +707,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) { ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE")); + bundledFiles << resources; QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources"); t << resources << ": \n\t"; t << mkdir_p_asstring(destdir) << "\n\t"; @@ -712,6 +717,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) //copy the plist QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST").toQString())), info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT").toQString()); + bundledFiles << info_plist_out; QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); t << info_plist_out << ": \n\t"; if(!destdir.isEmpty()) @@ -736,6 +742,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isEmpty("ICON")) { QString dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources/"; const QString icon_path = escapeFilePath(dir + icon.section(Option::dir_sep, -1)); + bundledFiles << icon_path; t << icon_path << ": " << icon << "\n\t" << mkdir_p_asstring(dir) << "\n\t" << "@$(DEL_FILE) " << icon_path << "\n\t" @@ -764,7 +771,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (!project->isEmpty(vkey)) { QString version = project->first(vkey) + "/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/"; - t << Option::fixPathToLocalOS(path + project->first(pkey)) << ": \n\t" + QString link = Option::fixPathToLocalOS(path + project->first(pkey)); + bundledFiles << link; + t << link << ": \n\t" << mkdir_p_asstring(path) << "\n\t" << "@$(SYMLINK) " << version << project->first(pkey) << " " << path << endl; path += version; @@ -778,6 +787,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) src = fn; src = escapeFilePath(src); const QString dst = escapeFilePath(path + Option::dir_sep + fileInfo(fn).fileName()); + bundledFiles << dst; t << dst << ": " << src << "\n\t" << mkdir_p_asstring(path) << "\n\t"; QFileInfo fi(fileInfo(fn)); -- cgit v1.2.3 From 54987c6bf55b159d3ddb79461439700f6e0111f9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 17 Jul 2013 14:34:10 +0200 Subject: default to -compile-examples because of popular confusion. the packaging scripts now need to use -no-compile-examples explicitly. Task-number: QTBUG-32449 Change-Id: Iecab1f345afe21e540204fe69a2292ef932cbb61 Reviewed-by: Andy Shaw Reviewed-by: Joerg Bornemann --- configure | 12 ++---------- tools/configure/configureapp.cpp | 11 ++--------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/configure b/configure index 938b23b000..140c7b4131 100755 --- a/configure +++ b/configure @@ -888,7 +888,7 @@ QT_DEFAULT_BUILD_PARTS="libs tools examples" CFG_BUILD_PARTS="" CFG_NOBUILD_PARTS="" CFG_SKIP_MODULES="" -CFG_COMPILE_EXAMPLES=auto +CFG_COMPILE_EXAMPLES=yes CFG_RELEASE_QMAKE=no CFG_AUDIO_BACKEND=auto CFG_V8SNAPSHOT=auto @@ -3204,14 +3204,6 @@ else QT_HOST_DATA=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_DATA"` fi -# Do not actually build the examples in production builds with -prefix, unless requested -if [ "$CFG_COMPILE_EXAMPLES" = auto ]; then - if [ "$CFG_DEV" = "yes" ] || [ "x$outpath" = "x$QT_INSTALL_PREFIX" ]; then - CFG_COMPILE_EXAMPLES=yes - else - CFG_COMPILE_EXAMPLES=no - fi -fi if [ "$CFG_COMPILE_EXAMPLES" = "yes" ]; then QMAKE_CONFIG="$QMAKE_CONFIG compile_examples" fi @@ -3517,7 +3509,7 @@ Additional options: -skip ..... Exclude an entire module from the build. - -compile-examples .. Compile examples even in a production build. + -no-compile-examples ... Install only the sources of examples. -no-gui ............ Don't build the Qt GUI module and dependencies. + -gui ............... Build the Qt GUI module and dependencies. diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 5b62e8f106..a6376bbb7d 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -256,7 +256,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "BUILDDEV" ] = "no"; - dictionary[ "COMPILE_EXAMPLES" ] = "auto"; + dictionary[ "COMPILE_EXAMPLES" ] = "yes"; dictionary[ "C++11" ] = "auto"; @@ -1702,7 +1702,7 @@ bool Configure::displayHelp() desc( "-skip ", "Exclude an entire module from the build.\n"); - desc( "-compile-examples", "Compile examples even in a production build.\n"); + desc( "-no-compile-examples", "Install only the sources of examples.\n"); desc("WIDGETS", "no", "-no-widgets", "Disable Qt Widgets module.\n"); desc("GUI", "no", "-no-gui", "Disable Qt GUI module.\n"); @@ -1987,13 +1987,6 @@ QString Configure::defaultTo(const QString &option) && (!QFile::exists(sourcePath + "/.git"))) return "no"; - // Do not actually build the examples in production builds with -prefix, unless requested - if (option == "COMPILE_EXAMPLES" - && QDir::cleanPath(dictionary[ "QT_BUILD_TREE" ]) - != QDir::cleanPath(dictionary[ "QT_INSTALL_PREFIX" ]) - && dictionary[ "BUILDDEV" ] == "no") - return "no"; - return "yes"; } -- cgit v1.2.3