From 1f40fe507e6b6c74144cbb998cc91f88f9e33168 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 26 May 2010 15:11:34 +0200 Subject: Ensure that activation object has been created before popping scope of native context One shouldn't have to call activationObject() or scopeChain() before calling popScope(); the scope chain should always have 2 items (activation and global object) before we start popping anything from the internal chain. Task-number: QTBUG-11020 Reviewed-by: Olivier Goffart --- src/script/api/qscriptcontext.cpp | 1 + tests/auto/qscriptcontext/tst_qscriptcontext.cpp | 45 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp index 639af80..3f08e74 100644 --- a/src/script/api/qscriptcontext.cpp +++ b/src/script/api/qscriptcontext.cpp @@ -742,6 +742,7 @@ void QScriptContext::pushScope(const QScriptValue &object) */ QScriptValue QScriptContext::popScope() { + activationObject(); //ensure the creation of the normal scope for native context JSC::CallFrame *frame = QScriptEnginePrivate::frameForContext(this); JSC::ScopeChainNode *scope = frame->scopeChain(); Q_ASSERT(scope != 0); diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp index 100e195..617c183 100644 --- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp +++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp @@ -84,6 +84,7 @@ private slots: void jsActivationObject(); void qobjectAsActivationObject(); void parentContextCallee_QT2270(); + void popNativeContextScope(); }; tst_QScriptContext::tst_QScriptContext() @@ -539,6 +540,50 @@ void tst_QScriptContext::pushAndPopContext() } } +void tst_QScriptContext::popNativeContextScope() +{ + QScriptEngine eng; + QScriptContext *ctx = eng.pushContext(); + QVERIFY(ctx->popScope().isObject()); // the activation object + + QCOMPARE(ctx->scopeChain().size(), 1); + QVERIFY(ctx->scopeChain().at(0).strictlyEquals(eng.globalObject())); + // This was different in 4.5: scope and activation were decoupled + QVERIFY(ctx->activationObject().strictlyEquals(eng.globalObject())); + + QVERIFY(!eng.evaluate("var foo = 123; function bar() {}").isError()); + QVERIFY(eng.globalObject().property("foo").isNumber()); + QVERIFY(eng.globalObject().property("bar").isFunction()); + + QScriptValue customScope = eng.newObject(); + ctx->pushScope(customScope); + QCOMPARE(ctx->scopeChain().size(), 2); + QVERIFY(ctx->scopeChain().at(0).strictlyEquals(customScope)); + QVERIFY(ctx->scopeChain().at(1).strictlyEquals(eng.globalObject())); + QVERIFY(ctx->activationObject().strictlyEquals(eng.globalObject())); + ctx->setActivationObject(customScope); + QVERIFY(ctx->activationObject().strictlyEquals(customScope)); + QCOMPARE(ctx->scopeChain().size(), 2); + QVERIFY(ctx->scopeChain().at(0).strictlyEquals(customScope)); + QEXPECT_FAIL("", "QTBUG-11012", Continue); + QVERIFY(ctx->scopeChain().at(1).strictlyEquals(eng.globalObject())); + + QVERIFY(!eng.evaluate("baz = 456; var foo = 789; function barbar() {}").isError()); + QEXPECT_FAIL("", "QTBUG-11012", Continue); + QVERIFY(eng.globalObject().property("baz").isNumber()); + QVERIFY(customScope.property("foo").isNumber()); + QVERIFY(customScope.property("barbar").isFunction()); + + QVERIFY(ctx->popScope().strictlyEquals(customScope)); + QCOMPARE(ctx->scopeChain().size(), 1); + QEXPECT_FAIL("", "QTBUG-11012", Continue); + QVERIFY(ctx->scopeChain().at(0).strictlyEquals(eng.globalObject())); + + // Need to push another object, otherwise we crash in popContext() (QTBUG-11012) + ctx->pushScope(customScope); + eng.popContext(); +} + void tst_QScriptContext::lineNumber() { QScriptEngine eng; -- cgit v0.12 From fe824f6175ebbeb1940872275b31f9894d056ad0 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 26 May 2010 16:09:49 +0200 Subject: Added support for Indonesian language on Symbian. We have support for ELangIndonesian, but we also need to support new ELangIndonesian_Apac which has appeared in Symbian^3. Task-number: QT-3369 Reviewed-by: trustme --- src/corelib/tools/qlocale_symbian.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp index 1e674af..458bb2a 100644 --- a/src/corelib/tools/qlocale_symbian.cpp +++ b/src/corelib/tools/qlocale_symbian.cpp @@ -159,8 +159,9 @@ static const symbianToISO symbian_to_iso_list[] = { { ELangEnglish_Prc, "en_CN" }, // 159 ### Not supported by CLDR { ELangEnglish_Japan, "en_JP"}, // 160 ### Not supported by CLDR { ELangEnglish_Thailand, "en_TH" }, // 161 ### Not supported by CLDR - { ELangMalay_Apac, "ms" } // 326 + { ELangMalay_Apac, "ms" }, // 326 #endif + { 327/*ELangIndonesian_Apac*/,"id_ID" } // 327 - appeared in Symbian^3 }; /*! -- cgit v0.12 From bc5e4da28c1ffbc0da1cbfcaa1e6236ff4c2d4e3 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 27 May 2010 12:15:54 +0200 Subject: Fixed a crash when creating QGtkStyle before QApplication Task-number: QTBUG-10758 Reviewed-by: ogoffart --- src/gui/styles/qgtkstyle.cpp | 2 ++ src/gui/styles/qgtkstyle_p.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 6c8d561..9d6dc9a 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -325,6 +325,7 @@ void QGtkStyle::polish(QApplication *app) qt_filedialog_save_filename_hook = &QGtkStylePrivate::saveFilename; qt_filedialog_open_filenames_hook = &QGtkStylePrivate::openFilenames; qt_filedialog_existing_directory_hook = &QGtkStylePrivate::openDirectory; + qApp->installEventFilter(&d->filter); } } } @@ -345,6 +346,7 @@ void QGtkStyle::unpolish(QApplication *app) qt_filedialog_save_filename_hook = 0; qt_filedialog_open_filenames_hook = 0; qt_filedialog_existing_directory_hook = 0; + qApp->removeEventFilter(&d->filter); } } diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp index 3c6a1ef..4ed0fab 100644 --- a/src/gui/styles/qgtkstyle_p.cpp +++ b/src/gui/styles/qgtkstyle_p.cpp @@ -285,8 +285,6 @@ void QGtkStylePrivate::init() { resolveGtk(); initGtkWidgets(); - if (isThemeAvailable()) - qApp->installEventFilter(&filter); } GtkWidget* QGtkStylePrivate::gtkWidget(const QHashableLatin1Literal &path) -- cgit v0.12 From 975dbe047590253e9d4433030d76ab26969f621f Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 27 May 2010 13:37:58 +0200 Subject: Update documentation for the -font command line option This option is ignored when Qt is built with fontconfig support, make sure it is documented. Task-number: QTBUG-3671 --- src/gui/kernel/qapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 57c4c99..0d11b27 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -666,7 +666,8 @@ void QApplicationPrivate::process_cmdline() \o -geometry \e geometry, sets the client geometry of the first window that is shown. \o -fn or \c -font \e font, defines the application font. The font - should be specified using an X logical font description. + should be specified using an X logical font description. Note that + this option is ignored when Qt is built with fontconfig support enabled. \o -bg or \c -background \e color, sets the default background color and an application palette (light and dark shades are calculated). \o -fg or \c -foreground \e color, sets the default foreground color. -- cgit v0.12 From 773cfe5b87e8f92aba1e5648dc57f559c6e43741 Mon Sep 17 00:00:00 2001 From: kh1 Date: Thu, 27 May 2010 14:41:12 +0200 Subject: Remove superfluous forward declaration. Task-number: QTBUG-11049 Reviewed-by: ck --- tools/assistant/lib/qhelpsearchindexreader_default_p.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/assistant/lib/qhelpsearchindexreader_default_p.h b/tools/assistant/lib/qhelpsearchindexreader_default_p.h index b30fa4b..27764db 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_default_p.h +++ b/tools/assistant/lib/qhelpsearchindexreader_default_p.h @@ -61,9 +61,6 @@ QT_BEGIN_NAMESPACE -struct Entry; -struct PosEntry; - namespace fulltextsearch { namespace std { -- cgit v0.12