From f3092b91a7a2e9e34dfe7eefb3c6b0ed8c3c3786 Mon Sep 17 00:00:00 2001 From: Guoqing Zhang Date: Tue, 12 Apr 2011 10:45:43 +0300 Subject: Fix OpenGL build break on Symbian Task-number: QT-4871 Reviewed-by: Dmitry Trofimov --- src/s60installs/eabi/QtOpenGLu.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def index 44f7306..34b5266 100644 --- a/src/s60installs/eabi/QtOpenGLu.def +++ b/src/s60installs/eabi/QtOpenGLu.def @@ -759,7 +759,7 @@ EXPORTS _ZNK14QGLPaintDevice9isFlippedEv @ 758 NONAME _ZNK16QGLWindowSurface8featuresEv @ 759 NONAME _ZNK26QGLFramebufferObjectFormat6mipmapEv @ 760 NONAME - _ZTI22QGLContextResourceBase @ 761 NONAME + _ZTI22QGLContextResourceBase @ 761 NONAME ABSENT _ZTI27QGLContextGroupResourceBase @ 762 NONAME _ZTV22QGLContextResourceBase @ 763 NONAME _ZTV27QGLContextGroupResourceBase @ 764 NONAME -- cgit v0.12 From efc004a7ad9f1e40fdba6afc06e161052d9fae2f Mon Sep 17 00:00:00 2001 From: Guoqing Zhang Date: Tue, 12 Apr 2011 10:49:08 +0300 Subject: Add focus frame support in style sheet Task-number: QTBUG-16027 Reviewed-by: Olivier Goffart --- src/gui/styles/qstylesheetstyle.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index ecf924c..faa929e 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -3323,6 +3323,13 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q } break; + case CE_FocusFrame: + if (!rule.hasNativeBorder()) { + rule.drawBorder(p, opt->rect); + return; + } + break; + case CE_PushButton: if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { if (rule.hasDrawable() || rule.hasBox() || rule.hasPosition() || rule.hasPalette() || -- cgit v0.12 From 930db5826ff2c02d54f2851494000c5fab97da54 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 12 Apr 2011 15:23:33 +0300 Subject: Fix "make sis" for projects that have empty OBJECTS_DIR Temp directory for packagaging got created to system root if OBJECTS_DIR was empty. Fixed it to use '.' instead in those cases. Reviewed-by: Janne Koskinen --- mkspecs/features/symbian/sis_targets.prf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/symbian/sis_targets.prf b/mkspecs/features/symbian/sis_targets.prf index d0fe881..f3452b7 100644 --- a/mkspecs/features/symbian/sis_targets.prf +++ b/mkspecs/features/symbian/sis_targets.prf @@ -26,7 +26,11 @@ equals(GENERATE_SIS_TARGETS, true) { qtPrepareTool(QMAKE_CREATEPACKAGE, createpackage) - CREATEPACKAGE_DIR = $$OBJECTS_DIR/createpackage_tmp + sis_objects_dir = $$OBJECTS_DIR + isEmpty(sis_objects_dir):sis_objects_dir = . + + CREATEPACKAGE_DIR = $$sis_objects_dir/createpackage_tmp + QMAKE_CLEAN += $$CREATEPACKAGE_DIR/* symbian-abld|symbian-sbsv2 { -- cgit v0.12 From 01477af79d8114b3f8993c3967892538a599dfa6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 13 Apr 2011 11:58:40 +0300 Subject: Improve logic to find default certificates in createpackage script Original implementation assumed createpackage script was always run from under Qt source tree bin directory, which is not always the case as on some platforms the Qt tools can be found from under EPOCROOT. Fixed it so that if the default directory for default certificates can't be found in the expected location, createpackage will attempt to query qmake in the same directory as the createpackage script for the location of the Qt source tree (QT_INSTALL_PREFIX) and look for default certificates directory from under there. Task-number: QTBUG-18684 Reviewed-by: Janne Koskinen --- bin/createpackage.pl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/createpackage.pl b/bin/createpackage.pl index b7457e1..aae20ae 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -238,11 +238,7 @@ if ($templatepkg =~ m/_installer\.pkg$/i && $onlyUnsigned) { my $unsigned_sis_name = $sisoutputbasename."_unsigned.sis"; my $stub_sis_name = $sisoutputbasename.".sis"; -# Store some utility variables -my $scriptpath = dirname(__FILE__); my $certtext = $certificate; -# certificates are one step up in hierarchy -my $certpath = File::Spec->catdir($scriptpath, File::Spec->updir(), "src/s60installs/"); # Check some pre-conditions and print error messages if needed. unless (length($templatepkg)) { @@ -265,6 +261,16 @@ if (length($certificate)) { } } else { #If no certificate is given, check default options + my $scriptpath = dirname(__FILE__); + my $certpath = File::Spec->catdir($scriptpath, File::Spec->updir(), "src/s60installs"); + + unless (-e $certpath) { + my $qmakeCmd = File::Spec->catfile($scriptpath, "qmake"); + $certpath = `$qmakeCmd -query QT_INSTALL_PREFIX`; + $certpath =~ s/\s+$//; + $certpath = File::Spec->catdir($certpath, "src/s60installs"); + } + $certtext = "RnD"; $certificate = File::Spec->catfile($certpath, "rd.cer"); $key = File::Spec->catfile($certpath, "rd-key.pem"); -- cgit v0.12 From 00b18457d5efb9224f3b066bab9e9f601fbcf543 Mon Sep 17 00:00:00 2001 From: Tomi Vihria Date: Thu, 14 Apr 2011 11:19:24 +0300 Subject: Enablers for the Qt eclipsing in Symbian Remove file listing from the stub package file to ease maintenance, generate stub sis from it and export it to the correct location to be included into ROM. Task-number: QT-4817 Reviewed-by: Guoqing Zhang --- config.profiles/symbian/bld.inf | 6 ++-- config.profiles/symbian/qt_stub.pkg | 53 ------------------------------------ config.profiles/symbian/qt_stub.sis | Bin 0 -> 324 bytes 3 files changed, 4 insertions(+), 55 deletions(-) create mode 100644 config.profiles/symbian/qt_stub.sis diff --git a/config.profiles/symbian/bld.inf b/config.profiles/symbian/bld.inf index ddb5157..16a9e15 100644 --- a/config.profiles/symbian/bld.inf +++ b/config.profiles/symbian/bld.inf @@ -38,10 +38,12 @@ loc.prf /epoc32/tools/qt/mkspecs/features/loc.prf //For UDA image confml/qt.confml CONFML_EXPORT_PATH(qt.confml,uda_content) implml/qt_copy.implml CRML_EXPORT_PATH(qt_copy.implml,uda_content) -content/apps/qt.sisx CRML_EXPORT_PATH(../content/sis/,uda_content) -content/apps/qt_stub.sis /epoc32/data/z/system/install/qt_stub.sis +content/apps/qt.sisx CRML_EXPORT_PATH(../content/sis/,uda_content) #endif +/* export stub sis to enable eclipsing */ +qt_stub.sis /epoc32/data/z/system/install/qt_stub.sis + //tools ../../bin/createpackage.bat /epoc32/tools/createpackage.bat ../../bin/createpackage.pl /epoc32/tools/createpackage.pl diff --git a/config.profiles/symbian/qt_stub.pkg b/config.profiles/symbian/qt_stub.pkg index dadf696..0ac4439 100644 --- a/config.profiles/symbian/qt_stub.pkg +++ b/config.profiles/symbian/qt_stub.pkg @@ -15,56 +15,3 @@ ; Unique Vendor name :"Nokia, Qt" -; Dependencies of Qt libraries - -"" - "z:\sys\bin\QtCore.dll" -"" - "z:\sys\bin\QtXml.dll" -"" - "z:\sys\bin\QtGui.dll" -"" - "z:\sys\bin\QtNetwork.dll" -"" - "z:\sys\bin\QtTest.dll" -"" - "z:\sys\bin\QtSql.dll" -"" - "z:\sys\bin\QtSvg.dll" -"" - "z:\sys\bin\phonon.dll" -"" - "z:\sys\bin\QtScript.dll" -"" - "z:\sys\bin\QtXmlPatterns.dll" -"" - "z:\sys\bin\QtDeclarative.dll" -"" - "z:\sys\bin\QtOpenVG.dll" -"" - "z:\sys\bin\QtOpenGL.dll" -"" - "z:\sys\bin\QtMultimedia.dll" -"" - "z:\private\10202D56\import\packages\2001E61C\backup_registration.xml" -"" - "z:\sys\bin\qjpeg.dll" -"" - "z:\resource\qt\plugins\imageformats\qjpeg.qtplugin" -"" - "z:\sys\bin\qgif.dll" -"" - "z:\resource\qt\plugins\imageformats\qgif.qtplugin" -"" - "z:\sys\bin\qmng.dll" -"" - "z:\resource\qt\plugins\imageformats\qmng.qtplugin" -"" - "z:\sys\bin\qtiff.dll" -"" - "z:\resource\qt\plugins\imageformats\qtiff.qtplugin" -"" - "z:\sys\bin\qico.dll" -"" - "z:\resource\qt\plugins\imageformats\qico.qtplugin" -"" - "z:\sys\bin\qsvg.dll" -"" - "z:\resource\qt\plugins\imageformats\qsvg.qtplugin" -"" - "z:\sys\bin\qcncodecs.dll" -"" - "z:\resource\qt\plugins\codecs\qcncodecs.qtplugin" -"" - "z:\sys\bin\qjpcodecs.dll" -"" - "z:\resource\qt\plugins\codecs\qjpcodecs.qtplugin" -"" - "z:\sys\bin\qtwcodecs.dll" -"" - "z:\resource\qt\plugins\codecs\qtwcodecs.qtplugin" -"" - "z:\sys\bin\qkrcodecs.dll" -"" - "z:\resource\qt\plugins\codecs\qkrcodecs.qtplugin" -"" - "z:\sys\bin\qvggraphicssystem.dll" -"" - "z:\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin" -"" - "z:\sys\bin\qglgraphicssystem.dll" -"" - "z:\resource\qt\plugins\graphicssystems\qglgraphicssystem.qtplugin" -"" - "z:\sys\bin\qsvgicon.dll" -"" - "z:\resource\qt\plugins\iconengines\qsvgicon.qtplugin" -"" - "z:\sys\bin\qmlfolderlistmodelplugin.dll" -"" - "z:\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin" -"" - "z:\resource\qt\imports\Qt\labs\folderlistmodel\qmldir" -"" - "z:\sys\bin\qmlgesturesplugin.dll" -"" - "z:\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin" -"" - "z:\resource\qt\imports\Qt\labs\gestures\qmldir" -"" - "z:\sys\bin\qmlparticlesplugin.dll" -"" - "z:\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin" -"" - "z:\resource\qt\imports\Qt\labs\particles\qmldir" - diff --git a/config.profiles/symbian/qt_stub.sis b/config.profiles/symbian/qt_stub.sis new file mode 100644 index 0000000..30d91a9 Binary files /dev/null and b/config.profiles/symbian/qt_stub.sis differ -- cgit v0.12 From 6dcb0028e44cba2a00c2fb867fb1757ad5b1a254 Mon Sep 17 00:00:00 2001 From: Tomi Vihria Date: Thu, 14 Apr 2011 15:39:08 +0300 Subject: Fixed Qt UDA creation for Symbian Added a dummy Qt sis file and fixed paths in bld.inf. Otherwise build would fail when FF_QT_IN_UDA is defined. Dummy Qt sis file needs to replaced with a real one when actual UDA image is created. Task-number: QT-4888 Reviewed-by: Guoqing Zhang --- config.profiles/symbian/bld.inf | 2 +- config.profiles/symbian/qt.sisx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 config.profiles/symbian/qt.sisx diff --git a/config.profiles/symbian/bld.inf b/config.profiles/symbian/bld.inf index 16a9e15..6ccb11c 100644 --- a/config.profiles/symbian/bld.inf +++ b/config.profiles/symbian/bld.inf @@ -38,7 +38,7 @@ loc.prf /epoc32/tools/qt/mkspecs/features/loc.prf //For UDA image confml/qt.confml CONFML_EXPORT_PATH(qt.confml,uda_content) implml/qt_copy.implml CRML_EXPORT_PATH(qt_copy.implml,uda_content) -content/apps/qt.sisx CRML_EXPORT_PATH(../content/sis/,uda_content) +qt.sisx CRML_EXPORT_PATH(../content/sis/,uda_content) #endif /* export stub sis to enable eclipsing */ diff --git a/config.profiles/symbian/qt.sisx b/config.profiles/symbian/qt.sisx new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/config.profiles/symbian/qt.sisx @@ -0,0 +1 @@ +1 \ No newline at end of file -- cgit v0.12 From da8f333cfe17a53d475208efa36fa369a9ee4638 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 18 Apr 2011 15:40:26 +0300 Subject: Do not modify window size for fullscreen windows in setGeometry_sys Minimum sizes of widgets can cause windows to expand beyond screen limits in QWidgetPrivate::setGeometry_sys. Normally this is not noticeable as the window size is forced in various places to the clientRect, but there are certain sequences where the size set in setGeometry_sys is the final one, resulting in too large windows. Removed the modification of window size in setGeometry_sys for fullscreen windows for which the correct size is already requested. Task-number: QTBUG-18749 Reviewed-by: Sami Merila --- src/gui/kernel/qwidget_s60.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 83e46e5..96b0776 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -239,7 +239,16 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) if (w != oldSize.width() || h != oldSize.height()) data.window_state &= ~Qt::WindowMaximized; - if (extra) { // any size restrictions? + bool checkExtra = true; + if (q->isWindow() && (data.window_state & Qt::WindowFullScreen)) { + // Do not modity window size for fullscreen windows, if requested + // size is already equal to clientRect. + TRect r = static_cast(S60->appUi())->ClientRect(); + if (w == r.Width() && h == r.Height()) + checkExtra = false; + } + + if (checkExtra && extra) { // any size restrictions? w = qMin(w,extra->maxw); h = qMin(h,extra->maxh); w = qMax(w,extra->minw); -- cgit v0.12 From 41aa023ef6019ac9745b780c953f48b8bbc42a42 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 18 Apr 2011 17:05:38 +0200 Subject: Create a cleanup stack for each new thread on Symbian. The native thread implementation in Qt 4.8 did not call CTrapCleanup::New() which resulted in E32USER-CBASE 69 panics in applications when they tried to use the cleanup stack in a thread's run() function. In 4.7 this was working because OpenC's pthread implementation created a CTrapCleanup automatically. Now we do it also in the native Symbian thread implementation. Trask-number: QTBUG-18822 Reviewed-by: Murray Read --- src/corelib/thread/qthread_symbian.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/thread/qthread_symbian.cpp b/src/corelib/thread/qthread_symbian.cpp index 1474b36..436c105 100644 --- a/src/corelib/thread/qthread_symbian.cpp +++ b/src/corelib/thread/qthread_symbian.cpp @@ -319,6 +319,8 @@ void *QThreadPrivate::start(void *arg) data->quitNow = thr->d_func()->exited; } + CTrapCleanup *cleanup = CTrapCleanup::New(); + // ### TODO: allow the user to create a custom event dispatcher createEventDispatcher(data); @@ -327,6 +329,8 @@ void *QThreadPrivate::start(void *arg) QThreadPrivate::finish(arg); + delete cleanup; + return 0; } -- cgit v0.12 From 39202973e3fb7ff37033290b29efa1b9edc674fb Mon Sep 17 00:00:00 2001 From: mread Date: Tue, 19 Apr 2011 13:12:24 +0100 Subject: Symbian's QElapsedTimer::restart() fixed to return ms rather than us Symbian's QElapsedTimer::restart() had accidently been changed to return a microsecond count rather than milliseconds, when the elapsed timer resolution was increased. This fixes it back to milliseconds. Reviewed-by: Shane Kearns --- src/corelib/tools/qelapsedtimer_symbian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qelapsedtimer_symbian.cpp b/src/corelib/tools/qelapsedtimer_symbian.cpp index b831e03..3667b05 100644 --- a/src/corelib/tools/qelapsedtimer_symbian.cpp +++ b/src/corelib/tools/qelapsedtimer_symbian.cpp @@ -95,7 +95,7 @@ qint64 QElapsedTimer::restart() qint64 oldt1 = t1; t1 = getMicrosecondFromTick(); t2 = 0; - return t1 - oldt1; + return (t1 - oldt1) / 1000; } qint64 QElapsedTimer::nsecsElapsed() const -- cgit v0.12 From 986ab48f1128bdd56fa408fca8f4a564e874dd4d Mon Sep 17 00:00:00 2001 From: Honglei Zhang Date: Tue, 19 Apr 2011 17:29:27 +0300 Subject: Fix memory leak bugs in XmlPatterns In XmlPatterns implementation, QExplicitlySharedDataPointer and QSharedData classes are widely used. The over use of these classes has cuased couple of cyclic references. Some codes are refactored to use plain C++ pointer to break the reference loop. Task-number: QTBUG-15191 Reviewed-by: Laszlo Agocs and Sami Merila --- src/xmlpatterns/data/qitem_p.h | 4 ++++ src/xmlpatterns/expr/qdynamiccontextstore.cpp | 8 ++++---- src/xmlpatterns/expr/qdynamiccontextstore_p.h | 2 +- src/xmlpatterns/expr/qevaluationcache.cpp | 2 +- src/xmlpatterns/expr/qevaluationcache_p.h | 2 +- src/xmlpatterns/expr/qletclause.cpp | 2 +- tests/auto/qxmlquery/tst_qxmlquery.cpp | 4 ++-- tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro | 2 ++ tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro | 2 ++ tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro | 2 ++ 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/xmlpatterns/data/qitem_p.h b/src/xmlpatterns/data/qitem_p.h index 8184b25..fb3866e 100644 --- a/src/xmlpatterns/data/qitem_p.h +++ b/src/xmlpatterns/data/qitem_p.h @@ -408,6 +408,10 @@ namespace QPatternist inline void reset() { + /* Delete the atomicValue if necessary*/ + if(isAtomicValue() && !atomicValue->ref.deref()) + delete atomicValue; + /* Note that this function should be equal to the default * constructor. */ node.model = 0; diff --git a/src/xmlpatterns/expr/qdynamiccontextstore.cpp b/src/xmlpatterns/expr/qdynamiccontextstore.cpp index 762b7d6..7e7ead7 100644 --- a/src/xmlpatterns/expr/qdynamiccontextstore.cpp +++ b/src/xmlpatterns/expr/qdynamiccontextstore.cpp @@ -51,24 +51,24 @@ using namespace QPatternist; DynamicContextStore::DynamicContextStore(const Expression::Ptr &operand, const DynamicContext::Ptr &context) : SingleContainer(operand), - m_context(context) + m_context(context.data()) { Q_ASSERT(context); } bool DynamicContextStore::evaluateEBV(const DynamicContext::Ptr &) const { - return m_operand->evaluateEBV(m_context); + return m_operand->evaluateEBV(DynamicContext::Ptr(m_context)); } Item::Iterator::Ptr DynamicContextStore::evaluateSequence(const DynamicContext::Ptr &) const { - return m_operand->evaluateSequence(m_context); + return m_operand->evaluateSequence(DynamicContext::Ptr(m_context)); } Item DynamicContextStore::evaluateSingleton(const DynamicContext::Ptr &) const { - return m_operand->evaluateSingleton(m_context); + return m_operand->evaluateSingleton(DynamicContext::Ptr(m_context)); } SequenceType::Ptr DynamicContextStore::staticType() const diff --git a/src/xmlpatterns/expr/qdynamiccontextstore_p.h b/src/xmlpatterns/expr/qdynamiccontextstore_p.h index 1d5d035..40bfcd1 100644 --- a/src/xmlpatterns/expr/qdynamiccontextstore_p.h +++ b/src/xmlpatterns/expr/qdynamiccontextstore_p.h @@ -86,7 +86,7 @@ namespace QPatternist virtual const SourceLocationReflection *actualReflection() const; private: - const DynamicContext::Ptr m_context; + DynamicContext *m_context; }; } diff --git a/src/xmlpatterns/expr/qevaluationcache.cpp b/src/xmlpatterns/expr/qevaluationcache.cpp index 2d1bb56..cb95af6 100644 --- a/src/xmlpatterns/expr/qevaluationcache.cpp +++ b/src/xmlpatterns/expr/qevaluationcache.cpp @@ -49,7 +49,7 @@ template EvaluationCache::EvaluationCache(const Expression::Ptr &op, const VariableDeclaration::Ptr &varDecl, const VariableSlotID aSlot) : SingleContainer(op) - , m_declaration(varDecl) + , m_declaration(varDecl.constData()) , m_varSlot(aSlot) { Q_ASSERT(m_declaration); diff --git a/src/xmlpatterns/expr/qevaluationcache_p.h b/src/xmlpatterns/expr/qevaluationcache_p.h index 86aeaf8..af4cfa0 100644 --- a/src/xmlpatterns/expr/qevaluationcache_p.h +++ b/src/xmlpatterns/expr/qevaluationcache_p.h @@ -124,7 +124,7 @@ namespace QPatternist private: static DynamicContext::Ptr topFocusContext(const DynamicContext::Ptr &context); - const VariableDeclaration::Ptr m_declaration; + const VariableDeclaration* m_declaration; /** * This variable must not be called m_slot. If it so, a compiler bug on * HP-UX-aCC-64 is triggered in the constructor initializor. See the diff --git a/src/xmlpatterns/expr/qletclause.cpp b/src/xmlpatterns/expr/qletclause.cpp index d3e939b..b789b48 100644 --- a/src/xmlpatterns/expr/qletclause.cpp +++ b/src/xmlpatterns/expr/qletclause.cpp @@ -60,7 +60,7 @@ LetClause::LetClause(const Expression::Ptr &operand1, DynamicContext::Ptr LetClause::bindVariable(const DynamicContext::Ptr &context) const { - context->setExpressionVariable(m_varDecl->slot, Expression::Ptr(new DynamicContextStore(m_operand1, context))); + context->setExpressionVariable(m_varDecl->slot, m_operand1); return context; } diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index e3c97d2..2e0d1aa 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -3301,8 +3301,8 @@ void tst_QXmlQuery::bindVariableQXmlQueryInvalidate() const QXmlQuery query2; query2.setQuery("'query2'"); - query.bindVariable(QLatin1String("name"), query); - QVERIFY(!query.isValid()); + query2.bindVariable(QLatin1String("name"), query); + QVERIFY(!query2.isValid()); } void tst_QXmlQuery::unknownSourceLocation() const diff --git a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro index 3e252f6..48c79d5 100644 --- a/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro +++ b/tests/auto/xmlpatternsdiagnosticsts/xmlpatternsdiagnosticsts.pro @@ -25,3 +25,5 @@ wince*|symbian { catalog.path = . DEPLOYMENT += catalog } + +requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro index f36211e..0fb5fef 100644 --- a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro +++ b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro @@ -25,3 +25,5 @@ INCLUDEPATH += $$QT_SOURCE_TREE/tests/auto/xmlpatternssdk/ \ $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts \ ../xmlpatternsxqts \ ../xmlpatternssdk + +requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro index e81888a..0ced633 100644 --- a/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro +++ b/tests/auto/xmlpatternsxqts/xmlpatternsxqts.pro @@ -19,3 +19,5 @@ INCLUDEPATH += $$(QTDIR)/include/QtXmlPatterns/private \ CONFIG += testlib QT += xml TARGET = tst_xmlpatternsxqts + +requires(contains(QT_CONFIG,private_tests)) -- cgit v0.12 From 0061f7e015b10ccaa45dc35b68cac467ebad424a Mon Sep 17 00:00:00 2001 From: Honglei Zhang Date: Wed, 20 Apr 2011 09:44:29 +0300 Subject: Fix autotest failure in XmlPattern qxmlquery The bug fix for the memory leak in qxmlquery tried to fix a memory leak in autotest test driver. The fix broke the autotest logic and causes failure. This one fix the commit 986ab48f112... Task-number: QTBUG-15191 Reviewed-by: Sami Merila --- tests/auto/qxmlquery/tst_qxmlquery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 2e0d1aa..5828367 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -3301,8 +3301,8 @@ void tst_QXmlQuery::bindVariableQXmlQueryInvalidate() const QXmlQuery query2; query2.setQuery("'query2'"); - query2.bindVariable(QLatin1String("name"), query); - QVERIFY(!query2.isValid()); + query.bindVariable(QLatin1String("name"), query2); + QVERIFY(!query.isValid()); } void tst_QXmlQuery::unknownSourceLocation() const -- cgit v0.12 From 0c62e02b80570bf8b92eff7acceb9018df61c89e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 26 Apr 2011 15:35:51 +0200 Subject: Make text rendering working outside the gui thread on Symbian. It was previously not possible to render text (QPainter::drawText) in a secondary thread on Symbian, it always resulted in some kind of panic. This patch corrects it. For S60 5.0 and earlier the behavior is not changed, threaded text rendering is only supported on Symbian^3 and newer. This also means QFontDatabase::supportsThreadedFontRendering() will return true from now on, but only on Symbian^3 and higher. Task-number: QTBUG-18516 Reviewed-by: mread --- src/gui/kernel/qapplication_s60.cpp | 3 +++ src/gui/kernel/qt_s60_p.h | 26 ++++++++++++++++++++++++++ src/gui/text/qfontdatabase_s60.cpp | 30 +++++++++++++++++++----------- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 0688061..937f485 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -2606,6 +2606,9 @@ QS60ThreadLocalData::QS60ThreadLocalData() QS60ThreadLocalData::~QS60ThreadLocalData() { + for (int i = 0; i < releaseFuncs.count(); ++i) + releaseFuncs[i](); + releaseFuncs.clear(); if (!usingCONEinstances) { delete screenDevice; wsSession.Close(); diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index ee0b862..288ee99 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -90,6 +90,10 @@ static const int qt_symbian_max_screens = 4; //this macro exists because EColor16MAP enum value doesn't exist in Symbian OS 9.2 #define Q_SYMBIAN_ECOLOR16MAP TDisplayMode(13) +class QSymbianTypeFaceExtras; +typedef QHash QSymbianTypeFaceExtrasHash; +typedef void (*QThreadLocalReleaseFunc)(); + class Q_AUTOTEST_EXPORT QS60ThreadLocalData { public: @@ -98,6 +102,8 @@ public: bool usingCONEinstances; RWsSession wsSession; CWsScreenDevice *screenDevice; + QSymbianTypeFaceExtrasHash fontData; + QVector releaseFuncs; }; class QS60Data @@ -168,6 +174,8 @@ public: inline CWsScreenDevice* screenDevice(const QWidget *widget); inline CWsScreenDevice* screenDevice(int screenNumber); static inline int screenNumberForWidget(const QWidget *widget); + inline QSymbianTypeFaceExtrasHash& fontData(); + inline void addThreadLocalReleaseFunc(QThreadLocalReleaseFunc func); static inline CCoeAppUi* appUi(); static inline CEikMenuBar* menuBar(); #ifdef Q_WS_S60 @@ -454,6 +462,24 @@ inline int QS60Data::screenNumberForWidget(const QWidget *widget) return qt_widget_private(const_cast(w))->symbianScreenNumber; } +inline QSymbianTypeFaceExtrasHash& QS60Data::fontData() +{ + if (!tls.hasLocalData()) { + tls.setLocalData(new QS60ThreadLocalData); + } + return tls.localData()->fontData; +} + +inline void QS60Data::addThreadLocalReleaseFunc(QThreadLocalReleaseFunc func) +{ + if (!tls.hasLocalData()) { + tls.setLocalData(new QS60ThreadLocalData); + } + QS60ThreadLocalData *data = tls.localData(); + if (!data->releaseFuncs.contains(func)) + data->releaseFuncs.append(func); +} + inline CCoeAppUi* QS60Data::appUi() { return CCoeEnv::Static()-> AppUi(); diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 6d3970e..3c7255b 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -152,7 +152,6 @@ public: COpenFontRasterizer *m_rasterizer; mutable QList m_extras; - mutable QHash m_extrasHash; mutable QSet m_applicationFontFamilies; }; @@ -255,8 +254,9 @@ void QSymbianFontDatabaseExtrasImplementation::clear() static_cast(db->symbianExtras); if (!dbExtras) return; // initializeDb() has never been called + QSymbianTypeFaceExtrasHash &extrasHash = S60->fontData(); if (QSymbianTypeFaceExtras::symbianFontTableApiAvailable()) { - qDeleteAll(dbExtras->m_extrasHash); + qDeleteAll(extrasHash); } else { typedef QList::iterator iterator; for (iterator p = dbExtras->m_extras.begin(); p != dbExtras->m_extras.end(); ++p) { @@ -265,11 +265,16 @@ void QSymbianFontDatabaseExtrasImplementation::clear() } dbExtras->m_extras.clear(); } - dbExtras->m_extrasHash.clear(); + extrasHash.clear(); } void qt_cleanup_symbianFontDatabase() { + static bool cleanupDone = false; + if (cleanupDone) + return; + cleanupDone = true; + QFontDatabasePrivate *db = privateDb(); if (!db) return; @@ -320,9 +325,12 @@ COpenFont* OpenFontFromBitmapFont(const CBitmapFont* aBitmapFont) const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(const QString &aTypeface, bool bold, bool italic) const { + QSymbianTypeFaceExtrasHash &extrasHash = S60->fontData(); + if (extrasHash.isEmpty() && QThread::currentThread() != QApplication::instance()->thread()) + S60->addThreadLocalReleaseFunc(clear); const QString typeface = qt_symbian_fontNameWithAppFontMarker(aTypeface); const QString searchKey = typeface + QString::number(int(bold)) + QString::number(int(italic)); - if (!m_extrasHash.contains(searchKey)) { + if (!extrasHash.contains(searchKey)) { TFontSpec searchSpec(qt_QString2TPtrC(typeface), 1); if (bold) searchSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold); @@ -336,7 +344,7 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c QScopedPointer sFont(font); QSymbianTypeFaceExtras *extras = new QSymbianTypeFaceExtras(font); sFont.take(); - m_extrasHash.insert(searchKey, extras); + extrasHash.insert(searchKey, extras); } else { const TInt err = m_store->GetNearestFontToDesignHeightInPixels(font, searchSpec); Q_ASSERT(err == KErrNone && font); @@ -350,20 +358,20 @@ const QSymbianTypeFaceExtras *QSymbianFontDatabaseExtrasImplementation::extras(c const TOpenFontFaceAttrib* const attrib = openFont->FaceAttrib(); const QString foundKey = QString((const QChar*)attrib->FullName().Ptr(), attrib->FullName().Length()); - if (!m_extrasHash.contains(foundKey)) { + if (!extrasHash.contains(foundKey)) { QScopedPointer sFont(font); QSymbianTypeFaceExtras *extras = new QSymbianTypeFaceExtras(font, openFont); sFont.take(); m_extras.append(extras); - m_extrasHash.insert(searchKey, extras); - m_extrasHash.insert(foundKey, extras); + extrasHash.insert(searchKey, extras); + extrasHash.insert(foundKey, extras); } else { m_store->ReleaseFont(font); - m_extrasHash.insert(searchKey, m_extrasHash.value(foundKey)); + extrasHash.insert(searchKey, extrasHash.value(foundKey)); } } } - return m_extrasHash.value(searchKey); + return extrasHash.value(searchKey); } void QSymbianFontDatabaseExtrasImplementation::removeAppFontData( @@ -956,7 +964,7 @@ bool QFontDatabase::removeAllApplicationFonts() bool QFontDatabase::supportsThreadedFontRendering() { - return false; + return QSymbianTypeFaceExtras::symbianFontTableApiAvailable(); } static -- cgit v0.12 From b4b4e3311f06ef79e307f90eb216b05ed2990358 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 11 Apr 2011 14:42:04 +0300 Subject: Implement support for enable_backup CONFIG value. The enable_backup CONFIG value can be used to generate deployment for backup registration file for an application. BACKUP_REGISTRATION_FILE_SYMBIAN and BACKUP_REGISTRATION_FILE_MAEMO variables can be used to specify a custom backup registration files. Only works on Symbian and Maemo platforms. Task-number: QTBUG-17214 Reviewed-by: Oswald Buddenhagen --- doc/src/development/qmake-manual.qdoc | 49 ++++++++++++++++++++++++++ mkspecs/common/symbian/backup_registration.xml | 8 +++++ mkspecs/features/enable_backup.prf | 43 ++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 mkspecs/common/symbian/backup_registration.xml create mode 100644 mkspecs/features/enable_backup.prf diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 2bc8a34..0149da2 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1120,6 +1120,44 @@ \tableofcontents{3} + + \target BACKUP_REGISTRATION_FILE_MAEMO + \section1 BACKUP_REGISTRATION_FILE_MAEMO + + \e {This is only used on the Maemo platform.} + + This variable is used to specify the backup registration file to use with + \c enable_backup \c CONFIG value for Maemo platform. The default value is: + \c{$$_PRO_FILE_PWD_/backup_registration/maemo/$$basename(TARGET).conf}. + + Unfortunately it is not possible to have a common registration file for Maemo like there is + for Symbian, so the developer must always provide one if the platform default backup support is + not sufficient. + + For documentation about how to create backup registration files and how the device + backup works in general, see: + (\l{http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Generic_Platform_Components/Using_Backup_Application}{Using Backup Application}) + + \target BACKUP_REGISTRATION_FILE_SYMBIAN + \section1 BACKUP_REGISTRATION_FILE_SYMBIAN + + \e {This is only used on the Symbian platform.} + + This variable is used to specify the backup registration file to use with + \c enable_backup \c CONFIG value for Symbian platform. The default value is + determined as follows: + + If a custom registration file \c{$$_PRO_FILE_PWD_/backup_registration/symbian/backup_registration.xml} + exists, it is used. Otherwise, the common registration file \c{$$[QT_INSTALL_DATA]/mkspecs/common/symbian/backup_registration.xml} + is used. This common registration file will define backing up of application binaries, + resources, and all files under application private directory. Also note that \c{C:/Data} + contents are backed up by default on Symbian devices, so no registration is needed for any + files found there. + + For documentation about how to create backup registration files and how the device + backup works in general, see: + (\l{http://library.forum.nokia.com/index.jsp?topic=/S60_5th_Edition_Cpp_Developers_Library/GUID-35228542-8C95-4849-A73F-2B4F082F0C44/sdk/doc_source/guide/Connectivity-subsystem-guide/Connectivity/PC_Connectivity_How-To_Write_Backup_Aware_Software.html}{How-To Write Backup-aware Software}) + \target BLD_INF_RULES \section1 BLD_INF_RULES @@ -1341,6 +1379,17 @@ so some \c{.ts} files may be ignored by qmake. \endtable + These options only have an effect on Symbian and Maemo platforms: + + \table 95% + \header \o Option \o Description + \row \o enable_backup \o Generates deployment for backup registration file + to enable backing up the application during device backup. + See \l{#BACKUP_REGISTRATION_FILE_MAEMO}{BACKUP_REGISTRATION_FILE_MAEMO} + and \l{#BACKUP_REGISTRATION_FILE_SYMBIAN}{BACKUP_REGISTRATION_FILE_SYMBIAN} + for more information about backup. + \endtable + These options have an effect on Linux/Unix platforms: \table 95% diff --git a/mkspecs/common/symbian/backup_registration.xml b/mkspecs/common/symbian/backup_registration.xml new file mode 100644 index 0000000..794e11d --- /dev/null +++ b/mkspecs/common/symbian/backup_registration.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/mkspecs/features/enable_backup.prf b/mkspecs/features/enable_backup.prf new file mode 100644 index 0000000..7700ca2 --- /dev/null +++ b/mkspecs/features/enable_backup.prf @@ -0,0 +1,43 @@ +# Generate deployment for backup registration file for mobile devices +symbian|maemo5|linux-g++-maemo { + symbian { + isEmpty(BACKUP_REGISTRATION_FILE_SYMBIAN) { + # Do not require a custom registration file in Symbian builds as the + # default file can be used as is in vast majority of projects. + # However, if the custom file exists in the default location, use that. + + CUSTOM_BACKUP_REG_FILE = $$_PRO_FILE_PWD_/backup_registration/symbian/backup_registration.xml + + exists($$CUSTOM_BACKUP_REG_FILE) { + BACKUP_REGISTRATION_FILE = $$CUSTOM_BACKUP_REG_FILE + } else { + BACKUP_REGISTRATION_FILE = $$[QT_INSTALL_DATA]/mkspecs/common/symbian/backup_registration.xml + } + } else { + BACKUP_REGISTRATION_FILE = $$BACKUP_REGISTRATION_FILE_SYMBIAN + } + + contains(TEMPLATE, app) { + enable_backup_deployment.path = /private/$$replace(TARGET.UID3, 0x,) + } else { + enable_backup_deployment.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,) + } + DEPLOYMENT += enable_backup_deployment + } else { + isEmpty(BACKUP_REGISTRATION_FILE_MAEMO) { + BACKUP_REGISTRATION_FILE = $$_PRO_FILE_PWD_/backup_registration/maemo/$$basename(TARGET).conf + } else { + BACKUP_REGISTRATION_FILE = $$BACKUP_REGISTRATION_FILE_MAEMO + } + + enable_backup_deployment.path = /etc/osso-backup/applications + INSTALLS += enable_backup_deployment + } + + # Make sure that BACKUP_REGISTRATION_FILE has absolute path, otherwise the following exists check will not work. + !contains(BACKUP_REGISTRATION_FILE, "(^/|^\\\\|^.:).*"): BACKUP_REGISTRATION_FILE = $$_PRO_FILE_PWD_/$$BACKUP_REGISTRATION_FILE + + !exists($$BACKUP_REGISTRATION_FILE): warning(The backup registration file \'$$BACKUP_REGISTRATION_FILE\' was not found. Please provide a valid backup registration file.) + + enable_backup_deployment.files = $$BACKUP_REGISTRATION_FILE +} -- cgit v0.12 From 903d4dc2196df2775255c24c707bfeb571992bb7 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 26 Apr 2011 16:01:08 +0200 Subject: Added autotest for threaded text rendering. Task-number: QTBUG-18516 Reviewed-by: TRUSTME --- tests/auto/qpainter/tst_qpainter.cpp | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index c21514b..33e4c49 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -72,6 +72,7 @@ #include #include #include +#include #if defined(Q_OS_SYMBIAN) # define SRCDIR "." @@ -264,6 +265,8 @@ private slots: void QTBUG17053_zeroDashPattern(); + void drawTextOutsideGuiThread(); + private: void fillData(); void setPenColor(QPainter& p); @@ -4706,6 +4709,44 @@ void tst_QPainter::QTBUG17053_zeroDashPattern() QCOMPARE(image, original); } +class TextDrawerThread : public QThread +{ +public: + void run(); + QImage rendering; +}; + +void TextDrawerThread::run() +{ + rendering = QImage(100, 100, QImage::Format_ARGB32_Premultiplied); + rendering.fill(0); + QPainter p(&rendering); + p.fillRect(10, 10, 100, 100, Qt::blue); + p.setPen(Qt::green); + p.drawText(20, 20, "some text"); + p.end(); +} + +void tst_QPainter::drawTextOutsideGuiThread() +{ + if (!QFontDatabase::supportsThreadedFontRendering()) + QSKIP("No threaded font rendering", SkipAll); + + QImage referenceRendering(100, 100, QImage::Format_ARGB32_Premultiplied); + referenceRendering.fill(0); + QPainter p(&referenceRendering); + p.fillRect(10, 10, 100, 100, Qt::blue); + p.setPen(Qt::green); + p.drawText(20, 20, "some text"); + p.end(); + + TextDrawerThread t; + t.start(); + t.wait(); + + QCOMPARE(referenceRendering, t.rendering); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" -- cgit v0.12 From 27a24f1d009741b6e712300e7bc58b7e7e7d4c0b Mon Sep 17 00:00:00 2001 From: Honglei Zhang Date: Wed, 27 Apr 2011 09:19:57 +0300 Subject: Fix memory leak in XSD component of XmlPatterns There are couple of memory leaks in XmlPatterns when parsing XSD files. The reason is that the module over uses the shared data pointer and generates many cyclic reference loop. Some part of the code is refactored. Instead of using shared data pointer, normal C++ pointer is used to break the ownership loop. This is bug fix for QTBUG-8948. Task-number: QTBUG-8948 Reviewed-by: Sami Merila and Laszlo Agocs --- src/xmlpatterns/schema/qxsdattribute.cpp | 4 ++-- src/xmlpatterns/schema/qxsdattribute_p.h | 2 +- src/xmlpatterns/schema/qxsdcomplextype.cpp | 4 ++-- src/xmlpatterns/schema/qxsdcomplextype_p.h | 2 +- src/xmlpatterns/schema/qxsdelement.cpp | 8 ++++---- src/xmlpatterns/schema/qxsdelement_p.h | 8 ++++---- src/xmlpatterns/schema/qxsdparticlechecker.cpp | 6 +++--- src/xmlpatterns/schema/qxsdsimpletype.cpp | 4 ++-- src/xmlpatterns/schema/qxsdsimpletype_p.h | 2 +- src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp | 10 +++++----- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/xmlpatterns/schema/qxsdattribute.cpp b/src/xmlpatterns/schema/qxsdattribute.cpp index 68f9e3d..fb768d4 100644 --- a/src/xmlpatterns/schema/qxsdattribute.cpp +++ b/src/xmlpatterns/schema/qxsdattribute.cpp @@ -59,12 +59,12 @@ XsdAttribute::Scope::Variety XsdAttribute::Scope::variety() const void XsdAttribute::Scope::setParent(const NamedSchemaComponent::Ptr &parent) { - m_parent = parent; + m_parent = parent.data(); } NamedSchemaComponent::Ptr XsdAttribute::Scope::parent() const { - return m_parent; + return NamedSchemaComponent::Ptr(m_parent); } void XsdAttribute::ValueConstraint::setVariety(Variety variety) diff --git a/src/xmlpatterns/schema/qxsdattribute_p.h b/src/xmlpatterns/schema/qxsdattribute_p.h index d64d335..a21fe70 100644 --- a/src/xmlpatterns/schema/qxsdattribute_p.h +++ b/src/xmlpatterns/schema/qxsdattribute_p.h @@ -131,7 +131,7 @@ namespace QPatternist private: Variety m_variety; - NamedSchemaComponent::Ptr m_parent; + NamedSchemaComponent *m_parent; }; diff --git a/src/xmlpatterns/schema/qxsdcomplextype.cpp b/src/xmlpatterns/schema/qxsdcomplextype.cpp index 42aeb60..0932060 100644 --- a/src/xmlpatterns/schema/qxsdcomplextype.cpp +++ b/src/xmlpatterns/schema/qxsdcomplextype.cpp @@ -140,12 +140,12 @@ SchemaType::Ptr XsdComplexType::wxsSuperType() const void XsdComplexType::setContext(const NamedSchemaComponent::Ptr &component) { - m_context = component; + m_context = component.data(); } NamedSchemaComponent::Ptr XsdComplexType::context() const { - return m_context; + return NamedSchemaComponent::Ptr(m_context); } void XsdComplexType::setContentType(const ContentType::Ptr &type) diff --git a/src/xmlpatterns/schema/qxsdcomplextype_p.h b/src/xmlpatterns/schema/qxsdcomplextype_p.h index d28d2fc..d02583c 100644 --- a/src/xmlpatterns/schema/qxsdcomplextype_p.h +++ b/src/xmlpatterns/schema/qxsdcomplextype_p.h @@ -386,7 +386,7 @@ namespace QPatternist private: SchemaType::Ptr m_superType; - NamedSchemaComponent::Ptr m_context; + NamedSchemaComponent *m_context; DerivationMethod m_derivationMethod; bool m_isAbstract; XsdAttributeUse::List m_attributeUses; diff --git a/src/xmlpatterns/schema/qxsdelement.cpp b/src/xmlpatterns/schema/qxsdelement.cpp index 1ebec06..b0c5661 100644 --- a/src/xmlpatterns/schema/qxsdelement.cpp +++ b/src/xmlpatterns/schema/qxsdelement.cpp @@ -57,12 +57,12 @@ XsdElement::Scope::Variety XsdElement::Scope::variety() const void XsdElement::Scope::setParent(const NamedSchemaComponent::Ptr &parent) { - m_parent = parent; + m_parent = parent.data(); } NamedSchemaComponent::Ptr XsdElement::Scope::parent() const { - return m_parent; + return NamedSchemaComponent::Ptr(m_parent); } void XsdElement::ValueConstraint::setVariety(Variety variety) @@ -233,10 +233,10 @@ XsdElement::List XsdElement::substitutionGroupAffiliations() const void XsdElement::addSubstitutionGroup(const XsdElement::Ptr &element) { - m_substitutionGroups.insert(element); + m_substitutionGroups.insert(element.data()); } -XsdElement::List XsdElement::substitutionGroups() const +XsdElement::WeakList XsdElement::substitutionGroups() const { return m_substitutionGroups.toList(); } diff --git a/src/xmlpatterns/schema/qxsdelement_p.h b/src/xmlpatterns/schema/qxsdelement_p.h index 93c5983..3794c96 100644 --- a/src/xmlpatterns/schema/qxsdelement_p.h +++ b/src/xmlpatterns/schema/qxsdelement_p.h @@ -85,7 +85,7 @@ namespace QPatternist public: typedef QExplicitlySharedDataPointer Ptr; typedef QList List; - + typedef QList WeakList; /** * Describes the constraint type of the element. @@ -138,7 +138,7 @@ namespace QPatternist private: Variety m_variety; - NamedSchemaComponent::Ptr m_parent; + NamedSchemaComponent *m_parent; }; /** @@ -379,7 +379,7 @@ namespace QPatternist /** * Returns the substitution groups of the element. */ - XsdElement::List substitutionGroups() const; + XsdElement::WeakList substitutionGroups() const; private: SchemaType::Ptr m_type; @@ -392,7 +392,7 @@ namespace QPatternist SchemaType::DerivationConstraints m_substitutionGroupExclusions; XsdIdentityConstraint::List m_identityConstraints; XsdElement::List m_substitutionGroupAffiliations; - QSet m_substitutionGroups; + QSet m_substitutionGroups; }; } diff --git a/src/xmlpatterns/schema/qxsdparticlechecker.cpp b/src/xmlpatterns/schema/qxsdparticlechecker.cpp index 15c2afe..d4beae7 100644 --- a/src/xmlpatterns/schema/qxsdparticlechecker.cpp +++ b/src/xmlpatterns/schema/qxsdparticlechecker.cpp @@ -309,12 +309,12 @@ static bool hasDuplicatedElementsInternal(const XsdParticle::Ptr &particle, cons const XsdTerm::Ptr term = particle->term(); if (term->isElement()) { const XsdElement::Ptr mainElement(term); - XsdElement::List substGroups = mainElement->substitutionGroups(); + XsdElement::WeakList substGroups = mainElement->substitutionGroups(); if (substGroups.isEmpty()) - substGroups << mainElement; + substGroups << mainElement.data(); for (int i = 0; i < substGroups.count(); ++i) { - const XsdElement::Ptr element = substGroups.at(i); + const XsdElement::Ptr element(substGroups.at(i)); if (hash.contains(element->name(namePool))) { if (element->type()->name(namePool) != hash.value(element->name(namePool))->type()->name(namePool)) { conflictingElement = element; diff --git a/src/xmlpatterns/schema/qxsdsimpletype.cpp b/src/xmlpatterns/schema/qxsdsimpletype.cpp index 6fd5658..3e77aca 100644 --- a/src/xmlpatterns/schema/qxsdsimpletype.cpp +++ b/src/xmlpatterns/schema/qxsdsimpletype.cpp @@ -72,12 +72,12 @@ SchemaType::Ptr XsdSimpleType::wxsSuperType() const void XsdSimpleType::setContext(const NamedSchemaComponent::Ptr &component) { - m_context = component; + m_context = component.data(); } NamedSchemaComponent::Ptr XsdSimpleType::context() const { - return m_context; + return NamedSchemaComponent::Ptr(m_context); } void XsdSimpleType::setPrimitiveType(const AnySimpleType::Ptr &type) diff --git a/src/xmlpatterns/schema/qxsdsimpletype_p.h b/src/xmlpatterns/schema/qxsdsimpletype_p.h index 6305fc7..a5b72a7 100644 --- a/src/xmlpatterns/schema/qxsdsimpletype_p.h +++ b/src/xmlpatterns/schema/qxsdsimpletype_p.h @@ -202,7 +202,7 @@ namespace QPatternist private: SchemaType::Ptr m_superType; - NamedSchemaComponent::Ptr m_context; + NamedSchemaComponent* m_context; AnySimpleType::Ptr m_primitiveType; AnySimpleType::Ptr m_itemType; AnySimpleType::List m_memberTypes; diff --git a/src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp b/src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp index fed8a41..b6c8704 100644 --- a/src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp +++ b/src/xmlpatterns/schema/qxsdstatemachinebuilder.cpp @@ -166,14 +166,14 @@ XsdStateMachine::StateId XsdStateMachineBuilder::buildTerm(const X const XsdElement::Ptr element(term); if (m_mode == CheckingMode) { - const XsdElement::List substGroups = element->substitutionGroups(); + const XsdElement::WeakList substGroups = element->substitutionGroups(); for (int i = 0; i < substGroups.count(); ++i) - m_stateMachine->addTransition(b, substGroups.at(i), endState); + m_stateMachine->addTransition(b, XsdElement::Ptr(substGroups.at(i)), endState); } else if (m_mode == ValidatingMode) { - const XsdElement::List substGroups = element->substitutionGroups(); + const XsdElement::WeakList substGroups = element->substitutionGroups(); for (int i = 0; i < substGroups.count(); ++i) { - if (XsdSchemaHelper::substitutionGroupOkTransitive(element, substGroups.at(i), m_namePool)) - m_stateMachine->addTransition(b, substGroups.at(i), endState); + if (XsdSchemaHelper::substitutionGroupOkTransitive(element, XsdElement::Ptr(substGroups.at(i)), m_namePool)) + m_stateMachine->addTransition(b, XsdElement::Ptr(substGroups.at(i)), endState); } } -- cgit v0.12 From 02bb8e4c5f4584f3c0a7ed16bcba20c7f43456cd Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 27 Apr 2011 13:58:50 +0300 Subject: Fix BlendBench::unalignedBlendArgb32 test case The test case freed the wrong pointer, causing crash in Symbian devices. Task-number: QTBUG-17489 Reviewed-by: Janne Koskinen --- tests/benchmarks/gui/image/blendbench/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/benchmarks/gui/image/blendbench/main.cpp b/tests/benchmarks/gui/image/blendbench/main.cpp index a16fd5a..06c36e7 100644 --- a/tests/benchmarks/gui/image/blendbench/main.cpp +++ b/tests/benchmarks/gui/image/blendbench/main.cpp @@ -208,9 +208,9 @@ void BlendBench::unalignedBlendArgb32() uchar *srcMemory = static_cast(qMallocAligned((dimension * dimension * sizeof(quint32)) + 16, 16)); QFETCH(int, offset); - srcMemory += (offset * sizeof(quint32)); + uchar *imageSrcMemory = srcMemory + (offset * sizeof(quint32)); - QImage src(srcMemory, dimension, dimension, QImage::Format_ARGB32_Premultiplied); + QImage src(imageSrcMemory, dimension, dimension, QImage::Format_ARGB32_Premultiplied); src.fill(0x87654321); QPainter painter(&destination); -- cgit v0.12