From 11f192c2bc15b468379032f329d8805aac4a0886 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 18 Nov 2009 10:08:04 +0100 Subject: doc: Added note about which MinGW package to use and where to get it. Task-number: QTBUG-5764 --- doc/src/platforms/compiler-notes.qdoc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/src/platforms/compiler-notes.qdoc b/doc/src/platforms/compiler-notes.qdoc index 4577bf0..cbe5ad6 100644 --- a/doc/src/platforms/compiler-notes.qdoc +++ b/doc/src/platforms/compiler-notes.qdoc @@ -97,12 +97,24 @@ \o mingw32-make 3.80.0-3 \endlist + \note For users of the MinGW binary package: This package is now + based on MinGW 4.4. The installer no longer offers to download + MinGW for you, but rather offers to use a version of MinGW that + you already have installed on your machine. You just tell the + installer which directory MinGW is installed in. If you don't + already have MinGW 4.4 installed, you can download a .zip archive + from our \l{ftp://ftp.trolltech.com/misc/MinGW-gcc440_1.zip} {ftp + site}. This archive provides fixes to MinGW and support for + missing API, See the _patches directory in the archive for + details. + \section2 GCC 4.0.0 - The released package of the compiler has some bugs that lead to miscompilations. - We recommend using GCC 4.0.1 or later, or to use a recent CVS snapshot of the - GCC 4.0 branch. The version of GCC 4.0.0 that is shipped with Mac OS X 10.4 - "Tiger" is known to work with Qt for Mac OS X. + The released package of the compiler has some bugs that lead to + miscompilations. We recommend using GCC 4.0.1 or later, or to use + a recent CVS snapshot of the GCC 4.0 branch. The version of GCC + 4.0.0 that is shipped with Mac OS X 10.4 "Tiger" is known to work + with Qt for Mac OS X. \section2 HP-UX -- cgit v0.12 From 422ed1c94869e4a93a14602beef69f5b08941060 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 18 Nov 2009 10:13:19 +0100 Subject: doc: Added a further note about what the MinGW package is needed for. Task-number: QTBUG-5764 --- doc/src/platforms/compiler-notes.qdoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/src/platforms/compiler-notes.qdoc b/doc/src/platforms/compiler-notes.qdoc index cbe5ad6..88e1e37 100644 --- a/doc/src/platforms/compiler-notes.qdoc +++ b/doc/src/platforms/compiler-notes.qdoc @@ -108,6 +108,10 @@ missing API, See the _patches directory in the archive for details. + \note A MinGW installation is only needed to build against the + binary pacakge, not to run the pre-compiled binaries that are in + the package. + \section2 GCC 4.0.0 The released package of the compiler has some bugs that lead to -- cgit v0.12 From 83c61c4dfb2425d92eced3b41d61b153a286a242 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 18 Nov 2009 12:07:15 +0100 Subject: remove unneeded JavaScriptCore.pro The file was erroneously imported from WebKit trunk. It is not used when building QtScript, and the only practical effect it has is to cause configure to spit out a warning. Reviewed-by: Simon Hausmann --- .../JavaScriptCore/JavaScriptCore.pro | 69 ---------------------- 1 file changed, 69 deletions(-) delete mode 100644 src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pro diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pro b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pro deleted file mode 100644 index 0cd2e1a..0000000 --- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pro +++ /dev/null @@ -1,69 +0,0 @@ -# JavaScriptCore - qmake build info -CONFIG += building-libs -include($$PWD/../WebKit.pri) - -TEMPLATE = lib -CONFIG += staticlib -TARGET = JavaScriptCore - -CONFIG += depend_includepath - -contains(QT_CONFIG, embedded):CONFIG += embedded - -CONFIG(QTDIR_build) { - GENERATED_SOURCES_DIR = $$PWD/generated - OLDDESTDIR = $$DESTDIR - include($$QT_SOURCE_TREE/src/qbase.pri) - INSTALLS = - DESTDIR = $$OLDDESTDIR - PRECOMPILED_HEADER = $$PWD/../WebKit/qt/WebKit_pch.h - DEFINES *= NDEBUG -} - -isEmpty(GENERATED_SOURCES_DIR):GENERATED_SOURCES_DIR = tmp -GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP} - -INCLUDEPATH += $$GENERATED_SOURCES_DIR - -!CONFIG(QTDIR_build) { - CONFIG(debug, debug|release) { - OBJECTS_DIR = obj/debug - } else { # Release - OBJECTS_DIR = obj/release - } -} - -CONFIG(release):!CONFIG(QTDIR_build) { - contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols - unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions -} - -linux-*: DEFINES += HAVE_STDINT_H -freebsd-*: DEFINES += HAVE_PTHREAD_NP_H - -DEFINES += BUILD_WEBKIT - -win32-*: DEFINES += _HAS_TR1=0 - -# Pick up 3rdparty libraries from INCLUDE/LIB just like with MSVC -win32-g++ { - TMPPATH = $$quote($$(INCLUDE)) - QMAKE_INCDIR_POST += $$split(TMPPATH,";") - TMPPATH = $$quote($$(LIB)) - QMAKE_LIBDIR_POST += $$split(TMPPATH,";") -} - -DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1 - -DEFINES += WTF_CHANGES=1 - -include(JavaScriptCore.pri) - -QMAKE_EXTRA_TARGETS += generated_files - -lessThan(QT_MINOR_VERSION, 4) { - DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE="" -} - -*-g++*:QMAKE_CXXFLAGS_RELEASE -= -O2 -*-g++*:QMAKE_CXXFLAGS_RELEASE += -O3 -- cgit v0.12 From d5a92bdd3f0f355a05b8f6ceac577f0c12c3bd5d Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 13 Nov 2009 14:45:28 +0100 Subject: Doc: List planned changes to platform support in Qt 4.7 --- doc/src/platforms/supported-platforms.qdoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc index 560ddfe..1609b55 100644 --- a/doc/src/platforms/supported-platforms.qdoc +++ b/doc/src/platforms/supported-platforms.qdoc @@ -155,4 +155,21 @@ warranties and conditions, either express or implied, including, but not limited to, implied warranties of merchantability, fitness for a particular purpose, title and non-infringement with regard to the Licensed Software. + + \section1 Planned Changes for Qt 4.7 + + The following changes to the list of supported platforms are at time of publishing + planned for Qt 4.7: + + \list + \o Upgrade Windows 7 to Tier 1 + \o Upgrade Mac OS X 10.6 to Tier 1 + \o Add support for Visual Studio 2010 (Tier 2) + \o Move support for Carbon implementation of Qt on Mac OS X from Tier 1 to Tier 2 + \o Drop support for MinGW 3.4 + \o Drop support for Visual Studio 2003 + \o Drop support for HP-UX on PA-RISC + \o Drop support for Windows Mobile 5 + \o Drop support for OpenGL ES Common Lite + \endlist */ -- cgit v0.12 From 9f5dea393da4428685f1a1fd26b0e27f90dca340 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 17 Nov 2009 13:14:49 +0100 Subject: fancybrowser example: make sure that images are rotated for loaded pages See QTBUG-5532. Reviewed-by: Jedrzej Nowacki --- doc/src/examples/fancybrowser.qdoc | 4 ++++ examples/webkit/fancybrowser/mainwindow.cpp | 8 +++++--- examples/webkit/fancybrowser/mainwindow.h | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/src/examples/fancybrowser.qdoc b/doc/src/examples/fancybrowser.qdoc index bc63010..4a9eaec 100644 --- a/doc/src/examples/fancybrowser.qdoc +++ b/doc/src/examples/fancybrowser.qdoc @@ -119,6 +119,10 @@ page is loaded. Once the jQuery library is loaded, we can start executing the different jQuery functions in the browser. + The rotateImages() function is then called explicitely to make sure + that the images of the newly loaded page respect the state of the toggle + action. + \snippet examples/webkit/fancybrowser/mainwindow.cpp 7 The first jQuery-based function, \c highlightAllLinks(), is designed to diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp index 11fac91..3f20bbc 100644 --- a/examples/webkit/fancybrowser/mainwindow.cpp +++ b/examples/webkit/fancybrowser/mainwindow.cpp @@ -82,7 +82,7 @@ MainWindow::MainWindow() QMenu *effectMenu = menuBar()->addMenu(tr("&Effect")); effectMenu->addAction("Highlight all links", this, SLOT(highlightAllLinks())); - QAction *rotateAction = new QAction(this); + rotateAction = new QAction(this); rotateAction->setIcon(style()->standardIcon(QStyle::SP_FileDialogDetailedView)); rotateAction->setCheckable(true); rotateAction->setText(tr("Turn images upside down")); @@ -136,6 +136,8 @@ void MainWindow::finishLoading(bool) progress = 100; adjustTitle(); view->page()->mainFrame()->evaluateJavaScript(jQuery); + + rotateImages(rotateAction->isChecked()); } //! [6] @@ -148,10 +150,10 @@ void MainWindow::highlightAllLinks() //! [7] //! [8] -void MainWindow::rotateImages(bool toggle) +void MainWindow::rotateImages(bool invert) { QString code; - if (toggle) + if (invert) code = "$('img').each( function () { $(this).css('-webkit-transition', '-webkit-transform 2s'); $(this).css('-webkit-transform', 'rotate(180deg)') } )"; else code = "$('img').each( function () { $(this).css('-webkit-transition', '-webkit-transform 2s'); $(this).css('-webkit-transform', 'rotate(0deg)') } )"; diff --git a/examples/webkit/fancybrowser/mainwindow.h b/examples/webkit/fancybrowser/mainwindow.h index 33fd8f5..214d84b 100644 --- a/examples/webkit/fancybrowser/mainwindow.h +++ b/examples/webkit/fancybrowser/mainwindow.h @@ -63,7 +63,7 @@ protected slots: void finishLoading(bool); void highlightAllLinks(); - void rotateImages(bool toggle); + void rotateImages(bool invert); void removeGifImages(); void removeInlineFrames(); void removeObjectElements(); @@ -73,6 +73,7 @@ private: QString jQuery; QWebView *view; QLineEdit *locationEdit; + QAction *rotateAction; int progress; //! [1] }; -- cgit v0.12 From 0ff77fe68850ad6448f644c3ee11b3a7914bb8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 18 Nov 2009 11:54:53 +0100 Subject: Fix regression introduced in 98a05681851db9d88b1364af52be543715fbe306 Some network tests were set up to ignore a qWarning that was removed. Fixed those tests. Made warning from QIODevice::getChar have the right function name. Reviewed-by: Thiago Macieira --- src/corelib/io/qiodevice.cpp | 3 +++ tests/auto/qsslsocket/tst_qsslsocket.cpp | 1 - tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 3 --- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index e4e6a15..b84961f 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1404,6 +1404,9 @@ bool QIODevicePrivate::putCharHelper(char c) */ bool QIODevice::getChar(char *c) { + Q_D(QIODevice); + CHECK_READABLE(getChar, false); + char ch; return (1 == read(c ? c : &ch, 1)); } diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index db46b66..169a688 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -347,7 +347,6 @@ void tst_QSslSocket::constructing() QCOMPARE(socket.sslConfiguration(), QSslConfiguration::defaultConfiguration()); QCOMPARE(socket.errorString(), QString("Unknown error")); char c = '\0'; - QTest::ignoreMessage(QtWarningMsg, "QIODevice::getChar: Closed device"); QVERIFY(!socket.getChar(&c)); QCOMPARE(c, '\0'); QVERIFY(!socket.isOpen()); diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index 4ed9fca..aaa207b 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -371,7 +371,6 @@ void tst_QTcpSocket::constructing() QCOMPARE(socket->socketType(), QTcpSocket::TcpSocket); char c; - QTest::ignoreMessage(QtWarningMsg, "QIODevice::getChar: Closed device"); QCOMPARE(socket->getChar(&c), false); QCOMPARE((int) socket->bytesAvailable(), 0); QCOMPARE(socket->canReadLine(), false); @@ -830,7 +829,6 @@ void tst_QTcpSocket::openCloseOpenClose() QVERIFY(socket->socketType() == QTcpSocket::TcpSocket); char c; - QTest::ignoreMessage(QtWarningMsg, "QIODevice::getChar: Closed device"); QCOMPARE(socket->getChar(&c), false); QCOMPARE((int) socket->bytesAvailable(), 0); QCOMPARE(socket->canReadLine(), false); @@ -1959,7 +1957,6 @@ void tst_QTcpSocket::zeroAndMinusOneReturns() QCOMPARE(socket->write("BLUBBER"), qint64(-1)); QCOMPARE(socket->read(c, 16), qint64(-1)); QCOMPARE(socket->readLine(c, 16), qint64(-1)); - QTest::ignoreMessage(QtWarningMsg, "QIODevice::getChar: Closed device"); QVERIFY(!socket->getChar(c)); QVERIFY(!socket->putChar('a')); -- cgit v0.12 From 1a96fe7943fa691499432fe17dfe1ee294695c9e Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 18 Nov 2009 13:20:00 +0100 Subject: upgraded harfbuzz to lastest version Upgrade harfbuzz to b0d396aa88b3cdf8cea896bfeeba197656e1cdb1. This fixes a text rendering problem in Malayalam. Task-number: QTBUG-1887 Reviewed-by: Simon Hausmann --- src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp | 10 ++----- src/3rdparty/harfbuzz/tests/shaping/main.cpp | 34 ++++++++++++++++++++-- .../qtextscriptengine/tst_qtextscriptengine.cpp | 27 +++++++++++++++++ 3 files changed, 61 insertions(+), 10 deletions(-) diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp index 3008fca..3c9df93 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp @@ -1551,6 +1551,7 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv | PreSubstProperty | BelowSubstProperty | AboveSubstProperty + | PostSubstProperty | HalantProperty | PositioningProperties); @@ -1608,14 +1609,7 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv // pres always applies // blws always applies // abvs always applies - - // psts - // ### this looks slightly different from before, but I believe it's correct - if (reordered[len-1] != halant || base != len-2) - properties[base] &= ~PostSubstProperty; - for (i = base+1; i < len; ++i) - properties[i] &= ~PostSubstProperty; - + // psts always applies // halant always applies #ifdef INDIC_DEBUG diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp index 12fa7c4..827ac30 100644 --- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp +++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp @@ -686,7 +686,7 @@ void tst_QScriptEngine::bengali() void tst_QScriptEngine::gurmukhi() { { - FT_Face face = loadFace("lohit.punjabi.1.1.ttf"); + FT_Face face = loadFace("lohit_pa.ttf"); if (face) { const ShapeTable shape_table [] = { { { 0xA15, 0xA4D, 0xa39, 0x0 }, @@ -998,6 +998,36 @@ void tst_QScriptEngine::malayalam() QSKIP("couln't find AkrutiMal2Normal.ttf", SkipAll); } } + + { + FT_Face face = loadFace("Rachana.ttf"); + if (face) { + const ShapeTable shape_table [] = { + { { 0xd37, 0xd4d, 0xd1f, 0xd4d, 0xd30, 0xd40, 0x0 }, + { 0x385, 0xa3, 0x0 } }, + { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 }, + { 0x2ff, 0x0 } }, + { { 0xd33, 0xd4d, 0xd33, 0x0 }, + { 0x3f8, 0x0 } }, + { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 }, + { 0x2ff, 0x0 } }, + + { {0}, {0} } + }; + + + const ShapeTable *s = shape_table; + while (s->unicode[0]) { + QVERIFY( shaping(face, s, HB_Script_Malayalam) ); + ++s; + } + + FT_Done_Face(face); + } else { + QSKIP("couln't find Rachana.ttf", SkipAll); + } + } + } void tst_QScriptEngine::sinhala() @@ -1113,7 +1143,7 @@ void tst_QScriptEngine::nko() void tst_QScriptEngine::linearB() { { - FT_Face face = loadFace("PENUTURE.TTF"); + FT_Face face = loadFace("penuture.ttf"); if (face) { const ShapeTable shape_table [] = { { { 0xd800, 0xdc01, 0xd800, 0xdc02, 0xd800, 0xdc03, 0 }, diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp index 78e0ce6..2f9cc04 100644 --- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp +++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp @@ -858,6 +858,33 @@ void tst_QTextScriptEngine::malayalam() QSKIP("couln't find AkrutiMal2", SkipAll); } } + { + if (QFontDatabase().families(QFontDatabase::Malayalam).contains("Rachana")) { + QFont f("Rachana"); + const ShapeTable shape_table [] = { + { { 0xd37, 0xd4d, 0xd1f, 0xd4d, 0xd30, 0xd40, 0x0 }, + { 0x385, 0xa3, 0x0 } }, + { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 }, + { 0x2ff, 0x0 } }, + { { 0xd33, 0xd4d, 0xd33, 0x0 }, + { 0x3f8, 0x0 } }, + { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 }, + { 0x2ff, 0x0 } }, + + { {0}, {0} } + }; + + + const ShapeTable *s = shape_table; + while (s->unicode[0]) { + QVERIFY( shaping(f, s) ); + ++s; + } + } else { + QSKIP("couln't find Rachana", SkipAll); + } + } + #else QSKIP("X11 specific test", SkipAll); #endif -- cgit v0.12 From e59d974ddf2f2a413611ba4d8594c6413499a645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 18 Nov 2009 14:02:53 +0100 Subject: Compile with mixed carbon/cocoa universal builds. Moc got confused when Q3FileDialog was there in the carbon build but not in the cocoa build. (QT_MAC_USE_COCOA is defined by macros which moc does not evaluate) Fix this by porting Q3FileDialog to cocoa by using the compat functions in QFileDialog. revby:Prasanth Ullattil --- src/qt3support/dialogs/q3filedialog.cpp | 5 +---- src/qt3support/dialogs/q3filedialog.h | 4 ---- src/qt3support/dialogs/q3filedialog_mac.cpp | 23 ++++++++++++++++++++++- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/qt3support/dialogs/q3filedialog.cpp b/src/qt3support/dialogs/q3filedialog.cpp index c14ff5c..22bec63 100644 --- a/src/qt3support/dialogs/q3filedialog.cpp +++ b/src/qt3support/dialogs/q3filedialog.cpp @@ -116,8 +116,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_MAC_USE_COCOA - /* XPM */ static const char * const start_xpm[]={ "16 15 8 1", @@ -6053,8 +6051,7 @@ Q3FilePreview::Q3FilePreview() function to provide file previewing. */ -#endif // QT_MAC_USE_COCOA - + QT_END_NAMESPACE #include "moc_q3filedialog.cpp" diff --git a/src/qt3support/dialogs/q3filedialog.h b/src/qt3support/dialogs/q3filedialog.h index 8644b4c..f6a7950 100644 --- a/src/qt3support/dialogs/q3filedialog.h +++ b/src/qt3support/dialogs/q3filedialog.h @@ -69,8 +69,6 @@ class QUrlInfo; #ifndef QT_NO_FILEDIALOG -#ifndef QT_MAC_USE_COCOA - class Q_COMPAT_EXPORT Q3FileIconProvider : public QObject { Q_OBJECT @@ -339,8 +337,6 @@ private: #endif }; -#endif // QT_MAC_USE_COCOA - #endif // QT_NO_FILEDIALOG QT_END_NAMESPACE diff --git a/src/qt3support/dialogs/q3filedialog_mac.cpp b/src/qt3support/dialogs/q3filedialog_mac.cpp index 585fa8f..6c5675b 100644 --- a/src/qt3support/dialogs/q3filedialog_mac.cpp +++ b/src/qt3support/dialogs/q3filedialog_mac.cpp @@ -56,11 +56,32 @@ #include "qstringlist.h" #include "qtextcodec.h" #include "qdesktopwidget.h" +#include "qfiledialog.h" #include QT_BEGIN_NAMESPACE -#ifndef QT_MAC_USE_COCOA +#ifdef QT_MAC_USE_COCOA + +QStringList Q3FileDialog::macGetOpenFileNames(const QString &filter, QString *pwd, + QWidget *parent, const char* /*name*/, + const QString& caption, QString *selectedFilter, + bool /*multi*/, bool /*directory*/) +{ + return QFileDialog::getOpenFileNames(filter, *pwd, parent, 0, + caption); +} + + +QString Q3FileDialog::macGetSaveFileName(const QString &start, const QString &filter, + QString *, QWidget *parent, const char* /*name*/, + const QString& caption, QString *selectedFilter) +{ + return QFileDialog::getSaveFileName(start, filter, parent, 0, + caption, selectedFilter); +} + +#else /***************************************************************************** Externals -- cgit v0.12 From fb4e81bdc692efe0db9aa38dd2b941578c0f0370 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 18 Nov 2009 14:54:10 +0100 Subject: Application object must be constructed before QScriptEngine This is required due to the switch to the JavaScriptCore-based back-end. Instead of segfaulting somewhere inside JSC::initializeThreading(), call qFatal() when this constraint has been violated. Reviewed-by: Simon Hausmann --- src/script/api/qscriptengine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index d519102..02eb9a3 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -776,7 +776,11 @@ QScriptEnginePrivate::QScriptEnginePrivate() qMetaTypeId(); #endif - JSC::initializeThreading(); // ### hmmm + if (!QCoreApplication::instance()) { + qFatal("QScriptEngine: Must construct a Q(Core)Application before a QScriptEngine"); + return; + } + JSC::initializeThreading(); globalData = JSC::JSGlobalData::create().releaseRef(); globalData->clientData = new QScript::GlobalClientData(this); -- cgit v0.12 From 1ca2903b81c77573d37c5bd486b8d8e49a87ffc1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 18 Nov 2009 15:32:15 +0100 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 7bdf90f753d25fb1b5628b0980827df11110ad5a ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-11-18 Paul Olav Tvete Reviewed by Simon Hausmann. [Qt] Make the QWebElement::render() test pass when pixmaps aren't 32 bit. * tests/qwebelement/tst_qwebelement.cpp: (tst_QWebElement::render): 2009-11-18 Simon Hausmann Reviewed by Tor Arne Vestbø. Clarify and simplify the legal section in the overview documentation, after review with our legal team. * docs/qtwebkit.qdoc: 2009-11-18 Simon Hausmann Reviewed and suggested by Tor Arne Vestbø. Fix the autotest after commit ecbb2c0dd21bfc197e1f7b53150ec9b1a1d8cb8f to compare the Qt::ImFont property's family against an explicitly previously configured family. * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::inputMethods): --- src/3rdparty/webkit/JavaScriptCore/ChangeLog | 12 +++++++++ src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 15 +++++++++++ .../platform/graphics/qt/FontFallbackListQt.cpp | 2 +- src/3rdparty/webkit/WebKit/qt/ChangeLog | 29 ++++++++++++++++++++++ .../qt/tests/qwebelement/tst_qwebelement.cpp | 2 +- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 7 +++--- 7 files changed, 63 insertions(+), 6 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index 0cbb3a5..304f9ef 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,15 @@ +2009-11-18 Harald Fernengel + + Reviewed by Simon Hausmann. + + [Qt] Fix detection of linux-g++ + + Never use "linux-g++*" to check for linux-g++, since this will break embedded + builds which use linux-arm-g++ and friends. Use 'linux*-g++*' to check for any + g++ on linux mkspec. + + * JavaScriptCore.pri: + 2009-11-16 Joerg Bornemann Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 2653e83..f40dda4 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - ca38203fba92cf48d59328403f64036907fd3433 + 7bdf90f753d25fb1b5628b0980827df11110ad5a diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index abb372a..6daf411 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2009-11-18 Benjamin Poulain + + Reviewed by Simon Hausmann. + + [Qt] WebKit crashes when loading certain SVG images + + Check if the familly exist before creating the PlatformData from it. + + https://bugs.webkit.org/show_bug.cgi?id=29443 + + Test: svg/text/text-font-invalid.html + + * platform/graphics/qt/FontFallbackListQt.cpp: + (WebCore::FontFallbackList::fontDataAt): + 2009-11-14 Antonio Gomes Reviewed by Antti Koivisto. diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp index 8e1e4f6..0306abf 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp @@ -102,7 +102,7 @@ const FontData* FontFallbackList::fontDataAt(const WebCore::Font* _font, unsigne const FontDescription& description = _font->fontDescription(); const FontFamily* family = &description.family(); while (family) { - if (m_fontSelector) { + if (family->family().length() && m_fontSelector) { FontData* data = m_fontSelector->getFontData(description, family->family()); if (data) { if (data->isLoading()) diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 1294d66..457e9c2 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,32 @@ +2009-11-18 Paul Olav Tvete + + Reviewed by Simon Hausmann. + + [Qt] Make the QWebElement::render() test pass when pixmaps aren't 32 bit. + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::render): + +2009-11-18 Simon Hausmann + + Reviewed by Tor Arne Vestbø. + + Clarify and simplify the legal section in the overview documentation, + after review with our legal team. + + * docs/qtwebkit.qdoc: + +2009-11-18 Simon Hausmann + + Reviewed and suggested by Tor Arne Vestbø. + + Fix the autotest after commit ecbb2c0dd21bfc197e1f7b53150ec9b1a1d8cb8f + to compare the Qt::ImFont property's family against an explicitly + previously configured family. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::inputMethods): + 2009-11-16 Simon Hausmann Reviewed by Kenneth Rohde Christiansen. diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp index a04e661..e9dae18 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp @@ -995,7 +995,7 @@ void tst_QWebElement::render() QImage testImage(resource.width(), resource.height(), QImage::Format_ARGB32); QPainter painter0(&testImage); painter0.fillRect(imageRect, Qt::white); - //render() uses pixmaps internally, and pixmaps might have bit depths + // render() uses pixmaps internally, and pixmaps might have bit depths // other than 32, giving different pixel values due to rounding. QPixmap pix = QPixmap::fromImage(resource); painter0.drawPixmap(0, 0, pix); diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 7fc3640..a1d3dac 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -1371,6 +1371,7 @@ void tst_QWebPage::inputMethods() else QVERIFY2(false, "Unknown view type"); + page->settings()->setFontFamily(QWebSettings::SerifFont, "FooSerifFont"); page->mainFrame()->setHtml("" \ "
" \ "" \ @@ -1404,9 +1405,9 @@ void tst_QWebPage::inputMethods() QVERIFY(inputs.at(0).geometry().contains(variant.toRect().topLeft())); //ImFont - //variant = page->inputMethodQuery(Qt::ImFont); - //QFont font = variant.value(); - //QCOMPARE(QString("-webkit-serif"), font.family()); + variant = page->inputMethodQuery(Qt::ImFont); + QFont font = variant.value(); + QCOMPARE(page->settings()->fontFamily(QWebSettings::SerifFont), font.family()); QList inputAttributes; -- cgit v0.12 From 22ba574eef8c9412b63efb1126e2f432367c7061 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 18 Nov 2009 15:47:25 +0100 Subject: Doc: Add link to "Making Applications Scriptable" from QtScript module page Make the information easier to find. There are many places that refer to the QtScript module page for more information, but after the documentation was recently restructured, all that information now resides on the "Making Applications Scriptable" page. This issue was also reported on the qt4-preview-feedback mailing list. Reviewed-by: David Boddie --- doc/src/modules.qdoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index ef29990..94cab58 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -314,6 +314,10 @@ \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 1 + For detailed information on how to make your application + scriptable with QtScript, see \l{Making Applications + Scriptable}. + The QtScript module is part of the \l{Qt Full Framework Edition} and the \l{Open Source Versions of Qt}. -- cgit v0.12 From 41e7781f76432ee821883505d68a89e0aadd56b1 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 18 Nov 2009 15:05:02 +0100 Subject: Added missing autotests to the tests/auto.pro Reviewed-by: Olivier Goffart --- tests/auto/auto.pro | 59 ++++++++++++++++++++-- tests/auto/qsysinfo/.gitignore | 1 - tests/auto/qsysinfo/qsysinfo.pro | 5 -- tests/auto/qsysinfo/tst_qsysinfo.cpp | 52 ------------------- tests/auto/rcc/rcc.pro | 6 +++ tests/auto/rcc/tst_rcc.cpp | 2 +- tests/auto/windowsmobile/test/test.pro | 2 +- .../windowsmobile/testQMenuBar/testQMenuBar.pro | 3 +- 8 files changed, 66 insertions(+), 64 deletions(-) delete mode 100644 tests/auto/qsysinfo/.gitignore delete mode 100644 tests/auto/qsysinfo/qsysinfo.pro delete mode 100644 tests/auto/qsysinfo/tst_qsysinfo.cpp diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index da1f7ca..d5d72a7 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -59,9 +59,15 @@ Q3SUBDIRS += \ q3toolbar \ q3urloperator \ q3valuelist \ - q3valuevector + q3valuevector \ + q3combobox \ + q3frame \ + q3uridrag \ + q3widgetstack SUBDIRS += \ +# exceptionsafety_objects \ shouldn't enable it + languagechange \ collections \ exceptionsafety \ mediaobject \ @@ -403,8 +409,55 @@ SUBDIRS += \ symbols \ qrand \ utf8 \ - gestures - + gestures \ + qabstractnetworkcache \ + qabstractproxymodel \ + qbytearraymatcher \ + qcalendarwidget \ + qcolumnview \ + qcommandlinkbutton \ + qdbuscontext \ + qdbusserver \ + qdbusservicewatcher \ + qdiriterator \ + qeasingcurve \ + qfileiconprovider \ + qformlayout \ + q_func_info \ + qfuture \ + qfuturewatcher \ + qguard \ + qhttpsocketengine \ + qinputcontext \ + qlocalsocket \ + qmacstyle \ + qmargins \ + qnetworkaddressentry \ + qnetworkcachemetadata \ + qnetworkdiskcache \ + qobjectperformance \ + qpainterpathstroker \ + qplugin \ + qpluginloader \ + qscrollbar \ + qsharedmemory \ + qsidebar \ + qsizegrip \ + qsoftkeymanager \ + qsqldriver \ + qsystemsemaphore \ + qtconcurrentfilter \ + qtconcurrentiteratekernel \ + qtconcurrentmap \ + qtconcurrentrun \ + qtconcurrentthreadengine \ + qthreadpool \ + qtokenautomaton \ + qtouchevent \ + qwidget_window \ + rcc \ + windowsmobile + !wince*:SUBDIRS += $$Q3SUBDIRS contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter diff --git a/tests/auto/qsysinfo/.gitignore b/tests/auto/qsysinfo/.gitignore deleted file mode 100644 index e50cae2..0000000 --- a/tests/auto/qsysinfo/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_qsysinfo diff --git a/tests/auto/qsysinfo/qsysinfo.pro b/tests/auto/qsysinfo/qsysinfo.pro deleted file mode 100644 index e822fec..0000000 --- a/tests/auto/qsysinfo/qsysinfo.pro +++ /dev/null @@ -1,5 +0,0 @@ -load(qttest_p4) -SOURCES += tst_qsysinfo.cpp -QT = core - - diff --git a/tests/auto/qsysinfo/tst_qsysinfo.cpp b/tests/auto/qsysinfo/tst_qsysinfo.cpp deleted file mode 100644 index 8784863..0000000 --- a/tests/auto/qsysinfo/tst_qsysinfo.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include - -class tst_QSysInfo: public QObject -{ - Q_OBJECT -private slots: -}; - -QTEST_MAIN(tst_QSysInfo) -#include "tst_qsysinfo.moc" diff --git a/tests/auto/rcc/rcc.pro b/tests/auto/rcc/rcc.pro index d6a2083..1759b48 100644 --- a/tests/auto/rcc/rcc.pro +++ b/tests/auto/rcc/rcc.pro @@ -4,3 +4,9 @@ TARGET = tst_rcc SOURCES += tst_rcc.cpp +wince* { + DEFINES += SRCDIR=\\\"\\\" +} else { + DEFINES += SRCDIR=\\\"$$PWD/\\\" +} + diff --git a/tests/auto/rcc/tst_rcc.cpp b/tests/auto/rcc/tst_rcc.cpp index c9e3d76..2fe0dc4 100644 --- a/tests/auto/rcc/tst_rcc.cpp +++ b/tests/auto/rcc/tst_rcc.cpp @@ -102,7 +102,7 @@ void tst_rcc::rcc_data() QTest::addColumn("qrcfile"); QTest::addColumn("expected"); - QTest::newRow("images") << "data" << "images.qrc" << "images.expected"; + QTest::newRow("images") << SRCDIR "data" << "images.qrc" << "images.expected"; } void tst_rcc::rcc() diff --git a/tests/auto/windowsmobile/test/test.pro b/tests/auto/windowsmobile/test/test.pro index b7f65a9..61e275d 100644 --- a/tests/auto/windowsmobile/test/test.pro +++ b/tests/auto/windowsmobile/test/test.pro @@ -5,7 +5,7 @@ HEADERS += ddhelper.h SOURCES += tst_windowsmobile.cpp ddhelper.cpp RESOURCES += windowsmobile.qrc -TARGET = tst_windowsmobile +TARGET = ../tst_windowsmobile wincewm*: { addFiles.sources = $$OUT_PWD/../testQMenuBar/*.exe diff --git a/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro b/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro index 6dd288b..87986e4 100644 --- a/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro +++ b/tests/auto/windowsmobile/testQMenuBar/testQMenuBar.pro @@ -1,2 +1,3 @@ SOURCES += main.cpp -DESTDIR = ./ +TARGET = ../testQMenuBar + -- cgit v0.12 From c9ff28c5c56eaf5443921b937cf7c0270eaadd86 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 18 Nov 2009 13:27:24 +0100 Subject: Fixes in the multitouch handling. When filling in touch point data for delivering to widget don't use the setter methods to avoid unnecessary detaches. Making it not detach also allows not to re-calculate widget-relative start position and last position on each delivery step. Also use the QWeakPointer to store a pointer to a widget that expects to receive a touch event, so that if the widget is destroyed we'll get notified. Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qapplication.cpp | 76 ++++++++++++++++++++++++--------------- src/gui/kernel/qapplication_p.h | 2 +- src/gui/kernel/qevent.h | 3 ++ src/gui/kernel/qmultitouch_mac.mm | 1 - 4 files changed, 52 insertions(+), 30 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 4b8f6a0..4764a2d 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -4105,8 +4105,17 @@ bool QApplication::notify(QObject *receiver, QEvent *e) } else if (widget->isWindow() || widget->testAttribute(Qt::WA_NoMousePropagation)) { break; } + QPoint offset = widget->pos(); widget = widget->parentWidget(); - d->updateTouchPointsForWidget(widget, touchEvent); + touchEvent->setWidget(widget); + for (int i = 0; i < touchEvent->_touchPoints.size(); ++i) { + QTouchEvent::TouchPoint &pt = touchEvent->_touchPoints[i]; + QRectF rect = pt.rect(); + rect.moveCenter(offset); + pt.d->rect = rect; + pt.d->startPos = pt.startPos() + offset; + pt.d->lastPos = pt.lastPos() + offset; + } } touchEvent->setAccepted(eventAccepted); @@ -5417,9 +5426,11 @@ void QApplicationPrivate::updateTouchPointsForWidget(QWidget *widget, QTouchEven const QPointF delta = screenPos - screenPos.toPoint(); rect.moveCenter(widget->mapFromGlobal(screenPos.toPoint()) + delta); - touchPoint.setRect(rect); - touchPoint.setStartPos(widget->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta); - touchPoint.setLastPos(widget->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta); + touchPoint.d->rect = rect; + if (touchPoint.state() == Qt::TouchPointPressed) { + touchPoint.d->startPos = widget->mapFromGlobal(touchPoint.startScreenPos().toPoint()) + delta; + touchPoint.d->lastPos = widget->mapFromGlobal(touchPoint.lastScreenPos().toPoint()) + delta; + } } } @@ -5463,16 +5474,20 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, for (int i = 0; i < touchPoints.count(); ++i) { QTouchEvent::TouchPoint touchPoint = touchPoints.at(i); + // explicitly detach from the original touch point that we got, so even + // if the touchpoint structs are reused, we will make a copy that we'll + // deliver to the user (which might want to store the struct for later use). + touchPoint.d = touchPoint.d->detach(); // update state - QWidget *widget = 0; + QWeakPointer widget; switch (touchPoint.state()) { case Qt::TouchPointPressed: { if (deviceType == QTouchEvent::TouchPad) { // on touch-pads, send all touch points to the same widget widget = d->widgetForTouchPointId.isEmpty() - ? 0 + ? QWeakPointer() : d->widgetForTouchPointId.constBegin().value(); } @@ -5489,20 +5504,21 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, if (deviceType == QTouchEvent::TouchScreen) { int closestTouchPointId = d->findClosestTouchPointId(touchPoint.screenPos()); - QWidget *closestWidget = d->widgetForTouchPointId.value(closestTouchPointId); + QWidget *closestWidget = d->widgetForTouchPointId.value(closestTouchPointId).data(); if (closestWidget - && (widget->isAncestorOf(closestWidget) || closestWidget->isAncestorOf(widget))) { + && (widget.data()->isAncestorOf(closestWidget) || closestWidget->isAncestorOf(widget.data()))) { widget = closestWidget; } } d->widgetForTouchPointId[touchPoint.id()] = widget; - touchPoint.setStartScreenPos(touchPoint.screenPos()); - touchPoint.setLastScreenPos(touchPoint.screenPos()); - touchPoint.setStartNormalizedPos(touchPoint.normalizedPos()); - touchPoint.setLastNormalizedPos(touchPoint.normalizedPos()); + touchPoint.d->startScreenPos = touchPoint.screenPos(); + touchPoint.d->lastScreenPos = touchPoint.screenPos(); + touchPoint.d->startNormalizedPos = touchPoint.normalizedPos(); + touchPoint.d->lastNormalizedPos = touchPoint.normalizedPos(); if (touchPoint.pressure() < qreal(0.)) - touchPoint.setPressure(qreal(1.)); + touchPoint.d->pressure = qreal(1.); + d->appCurrentTouchPoints.insert(touchPoint.id(), touchPoint); break; } @@ -5513,12 +5529,14 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, continue; QTouchEvent::TouchPoint previousTouchPoint = d->appCurrentTouchPoints.take(touchPoint.id()); - touchPoint.setStartScreenPos(previousTouchPoint.startScreenPos()); - touchPoint.setLastScreenPos(previousTouchPoint.screenPos()); - touchPoint.setStartNormalizedPos(previousTouchPoint.startNormalizedPos()); - touchPoint.setLastNormalizedPos(previousTouchPoint.normalizedPos()); + touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos(); + touchPoint.d->lastScreenPos = previousTouchPoint.screenPos(); + touchPoint.d->startPos = previousTouchPoint.startPos(); + touchPoint.d->lastPos = previousTouchPoint.pos(); + touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos(); + touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos(); if (touchPoint.pressure() < qreal(0.)) - touchPoint.setPressure(qreal(0.)); + touchPoint.d->pressure = qreal(0.); break; } default: @@ -5528,23 +5546,25 @@ void QApplicationPrivate::translateRawTouchEvent(QWidget *window, Q_ASSERT(d->appCurrentTouchPoints.contains(touchPoint.id())); QTouchEvent::TouchPoint previousTouchPoint = d->appCurrentTouchPoints.value(touchPoint.id()); - touchPoint.setStartScreenPos(previousTouchPoint.startScreenPos()); - touchPoint.setLastScreenPos(previousTouchPoint.screenPos()); - touchPoint.setStartNormalizedPos(previousTouchPoint.startNormalizedPos()); - touchPoint.setLastNormalizedPos(previousTouchPoint.normalizedPos()); + touchPoint.d->startScreenPos = previousTouchPoint.startScreenPos(); + touchPoint.d->lastScreenPos = previousTouchPoint.screenPos(); + touchPoint.d->startPos = previousTouchPoint.startPos(); + touchPoint.d->lastPos = previousTouchPoint.pos(); + touchPoint.d->startNormalizedPos = previousTouchPoint.startNormalizedPos(); + touchPoint.d->lastNormalizedPos = previousTouchPoint.normalizedPos(); if (touchPoint.pressure() < qreal(0.)) - touchPoint.setPressure(qreal(1.)); + touchPoint.d->pressure = qreal(1.); d->appCurrentTouchPoints[touchPoint.id()] = touchPoint; break; } - Q_ASSERT(widget != 0); + Q_ASSERT(widget.data() != 0); // make the *scene* functions return the same as the *screen* functions - touchPoint.setSceneRect(touchPoint.screenRect()); - touchPoint.setStartScenePos(touchPoint.startScreenPos()); - touchPoint.setLastScenePos(touchPoint.lastScreenPos()); + touchPoint.d->sceneRect = touchPoint.screenRect(); + touchPoint.d->startScenePos = touchPoint.startScreenPos(); + touchPoint.d->lastScenePos = touchPoint.lastScreenPos(); - StatesAndTouchPoints &maskAndPoints = widgetsNeedingEvents[widget]; + StatesAndTouchPoints &maskAndPoints = widgetsNeedingEvents[widget.data()]; maskAndPoints.first |= touchPoint.state(); if (touchPoint.isPrimary()) maskAndPoints.first |= Qt::TouchPointPrimary; diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 992e4be..14d7215 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -511,7 +511,7 @@ public: QWidget *gestureWidget; - QMap widgetForTouchPointId; + QMap > widgetForTouchPointId; QMap appCurrentTouchPoints; static void updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent); void initializeMultitouch(); diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 9839269..461cc92 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -787,6 +787,8 @@ public: private: QTouchEventTouchPointPrivate *d; + friend class QApplication; + friend class QApplicationPrivate; }; enum DeviceType { @@ -818,6 +820,7 @@ protected: Qt::TouchPointStates _touchPointStates; QList _touchPoints; + friend class QApplication; friend class QApplicationPrivate; }; diff --git a/src/gui/kernel/qmultitouch_mac.mm b/src/gui/kernel/qmultitouch_mac.mm index 2f6f9ca..f736146 100644 --- a/src/gui/kernel/qmultitouch_mac.mm +++ b/src/gui/kernel/qmultitouch_mac.mm @@ -180,7 +180,6 @@ QCocoaTouch::getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch) if (_touchCount != _currentTouches.size()) { // Remove all instances, and basically start from scratch: touchPoints.clear(); - QList list = _currentTouches.values(); foreach (QCocoaTouch *qcocoaTouch, _currentTouches.values()) { if (!_updateInternalStateOnly) { qcocoaTouch->_touchPoint.setState(Qt::TouchPointReleased); -- cgit v0.12 From 4ae6b3b3ef0467afda9e5592b7e255d7cc0770a0 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Wed, 18 Nov 2009 17:05:26 +0100 Subject: tst_qtcpsocket: Stabilize by increasing timeouts Reviewed-by: TrustMe --- tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index aaa207b..863b8f5 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -776,7 +776,7 @@ void tst_QTcpSocket::unget() for (int i = 0; i < 10; i += 2) { while (socket->bytesAvailable() < 2) - QVERIFY(socket->waitForReadyRead(5000)); + QVERIFY(socket->waitForReadyRead(10000)); int bA = socket->bytesAvailable(); QVERIFY(socket->read(buf, 2) == 2); buf[2] = '\0'; @@ -2115,7 +2115,7 @@ void tst_QTcpSocket::moveToThread0() QTcpSocket *socket = newSocket();; socket->connectToHost(QtNetworkSettings::serverName(), 143); socket->moveToThread(0); - QVERIFY(socket->waitForConnected(2000)); + QVERIFY(socket->waitForConnected(5000)); socket->write("XXX LOGOUT\r\n"); QVERIFY(socket->waitForBytesWritten(5000)); QVERIFY(socket->waitForDisconnected()); @@ -2126,7 +2126,7 @@ void tst_QTcpSocket::moveToThread0() QTcpSocket *socket = newSocket(); socket->moveToThread(0); socket->connectToHost(QtNetworkSettings::serverName(), 143); - QVERIFY(socket->waitForConnected(2000)); + QVERIFY(socket->waitForConnected(5000)); socket->write("XXX LOGOUT\r\n"); QVERIFY(socket->waitForBytesWritten(5000)); QVERIFY(socket->waitForDisconnected()); @@ -2136,7 +2136,7 @@ void tst_QTcpSocket::moveToThread0() // Case 3: Moved after writing, while waiting for bytes to be written. QTcpSocket *socket = newSocket(); socket->connectToHost(QtNetworkSettings::serverName(), 143); - QVERIFY(socket->waitForConnected(2000)); + QVERIFY(socket->waitForConnected(5000)); socket->write("XXX LOGOUT\r\n"); socket->moveToThread(0); QVERIFY(socket->waitForBytesWritten(5000)); @@ -2147,7 +2147,7 @@ void tst_QTcpSocket::moveToThread0() // Case 4: Moved after writing, while waiting for response. QTcpSocket *socket = newSocket(); socket->connectToHost(QtNetworkSettings::serverName(), 143); - QVERIFY(socket->waitForConnected(2000)); + QVERIFY(socket->waitForConnected(5000)); socket->write("XXX LOGOUT\r\n"); QVERIFY(socket->waitForBytesWritten(5000)); socket->moveToThread(0); @@ -2303,7 +2303,7 @@ void tst_QTcpSocket::invalidProxy() QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState); } else { QCOMPARE(socket->state(), QAbstractSocket::ConnectingState); - QVERIFY(!socket->waitForConnected(2000)); + QVERIFY(!socket->waitForConnected(5000)); } QVERIFY(!socket->errorString().isEmpty()); @@ -2422,7 +2422,7 @@ void tst_QTcpSocket::proxyFactory() QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState); } else { QCOMPARE(socket->state(), QAbstractSocket::ConnectingState); - QVERIFY(socket->waitForConnected(2000)); + QVERIFY(socket->waitForConnected(5000)); QCOMPARE(proxyAuthCalled, 1); } QVERIFY(!socket->errorString().isEmpty()); -- cgit v0.12 From e6d6d3830e86202d4f32cd5695f37d4568710562 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 18 Nov 2009 13:47:48 +0100 Subject: Fix compilation with Sun CC: no semi-colon after Q_PROPERTY Reviewed-By: Peter Hartmann --- examples/effects/blurpicker/blurpicker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/effects/blurpicker/blurpicker.h b/examples/effects/blurpicker/blurpicker.h index b302db4..6972a39 100644 --- a/examples/effects/blurpicker/blurpicker.h +++ b/examples/effects/blurpicker/blurpicker.h @@ -51,7 +51,7 @@ class BlurPicker: public QGraphicsView { Q_OBJECT - Q_PROPERTY(qreal index READ index WRITE setIndex); + Q_PROPERTY(qreal index READ index WRITE setIndex) public: BlurPicker(QWidget *parent = 0); -- cgit v0.12 From 21bb070cb979f3b581d829d153794ef97427155f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 17 Nov 2009 18:24:43 +0100 Subject: Configure: add support for the new licensing schemes for Qt. Add the necessary logic to deal with Symbian and the Real-Time operating systems (QNX and VxWorks). Symbian is considered an embedded license, so it allows a no-deploy build on X11 and Mac. Task-number: QT-2519 Reviewed-by: Jason McDonald --- configure | 77 +++++++++++++++++++++++---------------------------------------- 1 file changed, 28 insertions(+), 49 deletions(-) diff --git a/configure b/configure index 9ee2609..49e76ea 100755 --- a/configure +++ b/configure @@ -404,7 +404,7 @@ elif [ $COMMERCIAL_USER = "yes" ]; then exit 1 fi ProductCode=`echo $LicenseKeyExt | cut -f 1 -d - | cut -b 1` - PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d - | cut -b 1` + PlatformCode=`echo $LicenseKeyExt | cut -f 2 -d -` LicenseTypeCode=`echo $LicenseKeyExt | cut -f 3 -d -` LicenseFeatureCode=`echo $LicenseKeyExt | cut -f 4 -d - | cut -b 1` @@ -448,65 +448,44 @@ elif [ $COMMERCIAL_USER = "yes" ]; then # verify that we are licensed to use Qt on this platform LICENSE_EXTENSION= - if [ "$PlatformCode" = "X" ]; then - # Qt All-OS - LICENSE_EXTENSION="-ALLOS" - elif [ "$PLATFORM_QWS" = "yes" ]; then - case $PlatformCode in - 2|4|8|A|B|E|G|J|K|P|Q|S|U|V|W) + case "$PlatformCode" in + *L) + PlatformCode=`echo "$PlatformCode" | sed 'h;y/8NPQRTZ/UCWX9M7/;x;G;s/\(.\)....\(.\)./\1\2/'` + ;; + *) + PlatformCode=`echo "$PlatformCode" | sed 's/.$//'` + ;; + esac + case "$PlatformCode,$PLATFORM_MAC,$PLATFORM_QWS" in + X9,* | XC,* | XU,* | XW,*) + # Qt All-OS + LICENSE_EXTENSION="-ALLOS" + ;; + 8M,* | S9,* | SC,* | SU,* | SW,* | X9,* | XC,* | XU,* | XW,*) # Qt for Embedded Linux LICENSE_EXTENSION="-EMBEDDED" ;; - *) - echo - echo "You are not licensed for Qt for Embedded Linux." - echo - echo "Please contact qt-info@nokia.com to upgrade your license" - echo "to include Qt for Embedded Linux, or install the" - echo "Qt Open Source Edition if you intend to develop free software." - exit 1 + 6M,*,no | N7,*,no | N9,*,no | NX,*,no) + # Embedded no-deploy + LICENSE_EXTENSION="-EMBEDDED" ;; - esac - elif [ "$PLATFORM_MAC" = "yes" ]; then - case $PlatformCode in - 2|4|5|7|9|B|C|E|F|G|L|M|U|W|Y) - # Qt/Mac + FM,*,no | LM,yes,* | ZM,no,no) + # Desktop LICENSE_EXTENSION="-DESKTOP" ;; - 3|6|8|A|D|H|J|K|P|Q|S|V) - # Embedded no-deploy - LICENSE_EXTENSION="-EMBEDDED" - ;; *) + Platform=Linux/X11 + [ "$PLATFORM_MAC" = "yes" ] && Platform='Mac OS X' + [ "$PLATFORM_QWS" = "yes" ] && Platform='Embedded Linux' echo - echo "You are not licensed for the Qt/Mac platform." + echo "You are not licensed for the $Platform platform." echo - echo "Please contact qt-info@nokia.com to upgrade your license" - echo "to include the Qt/Mac platform." + echo "Please contact qt-info@nokia.com to upgrade your license to" + echo "include the $Platform platform, or install the Qt Open Source Edition" + echo "if you intend to develop free software." exit 1 ;; - esac - else - case $PlatformCode in - 2|3|4|5|7|D|E|F|J|M|Q|S|T|V|Z) - # Qt/X11 - LICENSE_EXTENSION="-DESKTOP" - ;; - 6|8|9|A|B|C|G|H|K|P|U|W) - # Embedded no-deploy - LICENSE_EXTENSION="-EMBEDDED" - ;; - *) - echo - echo "You are not licensed for the Qt/X11 platform." - echo - echo "Please contact qt-info@nokia.com to upgrade your license to" - echo "include the Qt/X11 platform, or install the Qt Open Source Edition" - echo "if you intend to develop free software." - exit 1 - ;; - esac - fi + esac if test -r "$relpath/.LICENSE"; then # Generic, non-final license -- cgit v0.12 From 62e1db5793f9395e39091757135f4d96e564e6c2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 17 Nov 2009 18:38:24 +0100 Subject: Configure: add support for the RTOS licensing scheme When building for one of the RTOS, require a specific license key. Task-number: QT-2519 Reviewed-by: Jason McDonald --- configure | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 49e76ea..c869e0e 100755 --- a/configure +++ b/configure @@ -226,6 +226,7 @@ COMMERCIAL_USER=ask CFG_DEV=no CFG_NOKIA=no CFG_EMBEDDED=no +CFG_RTOS_ENABLED=yes EditionString=Commercial earlyArgParse() @@ -450,9 +451,11 @@ elif [ $COMMERCIAL_USER = "yes" ]; then LICENSE_EXTENSION= case "$PlatformCode" in *L) + CFG_RTOS_ENABLED=yes PlatformCode=`echo "$PlatformCode" | sed 'h;y/8NPQRTZ/UCWX9M7/;x;G;s/\(.\)....\(.\)./\1\2/'` ;; *) + CFG_RTOS_ENABLED=no PlatformCode=`echo "$PlatformCode" | sed 's/.$//'` ;; esac @@ -512,7 +515,7 @@ elif [ $COMMERCIAL_USER = "yes" ]; then fi case "$LicenseFeatureCode" in - G|L) + B|G|L|Y) # US case "$LicenseType" in Commercial) @@ -523,7 +526,7 @@ elif [ $COMMERCIAL_USER = "yes" ]; then ;; esac ;; - 2|5) + 2|4|5|F) # non-US case "$LicenseType" in Commercial) @@ -540,6 +543,14 @@ elif [ $COMMERCIAL_USER = "yes" ]; then exit 1 ;; esac + case "$LicenseFeatureCode" in + 4|B|F|Y) + CFG_RTOS_ENABLED=yes + ;; + 2|5|G|L) + CFG_RTOS_ENABLED=no + ;; + esac if [ '!' -f "$outpath/LICENSE" ]; then echo "The LICENSE, LICENSE.GPL3 LICENSE.LGPL file shipped with" echo "this software has disappeared." @@ -2608,6 +2619,20 @@ if [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" fi fi +if [ "$CFG_RTOS_ENABLED" = "no" ]; then + case `basename "$XPLATFORM"` in + qnx-* | vxworks-*) + echo "" + echo "You are not licensed for Qt for `basename $XPLATFORM`." + echo "" + echo "Please contact qt-info@nokia.com to upgrade your license to" + echo "include this platform, or install the Qt Open Source Edition" + echo "if you intend to develop free software." + exit 1 + ;; + esac +fi + if [ -z "${CFG_HOST_ARCH}" ]; then case "$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE" in IRIX*:*:*) @@ -3862,10 +3887,10 @@ fi # Help if [ "$PLATFORM_QWS" = "yes" ]; then Platform="Qt for Embedded Linux" elif [ "$PLATFORM_MAC" = "yes" ]; then - Platform="Qt/Mac" + Platform="Qt for Mac OS X" else PLATFORM_X11=yes - Platform="Qt/X11" + Platform="Qt for Linux/X11" fi echo -- cgit v0.12 From d1779085462e7050a32e2f785767b4ce0d0cbfe0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 17 Nov 2009 20:13:04 +0100 Subject: configure.exe: Update to the new licensing structure. Add support for Symbian commercial licenses and adapt to the possibility from the RT operating systems Task-number: QT-2518 Reviewed-by: axis --- tools/configure/tools.cpp | 92 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 26 deletions(-) diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp index c958dd9..1eeb212 100644 --- a/tools/configure/tools.cpp +++ b/tools/configure/tools.cpp @@ -131,7 +131,7 @@ void Tools::checkLicense(QMap &dictionary, QMap &dictionary, QMap &dictionary, QMap Date: Wed, 18 Nov 2009 17:02:50 +0100 Subject: Fixed a few license checks in configure.exe. Needs recompile. Reviewed-By: Thiago Macieira --- tools/configure/tools.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tools/configure/tools.cpp b/tools/configure/tools.cpp index 1eeb212..76063e4 100644 --- a/tools/configure/tools.cpp +++ b/tools/configure/tools.cpp @@ -110,23 +110,16 @@ void Tools::checkLicense(QMap &dictionary, QMap &dictionary, QMap &dictionary, QMap &dictionary, QMap Date: Wed, 18 Nov 2009 17:15:29 +0100 Subject: rebuilt configure.exe there were several changes made to configure.exe recently, this commit makes sure we have rebuilt the binary after all the changes have been made. Reviewed-by: Thiago Macieira --- configure.exe | Bin 1174528 -> 1175040 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/configure.exe b/configure.exe index 2c126df..a970696 100755 Binary files a/configure.exe and b/configure.exe differ -- cgit v0.12 From d270a757961bd2451f0a5d1dc6d78cd93c0d6ce3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 18 Nov 2009 18:42:05 +0100 Subject: Fix compilation of Embedded with GLib. You have to link to Glib if you're using it... Reviewed-by: Peter Hartmann --- src/gui/kernel/kernel.pri | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 8859358..7d0e5c7 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -188,9 +188,8 @@ embedded { HEADERS += \ kernel/qeventdispatcher_glib_qws_p.h QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB + LIBS_PRIVATE +=$$QT_LIBS_GLIB } - - } !embedded:!x11:mac { -- cgit v0.12 From 5f1c10a15374e84e96e9e69e47f511acd3a71c4f Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 18 Nov 2009 18:42:58 +0100 Subject: Doc: Remove stale notes about (lack of) ECMA compliance QtScript now uses JavaScriptCore, where dates and regular expressions are implemented in an ECMA compliant way. --- doc/src/scripting/scripting.qdoc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/src/scripting/scripting.qdoc b/doc/src/scripting/scripting.qdoc index e99be70..b2ce8d1 100644 --- a/doc/src/scripting/scripting.qdoc +++ b/doc/src/scripting/scripting.qdoc @@ -1805,15 +1805,9 @@ \section1 ECMAScript Compatibility - QtScript implements all the built-in classes and functions defined - in ECMA-262. - - The Date parsing and string conversion functions are implemented using - QDateTime::fromString() and QDateTime::toString(), respectively. - - The RegExp class is a wrapper around QRegExp. The QRegExp semantics - do not precisely match the semantics for regular expressions defined - in ECMA-262. + QtScript implements all the built-in objects and properties defined + in the \l{ECMA-262} standard; see the + \l{ECMAScript Reference}{ECMAScript reference} for an overview. \section1 QtScript Extensions to ECMAScript -- cgit v0.12 From 9fe840c54e373c26fd54bb04eadb25e14ad4040b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 18 Nov 2009 19:29:40 +0100 Subject: Fix JavaScriptCore on 32-bit Sparc: these machines are big-endian Reviewed-By: Jocelyn Turcotte --- src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h index 188b68f..be74e2a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h @@ -328,6 +328,16 @@ #define WTF_PLATFORM_BIG_ENDIAN 1 #endif +/* PLATFORM(SPARC32) */ +#if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8) +#define WTF_PLATFORM_SPARC32 1 +#define WTF_PLATFORM_BIG_ENDIAN 1 +#endif + +#if PLATFORM(SPARC32) || PLATFORM(SPARC64) +#define WTF_PLATFORM_SPARC +#endif + /* PLATFORM(HPPA) */ /* a.k.a. PA-RISC */ #if defined(__hppa) || defined(__hppa__) -- cgit v0.12 From 732e0d01df867200546ddb5e6f8695f263e1ee0d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 18 Nov 2009 19:59:44 +0100 Subject: Fix the evaluation nag in binary installs with commercial licenses. It wasn't generating any message, but it did think it was an evaluation install. So all Qt console applications produced an extra newline and the GUI ones showed the Qt logo briefly. I noticed because of the extra newline when building Qt itself. Reviewed-by: Trust Me --- src/corelib/kernel/qtcore_eval.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp index fe47a30..d5eb8c2 100644 --- a/src/corelib/kernel/qtcore_eval.cpp +++ b/src/corelib/kernel/qtcore_eval.cpp @@ -88,23 +88,12 @@ static const char will_shutdown_now[] = "timeout and will shut down.\n" "Contact http://qt.nokia.com/about/contact-us for pricing and purchasing information.\n"; -static int qt_eval_days_left() +static int qt_eval_is_supported() { const char *const license_key = qt_eval_key_data + 12; // fast fail if (!qt_eval_key_data[0] || !*license_key) - return -2; - - QDate today = QDate::currentDate(); - QDate build = QLibraryInfo::buildDate(); - return qMax(-1, today.daysTo(build) + 30); -} - -static int qt_eval_is_supported() -{ - const char *const license_key = qt_eval_key_data + 12; - if (!qt_eval_key_data[0] || !*license_key) return -1; // is this an unsupported evaluation? @@ -123,6 +112,16 @@ static int qt_eval_is_supported() return -1; } +static int qt_eval_days_left() +{ + if (qt_eval_is_supported() < 0) + return -2; + + QDate today = QDate::currentDate(); + QDate build = QLibraryInfo::buildDate(); + return qMax(-1, today.daysTo(build) + 30); +} + static QString qt_eval_string() { const char *msg; @@ -178,6 +177,9 @@ public: void qt_core_eval_init(uint type) { + if (!type) + return; // GUI app + switch (qt_eval_days_left()) { case -2: return; -- cgit v0.12