From f5979a98bab248ce07567e72258257f78424e835 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 6 Aug 2009 09:52:15 +0200 Subject: Make the test pass by setting a path where you have dirs. The test was failing because the goal of the test expect to get only directories displayed. But if you don't have some in the current dir then it fails. home dir should be enough. Reviewed-by:TrustMe --- tests/auto/qfiledialog/tst_qfiledialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index e4fec1d4a8..f2ff4f2687 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -293,12 +293,13 @@ void tst_QFiledialog::filesSelectedSignal() QNonNativeFileDialog fd; fd.setViewMode(QFileDialog::List); fd.setOptions(QFileDialog::DontUseNativeDialog); - fd.setDirectory(QDir::currentPath()); + fd.setDirectory(QDir::homePath()); QFETCH(QFileDialog::FileMode, fileMode); fd.setFileMode(fileMode); QSignalSpy spyFilesSelected(&fd, SIGNAL(filesSelected(const QStringList &))); fd.show(); + QTest::qWait(500); QListView *listView = qFindChild(&fd, "listView"); QVERIFY(listView); QModelIndex root = listView->rootIndex(); -- cgit v1.2.3 From 190e9803165b3d3d076cc02b8861cff96f3e11d0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 6 Aug 2009 11:10:00 +0200 Subject: Tests: Make tools tests (rcc/moc/uic/uic3) run without X11-connection. --- tests/auto/moc/tst_moc.cpp | 2 +- tests/auto/rcc/tst_rcc.cpp | 2 +- tests/auto/uic/tst_uic.cpp | 2 +- tests/auto/uic3/tst_uic3.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp index 3a40ae0748..3ead204223 100644 --- a/tests/auto/moc/tst_moc.cpp +++ b/tests/auto/moc/tst_moc.cpp @@ -1180,7 +1180,7 @@ void tst_Moc::typenameWithUnsigned() QVERIFY(mobj->indexOfSlot("l(unsignedQImage)") != -1); } -QTEST_MAIN(tst_Moc) +QTEST_APPLESS_MAIN(tst_Moc) #include "tst_moc.moc" diff --git a/tests/auto/rcc/tst_rcc.cpp b/tests/auto/rcc/tst_rcc.cpp index dcdf1b67a0..e4255a3d9b 100644 --- a/tests/auto/rcc/tst_rcc.cpp +++ b/tests/auto/rcc/tst_rcc.cpp @@ -157,6 +157,6 @@ void tst_rcc::rcc() -QTEST_MAIN(tst_rcc) +QTEST_APPLESS_MAIN(tst_rcc) #include "tst_rcc.moc" diff --git a/tests/auto/uic/tst_uic.cpp b/tests/auto/uic/tst_uic.cpp index 6f91ab35e2..b605aa9298 100644 --- a/tests/auto/uic/tst_uic.cpp +++ b/tests/auto/uic/tst_uic.cpp @@ -218,7 +218,7 @@ QString tst_uic::workingDir() const return QDir::cleanPath(SRCDIR); } -QTEST_MAIN(tst_uic) +QTEST_APPLESS_MAIN(tst_uic) #include "tst_uic.moc" #else QTEST_NOOP_MAIN diff --git a/tests/auto/uic3/tst_uic3.cpp b/tests/auto/uic3/tst_uic3.cpp index 67011fa40f..cc5a66f7d9 100644 --- a/tests/auto/uic3/tst_uic3.cpp +++ b/tests/auto/uic3/tst_uic3.cpp @@ -183,7 +183,7 @@ QString tst_uic3::workingDir() const return QDir::cleanPath(SRCDIR); } -QTEST_MAIN(tst_uic3) +QTEST_APPLESS_MAIN(tst_uic3) #include "tst_uic3.moc" #else QTEST_NOOP_MAIN -- cgit v1.2.3 From 2397a17862ff61082639bc7a80daa8a8ac7e9949 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 6 Aug 2009 13:35:28 +0200 Subject: Mac: fix autotest On mac, we prefer testing with mp3 rather than ogg, Because in the latter case, you must install perian to make it work. And the test machines dont. Reviewed-by: brad --- tests/auto/mediaobject/tst_mediaobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp index c1a69f7412..b9fe7907d7 100644 --- a/tests/auto/mediaobject/tst_mediaobject.cpp +++ b/tests/auto/mediaobject/tst_mediaobject.cpp @@ -89,7 +89,7 @@ const qint64 SEEK_BACKWARDS = 2000; const qint64 ALLOWED_TIME_FOR_SEEKING = 1500; // 1.5s const qint64 SEEKING_TOLERANCE = 250; #else -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) || defined(Q_OS_MAC) #define MEDIA_FILE "/sax.mp3" #define MEDIA_FILEPATH ":/media/sax.mp3" #else -- cgit v1.2.3 From 4a1785247d7e845b3d1c2023e43558f6a372581b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 6 Aug 2009 13:44:12 +0200 Subject: Tests: Make uic/uic3 use QLibraryInfo paths as do the linguist tests. --- tests/auto/uic/tst_uic.cpp | 3 ++- tests/auto/uic3/tst_uic3.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/auto/uic/tst_uic.cpp b/tests/auto/uic/tst_uic.cpp index b605aa9298..827b3aa7b8 100644 --- a/tests/auto/uic/tst_uic.cpp +++ b/tests/auto/uic/tst_uic.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #ifndef Q_OS_WINCE @@ -77,7 +78,7 @@ private: tst_uic::tst_uic() : uicExists(true) - , command(QLatin1String("uic")) + , command(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic")) { } diff --git a/tests/auto/uic3/tst_uic3.cpp b/tests/auto/uic3/tst_uic3.cpp index cc5a66f7d9..5c6c6bf6c8 100644 --- a/tests/auto/uic3/tst_uic3.cpp +++ b/tests/auto/uic3/tst_uic3.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #ifndef Q_OS_WINCE @@ -72,7 +73,7 @@ private: tst_uic3::tst_uic3() : uic3Exists(true) - , command(QLatin1String("uic3")) + , command(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic3")) { } -- cgit v1.2.3 From 0d57c5111236c06ace5b2759ddb4c63749a057da Mon Sep 17 00:00:00 2001 From: Octavian Voicu Date: Thu, 6 Aug 2009 14:09:47 +0200 Subject: Fix crash in QX11Data::xdndHandleEnter when XGetWindowProperty fails Task-number: 259143 Merge-request: 1119 Reviewed-by: Denis Dzyubenko --- src/gui/kernel/qdnd_x11.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index a15c20fed7..cc8cc03539 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -825,15 +825,16 @@ void QX11Data::xdndHandleEnter(QWidget *, const XEvent * xe, bool /*passive*/) Atom type = XNone; int f; unsigned long n, a; - unsigned char *retval; + unsigned char *retval = 0; XGetWindowProperty(X11->display, qt_xdnd_dragsource_xid, ATOM(XdndTypelist), 0, qt_xdnd_max_type, False, XA_ATOM, &type, &f,&n,&a,&retval); - Atom *data = (Atom *)retval; - for (; j Date: Thu, 6 Aug 2009 14:45:51 +0200 Subject: Use QFile instead of QTemporaryFile in compilerwarning testcase QTemporaryFile on Windows doesn't open the file as a sharable, and doens't close the file when you call .close(). So the testcase fails on Windows with a Sharing Violation when the compiler tries to compile the file. By switching to QFile we can at least close the file before letting the compiler chew on it, and remove it at the end when the testcase is done. Open the file with Truncate, in case the testcase fails to remove the file. Reviewed-by: trustme --- tests/auto/compilerwarnings/tst_compilerwarnings.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index 2f5cf6caa9..74b7b066f8 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -138,10 +138,11 @@ void tst_CompilerWarnings::warnings() } static QString tmpSourceFile; bool openResult = true; - QString templatePath = QDir::temp().absoluteFilePath("XXXXXX-test.cpp"); - QTemporaryFile tmpQSourceFile(templatePath); + const QString tmpBaseName("XXXXXX-test.cpp"); + QString templatePath = QDir::temp().absoluteFilePath(tmpBaseName); + QFile tmpQSourceFile(templatePath); if (tmpSourceFile.isEmpty()) { - tmpQSourceFile.open(); + tmpQSourceFile.open(QIODevice::ReadWrite | QIODevice::Truncate); tmpSourceFile = tmpQSourceFile.fileName(); QFile cppSource(":/test.cpp"); bool openResult = cppSource.open(QIODevice::ReadOnly); @@ -152,6 +153,7 @@ void tst_CompilerWarnings::warnings() out << in.readAll(); } } + tmpQSourceFile.close(); QVERIFY2(openResult, "Need resource temporary \"test.cpp\""); QStringList args; @@ -228,8 +230,8 @@ void tst_CompilerWarnings::warnings() #ifdef Q_CC_MSVC QString errs = QString::fromLocal8Bit(proc.readAllStandardOutput().constData()); - if (errs.startsWith(tmpSourceFile)) - errs = errs.mid(10); + if (errs.startsWith(tmpBaseName)) + errs = errs.mid(tmpBaseName.size()).simplified();; #else QString errs = QString::fromLocal8Bit(proc.readAllStandardError().constData()); #endif @@ -243,6 +245,8 @@ void tst_CompilerWarnings::warnings() } QCOMPARE(errList.count(), 0); // verbose info how many lines of errors in output QVERIFY(errs.isEmpty()); + + tmpQSourceFile.remove(); } QTEST_APPLESS_MAIN(tst_CompilerWarnings) -- cgit v1.2.3 From 8efe6915c9a6dfa531ec39d5de7e8af34f76dc3c Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 7 Aug 2009 08:32:35 +0200 Subject: Avoid compiling imageformats if you configure with -no-lib* Task-number: 239108 Reviewed-by: Andy Shaw --- configure | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/configure b/configure index e58180afef..2b81cab252 100755 --- a/configure +++ b/configure @@ -5706,7 +5706,9 @@ fi if [ "$CFG_INOTIFY" = "yes" ]; then QT_CONFIG="$QT_CONFIG inotify" fi -if [ "$CFG_LIBJPEG" = "system" ]; then +if [ "$CFG_LIBJPEG" = "no" ]; then + CFG_JPEG="no" +elif [ "$CFG_LIBJPEG" = "system" ]; then QT_CONFIG="$QT_CONFIG system-jpeg" fi if [ "$CFG_JPEG" = "no" ]; then @@ -5714,7 +5716,9 @@ if [ "$CFG_JPEG" = "no" ]; then elif [ "$CFG_JPEG" = "yes" ]; then QT_CONFIG="$QT_CONFIG jpeg" fi -if [ "$CFG_LIBMNG" = "system" ]; then +if [ "$CFG_LIBMNG" = "no" ]; then + CFG_MNG="no" +elif [ "$CFG_LIBMNG" = "system" ]; then QT_CONFIG="$QT_CONFIG system-mng" fi if [ "$CFG_MNG" = "no" ]; then @@ -5738,7 +5742,9 @@ if [ "$CFG_GIF" = "no" ]; then elif [ "$CFG_GIF" = "yes" ]; then QT_CONFIG="$QT_CONFIG gif" fi -if [ "$CFG_LIBTIFF" = "system" ]; then +if [ "$CFG_LIBTIFF" = "no" ]; then + CFG_TIFF="no" +elif [ "$CFG_LIBTIFF" = "system" ]; then QT_CONFIG="$QT_CONFIG system-tiff" fi if [ "$CFG_TIFF" = "no" ]; then -- cgit v1.2.3 From 41d27eac40cecbc0067be9622c9bc1c579582a47 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Aug 2009 13:17:05 +0200 Subject: Autotest: ensure we don't mishandle SSL certificates with NULs This is a vulnerability in some implementations. Qt isn't affected because... well, we never implemented the decoding of escape sequences :-) --- .../more-certificates/badguy-nul-cn.crt | 81 ++++++++++++++++++++++ tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 17 +++++ 2 files changed, 98 insertions(+) create mode 100644 tests/auto/qsslcertificate/more-certificates/badguy-nul-cn.crt diff --git a/tests/auto/qsslcertificate/more-certificates/badguy-nul-cn.crt b/tests/auto/qsslcertificate/more-certificates/badguy-nul-cn.crt new file mode 100644 index 0000000000..b899733bbd --- /dev/null +++ b/tests/auto/qsslcertificate/more-certificates/badguy-nul-cn.crt @@ -0,0 +1,81 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Berkshire, L=Newbury, O=My Company Ltd, OU=CA, CN=NULL-friendly CA + Validity + Not Before: Aug 4 07:33:43 2009 GMT + Not After : Aug 2 07:33:43 2019 GMT + Subject: CN=www.bank.com\x00.badguy.com + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (2048 bit) + Modulus (2048 bit): + 00:cd:26:70:96:a9:a6:5d:3e:9c:ed:0f:08:15:5a: + 7c:17:25:68:68:af:13:b9:ad:41:fa:12:54:e2:84: + 72:7d:58:d1:e2:40:42:c1:59:ed:05:3d:aa:10:53: + 70:00:88:3a:77:a0:c0:56:9e:ac:7d:21:2a:71:44: + 51:08:bc:17:07:da:a8:a3:76:dc:51:bc:1b:8a:f6: + 02:1a:55:bf:46:b4:44:6b:27:5e:be:e5:17:8b:56: + b2:c6:82:36:11:83:a8:bf:f7:2f:0d:17:f6:cd:47: + b5:6f:2b:a6:41:b6:8d:33:5f:ea:ea:8b:b1:1a:e2: + 99:38:ff:59:5b:0a:a1:71:13:ca:37:3f:b9:b0:1e: + 91:9a:c8:93:35:0c:4a:e0:9d:f4:d2:61:c7:4e:5b: + 41:0a:7c:31:54:99:db:f5:65:ce:80:d3:c2:02:37: + 64:fd:54:12:7b:ea:ac:85:59:5c:17:e1:2e:f6:d0: + a8:f2:d0:2e:94:59:2f:c2:a6:5f:da:07:de:7b:2e: + 14:07:ed:e4:27:24:37:9d:09:2e:b1:f9:5a:48:b9: + 80:24:43:e6:cb:c7:6e:35:df:d5:69:34:ff:e6:d6: + 9e:e8:76:66:6e:5f:59:01:3c:96:3b:ec:72:0b:3c: + 1e:95:0f:ce:68:13:9c:22:dd:1b:b5:44:28:50:4a: + 05:7f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 33:15:24:BE:DA:66:3A:06:8B:D9:27:34:3A:AF:62:40:E4:95:66:5D + X509v3 Authority Key Identifier: + keyid:0A:69:39:5F:9D:30:04:18:08:2E:02:0E:E6:EA:9D:B2:26:F6:E2:6A + + Signature Algorithm: sha1WithRSAEncryption + 32:65:23:1f:c8:d9:53:84:82:d0:0a:eb:14:51:24:03:bc:6c: + 1b:2a:5a:fe:1b:f0:e8:69:0c:2b:19:86:cf:7f:32:76:d8:2b: + d2:cf:8b:c4:d1:b6:5b:9c:60:a3:99:2e:92:72:06:ce:de:8b: + d2:a2:d2:89:7c:13:a9:0b:4e:be:12:09:e5:d6:28:3a:ac:a7: + 26:56:94:7f:13:ee:64:7d:de:94:60:75:c1:bc:55:97:d4:aa: + 13:8e:02:d8:b0:b0:70:53:ae:18:53:ce:aa:b2:2c:85:3e:e3: + f3:e1:26:f3:fa:5c:ee:f8:7b:0b:c6:39:b5:04:33:5e:ae:b8: + 5e:0e:66:cc:a8:c0:6a:0d:ec:60:c1:c5:d9:39:ea:bd:1b:8f: + 1c:7d:16:38:b1:e8:c8:37:01:aa:4b:99:df:e4:0f:10:be:61: + ee:9a:cf:cd:27:05:46:00:60:d8:6a:74:08:32:3c:8b:90:01: + 6a:07:33:0c:6c:90:db:ea:fb:6a:17:1a:76:bb:73:14:27:e1: + a4:7e:d5:dd:30:b1:5d:f2:0e:aa:d4:b2:d5:4c:f6:4f:91:2a: + 07:f4:37:c1:cf:48:19:c5:fe:7e:92:96:a8:df:50:6a:31:92: + a3:b1:14:fe:41:cc:49:62:98:4d:ea:c5:ba:05:2d:49:c3:22: + 72:ef:41:09 +-----BEGIN CERTIFICATE----- +MIIDjTCCAnWgAwIBAgIBATANBgkqhkiG9w0BAQUFADB0MQswCQYDVQQGEwJHQjES +MBAGA1UECBMJQmVya3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcwFQYDVQQKEw5N +eSBDb21wYW55IEx0ZDELMAkGA1UECxMCQ0ExGTAXBgNVBAMTEE5VTEwtZnJpZW5k +bHkgQ0EwHhcNMDkwODA0MDczMzQzWhcNMTkwODAyMDczMzQzWjAjMSEwHwYDVQQD +Exh3d3cuYmFuay5jb20ALmJhZGd1eS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDNJnCWqaZdPpztDwgVWnwXJWhorxO5rUH6ElTihHJ9WNHiQELB +We0FPaoQU3AAiDp3oMBWnqx9ISpxRFEIvBcH2qijdtxRvBuK9gIaVb9GtERrJ16+ +5ReLVrLGgjYRg6i/9y8NF/bNR7VvK6ZBto0zX+rqi7Ea4pk4/1lbCqFxE8o3P7mw +HpGayJM1DErgnfTSYcdOW0EKfDFUmdv1Zc6A08ICN2T9VBJ76qyFWVwX4S720Kjy +0C6UWS/Cpl/aB957LhQH7eQnJDedCS6x+VpIuYAkQ+bLx24139VpNP/m1p7odmZu +X1kBPJY77HILPB6VD85oE5wi3Ru1RChQSgV/AgMBAAGjezB5MAkGA1UdEwQCMAAw +LAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0G +A1UdDgQWBBQzFSS+2mY6BovZJzQ6r2JA5JVmXTAfBgNVHSMEGDAWgBQKaTlfnTAE +GAguAg7m6p2yJvbiajANBgkqhkiG9w0BAQUFAAOCAQEAMmUjH8jZU4SC0ArrFFEk +A7xsGypa/hvw6GkMKxmGz38ydtgr0s+LxNG2W5xgo5kuknIGzt6L0qLSiXwTqQtO +vhIJ5dYoOqynJlaUfxPuZH3elGB1wbxVl9SqE44C2LCwcFOuGFPOqrIshT7j8+Em +8/pc7vh7C8Y5tQQzXq64Xg5mzKjAag3sYMHF2TnqvRuPHH0WOLHoyDcBqkuZ3+QP +EL5h7prPzScFRgBg2Gp0CDI8i5ABagczDGyQ2+r7ahcadrtzFCfhpH7V3TCxXfIO +qtSy1Uz2T5EqB/Q3wc9IGcX+fpKWqN9QajGSo7EU/kHMSWKYTerFugUtScMicu9B +CQ== +-----END CERTIFICATE----- diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index 7fd92d6358..80ac228f7a 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -100,6 +100,7 @@ private slots: void fromPath(); void certInfo(); void task256066toPem(); + void nulInCN(); // ### add tests for certificate bundles (multiple certificates concatenated into a single // structure); both PEM and DER formatted #endif @@ -727,6 +728,22 @@ void tst_QSslCertificate::task256066toPem() QCOMPARE(pem1, pem2); } +void tst_QSslCertificate::nulInCN() +{ + QList certList = + QSslCertificate::fromPath(SRCDIR "more-certificates/badguy-nul-cn.crt"); + QCOMPARE(certList.size(), 1); + + const QSslCertificate &cert = certList.at(0); + QVERIFY(!cert.isNull()); + + QString cn = cert.subjectInfo(QSslCertificate::CommonName); + QVERIFY(cn != "www.bank.com"); + + static const char realCN[] = "www.bank.com\\x00.badguy.com"; + QCOMPARE(cn, QString::fromLatin1(realCN, sizeof realCN - 1)); +} + #endif // QT_NO_OPENSSL QTEST_MAIN(tst_QSslCertificate) -- cgit v1.2.3 From 79c488a28819b58eed519fb3df2705b8c6e35e05 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Jul 2009 17:22:11 +0200 Subject: Add functionality tests for XSync. It was reported to be auto-detected, but wasn't. Apparently, AIX 6's X11 doesn't have this. Reviewed-By: Denis Dzyubenko (cherry picked from commit 0a63875d787e1b035ace2c76fa1d0de6329127d7) --- config.tests/x11/xsync/xsync.cpp | 11 +++++++++++ config.tests/x11/xsync/xsync.pro | 3 +++ configure | 36 +++++++++++++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 config.tests/x11/xsync/xsync.cpp create mode 100644 config.tests/x11/xsync/xsync.pro diff --git a/config.tests/x11/xsync/xsync.cpp b/config.tests/x11/xsync/xsync.cpp new file mode 100644 index 0000000000..a23fb08af1 --- /dev/null +++ b/config.tests/x11/xsync/xsync.cpp @@ -0,0 +1,11 @@ +#include +#include +#include + +int main(int, char **) +{ + XSyncValue value; + (void*)&XSyncIntToValue; + (void*)&XSyncCreateCounter; + return 0; +} diff --git a/config.tests/x11/xsync/xsync.pro b/config.tests/x11/xsync/xsync.pro new file mode 100644 index 0000000000..58b82383ea --- /dev/null +++ b/config.tests/x11/xsync/xsync.pro @@ -0,0 +1,3 @@ +CONFIG += x11 +CONFIG -= qt +SOURCES = xsync.cpp diff --git a/configure b/configure index 2b81cab252..b5baadb540 100755 --- a/configure +++ b/configure @@ -570,6 +570,7 @@ CFG_DEBUG_RELEASE=no CFG_SHARED=yes CFG_SM=auto CFG_XSHAPE=auto +CFG_XSYNC=auto CFG_XINERAMA=runtime CFG_XFIXES=runtime CFG_ZLIB=auto @@ -831,7 +832,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-svg|-webkit|-scripttools|-rpath|-force-pkg-config) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xshape|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-svg|-webkit|-scripttools|-rpath|-force-pkg-config) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1419,6 +1420,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + xsync) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_XSYNC="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; xinput) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then CFG_XINPUT="$VAL" @@ -3480,6 +3488,10 @@ Qt/X11 only: $SHY -xshape ............ Compile XShape support. Requires X11/extensions/shape.h. + $SHN -no-xsync .......... Do not compile XSync support. + $SHY -xsync ............. Compile XSync support. + Requires X11/extensions/sync.h. + $XAN -no-xinerama ....... Do not compile Xinerama (multihead) support. $XAY -xinerama .......... Compile Xinerama support. Requires X11/extensions/Xinerama.h and libXinerama. @@ -4993,6 +5005,23 @@ if [ "$PLATFORM_X11" = "yes" ]; then fi fi + # auto-detect XSync support + if [ "$CFG_XSYNC" != "no" ]; then + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xsync "XSync" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then + CFG_XSYNC=yes + else + if [ "$CFG_XSYNC" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then + echo "XSync support cannot be enabled due to functionality tests!" + echo " Turn on verbose messaging (-v) to $0 to see the final report." + echo " If you believe this message is in error you may use the continue" + echo " switch (-continue) to $0 to continue." + exit 101 + else + CFG_XSYNC=no + fi + fi + fi + # auto-detect Xinerama support if [ "$CFG_XINERAMA" != "no" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinerama "Xinerama" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then @@ -5791,6 +5820,9 @@ if [ "$PLATFORM_X11" = "yes" ]; then if [ "$CFG_XSHAPE" = "yes" ]; then QT_CONFIG="$QT_CONFIG xshape" fi + if [ "$CFG_XSYNC" = "yes" ]; then + QT_CONFIG="$QT_CONFIG xsync" + fi if [ "$CFG_XINERAMA" = "yes" ]; then QT_CONFIG="$QT_CONFIG xinerama" QMakeVar set QMAKE_LIBS_X11 '-lXinerama $$QMAKE_LIBS_X11' @@ -6503,6 +6535,7 @@ fi [ "$CFG_XRENDER" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRENDER" [ "$CFG_MITSHM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MITSHM" [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE" +[ "$CFG_XSYNC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC" [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET" [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR" @@ -6944,6 +6977,7 @@ fi if [ "$PLATFORM_X11" = "yes" ]; then echo "NAS sound support ... $CFG_NAS" echo "XShape support ...... $CFG_XSHAPE" + echo "XSync support ....... $CFG_XSYNC" echo "Xinerama support .... $CFG_XINERAMA" echo "Xcursor support ..... $CFG_XCURSOR" echo "Xfixes support ...... $CFG_XFIXES" -- cgit v1.2.3 From 923134936e132e857b663c4837f66565dfa3d9e6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Jul 2009 15:38:27 +0200 Subject: xlC 7 cannot compile QtConcurrent with these templates here (cherry picked from commit cb64ac587249f5dc6563a035e2ef5a3ad2bc5d13) --- src/corelib/concurrent/qfuture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/concurrent/qfuture.h b/src/corelib/concurrent/qfuture.h index 47015ee661..f2db5ac188 100644 --- a/src/corelib/concurrent/qfuture.h +++ b/src/corelib/concurrent/qfuture.h @@ -210,7 +210,7 @@ public: bool operator==(const QFuture &other) const { return (d == other.d); } bool operator!=(const QFuture &other) const { return (d != other.d); } -#ifndef QT_NO_MEMBER_TEMPLATES +#if !defined(QT_NO_MEMBER_TEMPLATES) && !defined(Q_CC_XLC) template QFuture(const QFuture &other) : d(other.d) -- cgit v1.2.3 From 3eb12a43e3cf673ec0608833551b25f153af1aa3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 30 Jul 2009 16:40:06 +0200 Subject: Fix compilation with xlC 7: operands to ?: must match. "../shared/qm.cpp", line 556.45: 1540-0207 (S) No common type found for operands with type "const char [7]" and "QByteArray". Reviewed-by: Trust Me (cherry picked from commit 3ae2cab9c8bd1790a00da2755ac036143a3a35f4) --- tools/linguist/shared/qm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index 381f5c5df2..231ec842a3 100644 --- a/tools/linguist/shared/qm.cpp +++ b/tools/linguist/shared/qm.cpp @@ -546,7 +546,7 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) //qDebug() << "NUMITEMS: " << numItems; QTextCodec *codec = QTextCodec::codecForName( - cd.m_codecForSource.isEmpty() ? "Latin1" : cd.m_codecForSource); + cd.m_codecForSource.isEmpty() ? QByteArray("Latin1") : cd.m_codecForSource); QTextCodec *utf8Codec = 0; if (codec->name() != "UTF-8") utf8Codec = QTextCodec::codecForName("UTF-8"); -- cgit v1.2.3 From c39436c722e778460366995877d66a8935d2d636 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 31 Jul 2009 10:30:44 +0200 Subject: Fix compilation with xlC 7: operands to ?: must match. See 3ae2cab9c8bd1790a00da2755ac036143a3a35f4 for another similar fix. Reviewed-by: Trust Me (cherry picked from commit 18fbfdf0f774198e2e1277e064cc3a8eb9dbb29d) --- tools/linguist/shared/po.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/linguist/shared/po.cpp b/tools/linguist/shared/po.cpp index 4850cfdeeb..575e751e79 100644 --- a/tools/linguist/shared/po.cpp +++ b/tools/linguist/shared/po.cpp @@ -359,7 +359,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) const QChar quote = QLatin1Char('"'); const QChar newline = QLatin1Char('\n'); QTextStream in(&dev); - in.setCodec(cd.m_codecForSource.isEmpty() ? "UTF-8" : cd.m_codecForSource); + in.setCodec(cd.m_codecForSource.isEmpty() ? QByteArray("UTF-8") : cd.m_codecForSource); bool error = false; // format of a .po file entry: @@ -552,7 +552,7 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd) { bool ok = true; QTextStream out(&dev); - out.setCodec(cd.m_outputCodec.isEmpty() ? "UTF-8" : cd.m_outputCodec); + out.setCodec(cd.m_outputCodec.isEmpty() ? QByteArray("UTF-8") : cd.m_outputCodec); bool first = true; if (translator.messages().isEmpty() || !translator.messages().first().sourceText().isEmpty()) { -- cgit v1.2.3