From 64a3a29cfe165ac5906be61ac56689dd04811a83 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 9 Sep 2009 15:38:00 +1000 Subject: Make configure show the correct license namefor tech previews. Task-number: 261031 Reviewed-by: Trust Me --- LICENSE.PREVIEW.COMMERCIAL | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LICENSE.PREVIEW.COMMERCIAL b/LICENSE.PREVIEW.COMMERCIAL index 072c7e8..45740cb 100644 --- a/LICENSE.PREVIEW.COMMERCIAL +++ b/LICENSE.PREVIEW.COMMERCIAL @@ -1,3 +1,5 @@ +TECHNOLOGY PREVIEW LICENSE AGREEMENT + For individuals and/or legal entities resident in the Americas (North America, Central America and South America), the applicable licensing terms are specified under the heading "Technology Preview License -- cgit v0.12 From 8cb263eeaffa2948477a8b3a1c8512f94ec9bb0b Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 9 Sep 2009 13:58:16 +0200 Subject: QHttpNetworkConnection autotest: include zlib dir test was not building Reviewed-by: Trust Me --- tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro index bc750c5..43284b3 100644 --- a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -1,4 +1,5 @@ load(qttest_p4) SOURCES += tst_qhttpnetworkconnection.cpp +INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib QT = core network -- cgit v0.12 From d6993e7d88750a55d62bf5acbe7e7d03069dfbdf Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 9 Sep 2009 14:27:18 +0200 Subject: Avoid garbled output on Windows for non-ascii-compatible text In the Windows print engine, we try to send a text item as a raw string of characters to the printer driver if this is possible. This is to facilitate using PDF-printers as much as possible, allowing them to save the text in the document so for searching etc. We can only safely do this if all the characters in the string are ASCII-compatible, i.e. in the 7 bit range, since this is the only part of the set which is guaranteed to be compatible across code pages. Task-number: 180655 Reviewed-by: Trond --- src/gui/painting/qprintengine_win.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp index d239581..96e8cff 100644 --- a/src/gui/painting/qprintengine_win.cpp +++ b/src/gui/painting/qprintengine_win.cpp @@ -400,11 +400,11 @@ void QWin32PrintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem return ; } - // We only want to convert the glyphs to text if the entire string is latin1 - bool latin1String = true; + // We only want to convert the glyphs to text if the entire string is compatible with ASCII + bool convertToText = true; for (int i=0; i < ti.num_chars; ++i) { - if (ti.chars[i].unicode() >= 0x100) { - latin1String = false; + if (ti.chars[i].unicode() >= 0x80) { + convertToText = false; break; } } @@ -414,7 +414,7 @@ void QWin32PrintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem SelectObject(d->hdc, CreatePen(PS_SOLID, 1, cf)); SetTextColor(d->hdc, cf); - draw_text_item_win(p, ti, d->hdc, latin1String, d->matrix, d->devPaperRect.topLeft()); + draw_text_item_win(p, ti, d->hdc, convertToText, d->matrix, d->devPaperRect.topLeft()); DeleteObject(SelectObject(d->hdc,GetStockObject(HOLLOW_BRUSH))); DeleteObject(SelectObject(d->hdc,GetStockObject(BLACK_PEN))); } -- cgit v0.12 From 0d1677a6e42aee1d9700cc57f053da59879ba3fb Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 9 Sep 2009 14:42:05 +0200 Subject: tst_qhostinfo: Backported some 4.6 fixes, increased timeout --- tests/auto/qhostinfo/tst_qhostinfo.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index c632eb7..1fd805a 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -214,10 +214,7 @@ void tst_QHostInfo::lookupIPv4_data() QTest::newRow("empty") << "" << "" << int(QHostInfo::HostNotFound); - QTest::newRow("lupinella_00") << "l" << lupinellaIp << int(QHostInfo::NoError); - QTest::newRow("lupinella_01") << "lupinella" << lupinellaIp << int(QHostInfo::NoError); - QTest::newRow("lupinella_02") << "lupinella.troll.no" << lupinellaIp << int(QHostInfo::NoError); - QTest::newRow("lupinella_03") << "lupinella.trolltech.com" << lupinellaIp << int(QHostInfo::NoError); + QTest::newRow("single_ip4") << "lupinella.troll.no" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError); QTest::newRow("literal_ip4") << lupinellaIp << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("notfound") << "this-name-does-not-exist-hopefully." << "" << int(QHostInfo::HostNotFound); @@ -235,7 +232,7 @@ void tst_QHostInfo::lookupIPv4() lookupDone = false; QHostInfo::lookupHost(hostname, this, SLOT(resultsReady(const QHostInfo&))); - QTestEventLoop::instance().enterLoop(3); + QTestEventLoop::instance().enterLoop(10); QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(lookupDone); @@ -305,8 +302,8 @@ void tst_QHostInfo::reverseLookup_data() // ### Use internal DNS instead. Discussed with Andreas. //QTest::newRow("classical.hexago.com") << QString("2001:5c0:0:2::24") << QStringList(QString("classical.hexago.com")) << 0; - QTest::newRow("www.cisco.com") << QString("198.133.219.25") << QStringList(QString("origin-www.cisco.com")) << 0; - QTest::newRow("bogusexample.doenstexist.org") << QString("1::2::3::4") << QStringList() << 1; + QTest::newRow("origin.cisco.com") << QString("12.159.148.94") << QStringList(QString("origin.cisco.com")) << 0; + QTest::newRow("bogus-name") << QString("1::2::3::4") << QStringList() << 1; } void tst_QHostInfo::reverseLookup() -- cgit v0.12 From e5bb1e69a0c3165f92edebf9152dfd41bdab712f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 9 Sep 2009 15:51:47 +0200 Subject: Autotest: fix the test for NUL in SAN. It was missing "www". Reviewed-by: Marius Bugge Monsen --- tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index 2f0c3a4..f41803c 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -761,7 +761,7 @@ void tst_QSslCertificate::nulInSan() QVERIFY(!dnssan.isEmpty()); QVERIFY(dnssan != "www.bank.com"); - static const char realSAN[] = "www.bank.com\0.badguy.com"; + static const char realSAN[] = "www.bank.com\0www.badguy.com"; QCOMPARE(dnssan, QString::fromLatin1(realSAN, sizeof realSAN - 1)); } -- cgit v0.12 From a77cc371917f7cda40e823b530693d38b85e666b Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 9 Sep 2009 16:55:13 +0200 Subject: Doc: Note that Netscape plugins are only available on desktop platforms. Reviewed-by: Takumi Asaki Also-applied-as: 3f257dcf8c8ca812d60d4a6a4c2cd2da96bba526 --- src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index 06305e0..6ad2183 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -94,14 +94,18 @@ \section1 Netscape Plugin Support + \note Netscape plugin support is only available on desktop platforms. + Since WebKit supports the Netscape Plugin API, Qt applications can display - Web pages that embed common plugins, as long as the user has the appropriate - binary files for those plugins installed. + Web pages that embed common plugins on platforms for which those plugins + are available. To enable plugin support, the user must have the appropriate + binary files for those plugins installed and the \l{QWebSettings::PluginsEnabled} + attribute must be enabled for the application. The following locations are searched for plugins: \table - \header \o Linux/Unix \o Windows + \header \o Linux/Unix (X11) \o Windows \row \o{1,3} \list \o \c{.mozilla/plugins} in the user's home directory -- cgit v0.12 From b19372c11549bc1f88b3e59fa94745645503b8e6 Mon Sep 17 00:00:00 2001 From: Bill King Date: Tue, 1 Sep 2009 13:08:02 +1000 Subject: Fixes determination of end of odbc string on deficient driver Ported this fix backwards from 4.6 to 4.5 Adds some cleanups (using QVarLengthArray), and reverting to the initial and correct calculation (when the driver doesn't deem fit to return SQL_NO_DATA). --- src/sql/drivers/odbc/qsql_odbc.cpp | 12 ++++---- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 41 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index ae522ee..a5c713d 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -314,12 +314,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni colSize *= 2; // a tiny bit faster, since it saves a SQLGetData() call } } - char* buf = new char[colSize]; + QVarLengthArray buf(colSize); while (true) { r = SQLGetData(hStmt, column+1, unicode ? SQL_C_WCHAR : SQL_C_CHAR, - (SQLPOINTER)buf, + (SQLPOINTER)buf.data(), colSize, &lengthIndicator); if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) { @@ -334,11 +334,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni // colSize-1: remove 0 termination when there is more data to fetch int rSize = (r == SQL_SUCCESS_WITH_INFO) ? (unicode ? colSize-2 : colSize-1) : lengthIndicator; if (unicode) { - fieldVal += QString((QChar*) buf, rSize / 2); + fieldVal += QString((const QChar*) buf.constData(), rSize / 2); } else { - fieldVal += QString::fromAscii(buf, rSize); + fieldVal += QString::fromAscii(buf.constData(), rSize); } - if (lengthIndicator - fieldVal.size() <= 0) { + memset(buf.data(), 0, colSize); + if (lengthIndicator < colSize) { // workaround for Drivermanagers that don't return SQL_NO_DATA break; } @@ -350,7 +351,6 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni break; } } - delete[] buf; return fieldVal; } diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index 782bff8..9ca48f5 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -180,6 +180,8 @@ private slots: void odbc_uintfield(); void odbc_bindBoolean_data() { generic_data("QODBC"); } void odbc_bindBoolean(); + void odbc_testqGetString_data() { generic_data("QODBC"); } + void odbc_testqGetString(); void oci_serverDetach_data() { generic_data("QOCI"); } void oci_serverDetach(); // For task 154518 @@ -347,6 +349,7 @@ void tst_QSqlDatabase::dropTestTables(QSqlDatabase db) << qTableName("numericfields") << qTableName("qtest_ibaseblobs") << qTableName("qtestBindBool") + << qTableName("testqGetString") << qTableName("qtest_sqlguid") << qTableName("uint_table") << qTableName("uint_test") @@ -2005,6 +2008,44 @@ void tst_QSqlDatabase::odbc_bindBoolean() QCOMPARE(q.value(1).toBool(), false); } +void tst_QSqlDatabase::odbc_testqGetString() +{ + QFETCH(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + QSqlQuery q(db); + QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(65538))")); + + QString largeString; + largeString.fill('A', 65536); + + // Bind and insert + QVERIFY_SQL(q, prepare("INSERT INTO " + qTableName("testqGetString") + " VALUES(?, ?)")); + q.bindValue(0, 1); + q.bindValue(1, largeString); + QVERIFY_SQL(q, exec()); + q.bindValue(0, 2); + q.bindValue(1, largeString+QLatin1Char('B')); + QVERIFY_SQL(q, exec()); + q.bindValue(0, 3); + q.bindValue(1, largeString+QLatin1Char('B')+QLatin1Char('C')); + QVERIFY_SQL(q, exec()); + + // Retrive + QVERIFY_SQL(q, exec("SELECT id, vcvalue FROM " + qTableName("testqGetString") + " ORDER BY id")); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 1); + QCOMPARE(q.value(1).toString().length(), 65536); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 2); + QCOMPARE(q.value(1).toString().length(), 65537); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 3); + QCOMPARE(q.value(1).toString().length(), 65538); +} + + void tst_QSqlDatabase::mysql_multiselect() { QFETCH(QString, dbName); -- cgit v0.12 From df4033a1f7ef0786fba6d4d2027e38a2fffd1e27 Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 9 Sep 2009 13:37:09 +1000 Subject: Fixes autotest for MS SQL Server Merging fix back into 4.5 tree --- tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index 9ca48f5..a3a4712 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -2015,7 +2015,10 @@ void tst_QSqlDatabase::odbc_testqGetString() CHECK_DATABASE(db); QSqlQuery q(db); - QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(65538))")); + if (tst_Databases::isSqlServer(db)) + QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(MAX))")); + else + QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(65538))")); QString largeString; largeString.fill('A', 65536); -- cgit v0.12