From 142ce4d38094f1588b04758a6f9ff6787a784fe3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 12 Aug 2010 15:03:06 +0300 Subject: Make bld.inf target in Symbian mkspecs to depend on .pro file Changes to .pro file weren't previously noticed and therefore qmake wasn't rerun. Qmake command itself was also incorrect. Task-number: QTBUG-12716 Reviewed-by: Shane Kearns --- qmake/generators/symbian/symmake_abld.cpp | 12 ++++++++---- qmake/generators/symbian/symmake_sbsv2.cpp | 11 +++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index c896ac6..85dcab4 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -249,13 +249,17 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool } else { t << "all: debug release" << endl; t << endl; + + QString qmakeCmd = "\t$(QMAKE) \"" + project->projectFile() + "\" " + buildArgs(); + t << "qmake:" << endl; - t << "\t$(QMAKE) -spec symbian-abld -o \"" << fileInfo(Option::output.fileName()).fileName() - << "\" \"" << project->projectFile() << "\"" << endl; + t << qmakeCmd << endl; t << endl; - t << BLD_INF_FILENAME ":" << endl; - t << "\t$(QMAKE)" << endl; + + t << BLD_INF_FILENAME ": " << project->projectFile() << endl; + t << qmakeCmd << endl; t << endl; + t << "$(ABLD): " BLD_INF_FILENAME << endl; t << "\tbldmake bldfiles" << endl; t << endl; diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 534a080..036eb1d 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -278,12 +278,15 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo } else { t << "all: debug release" << endl; t << endl; + + QString qmakeCmd = "\t$(QMAKE) \"" + project->projectFile() + "\" " + buildArgs(); + t << "qmake:" << endl; - t << "\t$(QMAKE) -spec symbian-sbsv2 -o \"" << fileInfo(Option::output.fileName()).fileName() - << "\" \"" << project->projectFile() << "\"" << endl; + t << qmakeCmd << endl; t << endl; - t << BLD_INF_FILENAME ":" << endl; - t << "\t$(QMAKE)" << endl; + + t << BLD_INF_FILENAME ": " << project->projectFile() << endl; + t << qmakeCmd << endl; t << endl; QString currentClause; -- cgit v0.12 From 677b96b3bfcbccae978f0d63f7e16a35783c0eec Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 12 Aug 2010 17:29:29 +0200 Subject: QNAM HTTP: Fix crash related to aborted uploads Task-number: QTBUG-12285 --- src/network/access/qhttpnetworkconnection.cpp | 2 ++ src/network/access/qhttpnetworkconnectionchannel.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 9e2b85e..ae4d257 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -653,6 +653,8 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) // is the reply associated the currently processing of this channel? if (channels[i].reply == reply) { channels[i].reply = 0; + channels[i].request = QHttpNetworkRequest(); + channels[i].resendCurrent = false; if (!reply->isFinished() && !channels[i].alreadyPipelinedRequests.isEmpty()) { // the reply had to be prematurely removed, e.g. it was not finished diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index d3576dd..6437f6f 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -647,8 +647,10 @@ void QHttpNetworkConnectionChannel::allDone() // finished request. // Note that this may trigger a segfault at some other point. But then we can fix the underlying // problem. - if (!resendCurrent) + if (!resendCurrent) { + request = QHttpNetworkRequest(); reply = 0; + } // move next from pipeline to current request if (!alreadyPipelinedRequests.isEmpty()) { -- cgit v0.12 From 5478ba712afeb11768016d05bef975a5a48ae059 Mon Sep 17 00:00:00 2001 From: Donald Carr Date: Thu, 12 Aug 2010 18:43:51 +0000 Subject: Clean up rasterfallback mechanism in DirectFB Being able to debug which paint operations are slow with Qt/DirectFB is currently only possible in debug builds (which defeats the purpose somewhat) or by frequent recompilation (with different defines). This patch cleans up the mechanism somewhat and makes it available in release builds as well. The overhead is a single int comparison so it really isn't a performance issue to have this code in place at all times. Reviewed-by: Anders Bakken --- doc/src/platforms/emb-directfb-EmbLinux.qdoc | 11 ++ .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 187 +++++++++------------ 2 files changed, 95 insertions(+), 103 deletions(-) diff --git a/doc/src/platforms/emb-directfb-EmbLinux.qdoc b/doc/src/platforms/emb-directfb-EmbLinux.qdoc index 955258e..f416819 100644 --- a/doc/src/platforms/emb-directfb-EmbLinux.qdoc +++ b/doc/src/platforms/emb-directfb-EmbLinux.qdoc @@ -153,6 +153,17 @@ manufacturer to manufacture, different operations will be optimized. This require you to define the operations you want to warn about or disable. These are listed above in the DIRECTFB_DRAWINGOPERATIONS variable. +You can also customize this with environment variables. + +E.g. If you want to disable fallbacks for drawPixmap and fillRect and also get +a warning printed on stderr when a fallback would have happened. + +\code +$ export QT_DIRECTFB_WARN_ON_RASTERFALLBACKS="FILL_RECT|DRAW_PIXMAP" +$ export QT_DIRECTFB_DISABLE_RASTERFALLBACKS="FILL_RECT|DRAW_PIXMAP" +$ ./app -qws -display directfb +\endcode + Following is a table showing which options you have. \table diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index e4a0135..d5f0d42 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -167,7 +167,6 @@ struct CachedImage static QCache imageCache(4*1024*1024); // 4 MB #endif -#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS || defined QT_DEBUG #define VOID_ARG() static_cast(false) enum PaintOperation { DRAW_RECTS = 0x0001, DRAW_LINES = 0x0002, DRAW_IMAGE = 0x0004, @@ -178,88 +177,81 @@ enum PaintOperation { DRAW_STATICTEXT = 0x8000, ALL = 0xffff }; -#ifdef QT_DEBUG -static void initRasterFallbacksMasks(int *warningMask, int *disableMask) -{ - struct { - const char *name; - PaintOperation operation; - } const operations[] = { - { "DRAW_RECTS", DRAW_RECTS }, - { "DRAW_LINES", DRAW_LINES }, - { "DRAW_IMAGE", DRAW_IMAGE }, - { "DRAW_PIXMAP", DRAW_PIXMAP }, - { "DRAW_TILED_PIXMAP", DRAW_TILED_PIXMAP }, - { "STROKE_PATH", STROKE_PATH }, - { "DRAW_PATH", DRAW_PATH }, - { "DRAW_POINTS", DRAW_POINTS }, - { "DRAW_ELLIPSE", DRAW_ELLIPSE }, - { "DRAW_POLYGON", DRAW_POLYGON }, - { "DRAW_TEXT", DRAW_TEXT }, - { "FILL_PATH", FILL_PATH }, - { "FILL_RECT", FILL_RECT }, - { "DRAW_COLORSPANS", DRAW_COLORSPANS }, - { "DRAW_ROUNDED_RECT", DRAW_ROUNDED_RECT }, - { "ALL", ALL }, - { 0, ALL } - }; - - QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), - QString::SkipEmptyParts); - QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), - QString::SkipEmptyParts); - *warningMask = 0; - *disableMask = 0; - if (!warning.isEmpty() || !disable.isEmpty()) { - for (int i=0; operations[i].name; ++i) { - const QString name = QString::fromLatin1(operations[i].name); - int idx = warning.indexOf(name); - if (idx != -1) { - *warningMask |= operations[i].operation; - warning.erase(warning.begin() + idx); - } - idx = disable.indexOf(name); - if (idx != -1) { - *disableMask |= operations[i].operation; - disable.erase(disable.begin() + idx); - } - } - } - if (!warning.isEmpty()) { - qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s", - qPrintable(warning.join(QLatin1String("|")))); - } - if (!disable.isEmpty()) { - qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s", - qPrintable(disable.join(QLatin1String("|")))); - } - -} -#endif - -static inline int rasterFallbacksMask(bool warn) +enum { RasterWarn = 1, RasterDisable = 2 }; +static inline uint rasterFallbacksMask(PaintOperation op) { + uint ret = 0; #ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS - if (warn) - return QT_DIRECTFB_WARN_ON_RASTERFALLBACKS; + if (op & QT_DIRECTFB_WARN_ON_RASTERFALLBACKS) + ret |= RasterWarn; #endif #ifdef QT_DIRECTFB_DISABLE_RASTERFALLBACKS - if (!warn) - return QT_DIRECTFB_DISABLE_RASTERFALLBACKS; + if (op & QT_DIRECTFB_DISABLE_RASTERFALLBACKS) + ret |= RasterDisable; #endif -#ifndef QT_DEBUG - return 0; -#else - static int warnMask = -1; + static int warningMask = -1; static int disableMask = -1; - if (warnMask == -1) - initRasterFallbacksMasks(&warnMask, &disableMask); - return warn ? warnMask : disableMask; -#endif + if (warningMask < 0) { + struct { + const char *name; + PaintOperation operation; + } const operations[] = { + { "DRAW_RECTS", DRAW_RECTS }, + { "DRAW_LINES", DRAW_LINES }, + { "DRAW_IMAGE", DRAW_IMAGE }, + { "DRAW_PIXMAP", DRAW_PIXMAP }, + { "DRAW_TILED_PIXMAP", DRAW_TILED_PIXMAP }, + { "STROKE_PATH", STROKE_PATH }, + { "DRAW_PATH", DRAW_PATH }, + { "DRAW_POINTS", DRAW_POINTS }, + { "DRAW_ELLIPSE", DRAW_ELLIPSE }, + { "DRAW_POLYGON", DRAW_POLYGON }, + { "DRAW_TEXT", DRAW_TEXT }, + { "FILL_PATH", FILL_PATH }, + { "FILL_RECT", FILL_RECT }, + { "DRAW_COLORSPANS", DRAW_COLORSPANS }, + { "DRAW_ROUNDED_RECT", DRAW_ROUNDED_RECT }, + { "ALL", ALL }, + { 0, ALL } + }; + + QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), + QString::SkipEmptyParts); + QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), + QString::SkipEmptyParts); + warningMask = 0; + disableMask = 0; + if (!warning.isEmpty() || !disable.isEmpty()) { + for (int i=0; operations[i].name; ++i) { + const QString name = QString::fromLatin1(operations[i].name); + int idx = warning.indexOf(name); + if (idx != -1) { + warningMask |= operations[i].operation; + warning.erase(warning.begin() + idx); + } + idx = disable.indexOf(name); + if (idx != -1) { + disableMask |= operations[i].operation; + disable.erase(disable.begin() + idx); + } + } + } + if (!warning.isEmpty()) { + qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s", + qPrintable(warning.join(QLatin1String("|")))); + } + if (!disable.isEmpty()) { + qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s", + qPrintable(disable.join(QLatin1String("|")))); + } + } + if (op & warningMask) + ret |= RasterWarn; + if (op & disableMask) + ret |= RasterDisable; + return ret; } -#endif -#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG template static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, uint transformationType, bool simplePen, @@ -267,16 +259,14 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, const char *nameThree, const T3 &three); -#endif -#if defined QT_DEBUG || (defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS && defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS) #define RASTERFALLBACK(op, one, two, three) \ { \ - const bool disable = op & rasterFallbacksMask(false); \ - if (op & rasterFallbacksMask(true)) \ - rasterFallbackWarn(disable \ - ? "Disabled raster engine operation" \ - : "Falling back to raster engine for", \ + static const uint rasterFallbacks = rasterFallbacksMask(op); \ + switch (rasterFallbacks) { \ + case 0: break; \ + case RasterWarn: \ + rasterFallbackWarn("Falling back to raster engine for", \ __FUNCTION__, \ state()->painter->device(), \ d_func()->transformationType, \ @@ -284,26 +274,20 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * d_func()->clipType, \ d_func()->compositionModeStatus, \ #one, one, #two, two, #three, three); \ - if (disable) \ + break; \ + case RasterDisable|RasterWarn: \ + rasterFallbackWarn("Disabled raster engine operation", \ + __FUNCTION__, \ + state()->painter->device(), \ + d_func()->transformationType, \ + d_func()->simplePen, \ + d_func()->clipType, \ + d_func()->compositionModeStatus, \ + #one, one, #two, two, #three, three); \ + case RasterDisable: \ return; \ + } \ } -#elif defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS -#define RASTERFALLBACK(op, one, two, three) \ - if (op & rasterFallbacksMask(false)) \ - return; -#elif defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS -#define RASTERFALLBACK(op, one, two, three) \ - if (op & rasterFallbacksMask(true)) \ - rasterFallbackWarn("Falling back to raster engine for", \ - __FUNCTION__, state()->painter->device(), \ - d_func()->transformationType, \ - d_func()->simplePen, \ - d_func()->clipType, \ - d_func()->compositionModeStatus, \ - #one, one, #two, two, #three, three); -#else -#define RASTERFALLBACK(op, one, two, three) -#endif template static inline void drawLines(const T *lines, int n, const QTransform &transform, IDirectFBSurface *surface); @@ -1362,7 +1346,6 @@ static inline void drawRects(const T *rects, int n, const QTransform &transform, } } -#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG template inline const T *ptr(const T &t) { return &t; } template <> inline const bool* ptr(const bool &) { return 0; } template @@ -1403,8 +1386,6 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * qWarning("%s", qPrintable(out)); } -#endif // QT_DIRECTFB_WARN_ON_RASTERFALLBACKS - QT_END_NAMESPACE #endif // QT_NO_QWS_DIRECTFB -- cgit v0.12 From f9fe93e6e85294274d4e0ce81db09783cfacd733 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 13 Aug 2010 12:22:46 +1000 Subject: Clear previous animation data for non-triggering animations. We need to clear the data from the last run if the animation doesn't match any of the state actions (or if there are no actions). Task-number: QTBUG-12805 --- src/declarative/util/qdeclarativeanimation.cpp | 2 ++ .../data/nonTransitionBug.qml | 30 +++++++++++++++++++++ .../tst_qdeclarativeanimations.cpp | 31 ++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index a747706..2fca09d 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -2392,6 +2392,8 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions d->actions = &data->actions; } else { delete data; + d->va->setFromSourcedValue(0); //clear previous data + d->va->setAnimValue(0, QAbstractAnimation::DeleteWhenStopped); //clear previous data d->actions = 0; } } diff --git a/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml new file mode 100644 index 0000000..e9dc36e --- /dev/null +++ b/tests/auto/declarative/qdeclarativeanimations/data/nonTransitionBug.qml @@ -0,0 +1,30 @@ +import Qt 4.7 + +Rectangle { + id: root + width: 200 + height: 200 + + Rectangle { + id: mover + objectName: "mover" + } + + states: [ + State { + name: "free" + }, + State { + name: "left" + PropertyChanges { + restoreEntryValues: false + target: mover + x: 0 + } + } + ] + + transitions: Transition { + PropertyAnimation { properties: "x"; duration: 50 } + } +} diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index ec867fe..e5943fb 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -48,6 +48,8 @@ #include #include +#include "../../../shared/util.h" + #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir #define SRCDIR "." @@ -82,6 +84,7 @@ private slots: void easingProperties(); void rotation(); void runningTrueBug(); + void nonTransitionBug(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -762,6 +765,34 @@ void tst_qdeclarativeanimations::runningTrueBug() QVERIFY(cloud->x() > qreal(0)); } +//QTBUG-12805 +void tst_qdeclarativeanimations::nonTransitionBug() +{ + //tests that the animation values from the previous transition are properly cleared + //in the case where an animation in the transition doesn't match anything (but previously did) + QDeclarativeEngine engine; + + QDeclarativeComponent c(&engine, SRCDIR "/data/nonTransitionBug.qml"); + QDeclarativeRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect != 0); + QDeclarativeItemPrivate *rectPrivate = QDeclarativeItemPrivate::get(rect); + QDeclarativeRectangle *mover = rect->findChild("mover"); + + mover->setX(100); + QCOMPARE(mover->x(), qreal(100)); + + rectPrivate->setState("left"); + QTRY_COMPARE(mover->x(), qreal(0)); + + mover->setX(100); + QCOMPARE(mover->x(), qreal(100)); + + //make sure we don't try to animate back to 0 + rectPrivate->setState("free"); + QTest::qWait(300); + QCOMPARE(mover->x(), qreal(100)); +} + QTEST_MAIN(tst_qdeclarativeanimations) #include "tst_qdeclarativeanimations.moc" -- cgit v0.12 From ade18bab3a2c4c877baa9be2a0012d670dafb64a Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 13 Aug 2010 17:09:27 +1000 Subject: Add autotest that checks that copy and cut don't work when echomode is set to hide text/password mode Task-number: QTBUG-12086 Reviewed-by: Michael Brasser --- .../tst_qdeclarativetextinput.cpp | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 6e15a4a..ca9009d 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -741,6 +741,30 @@ void tst_qdeclarativetextinput::copyAndPaste() { textInput->paste(); QCOMPARE(textInput->text(), QString("Hello world!Hello world!")); QCOMPARE(textInput->text().length(), 24); + + // clear copy buffer + QClipboard *clipboard = QApplication::clipboard(); + QVERIFY(clipboard); + clipboard->clear(); + + // test that copy functionality is disabled + // when echo mode is set to hide text/password mode + int index = 0; + while (index < 4) { + QDeclarativeTextInput::EchoMode echoMode = QDeclarativeTextInput::EchoMode(index); + textInput->setEchoMode(echoMode); + textInput->setText("My password"); + textInput->select(0, textInput->text().length());; + textInput->copy(); + if (echoMode == QDeclarativeTextInput::Normal) { + QVERIFY(!clipboard->text().isEmpty()); + QCOMPARE(clipboard->text(), QString("My password")); + clipboard->clear(); + } else { + QVERIFY(clipboard->text().isEmpty()); + } + index++; + } #endif } -- cgit v0.12