From 2b2b8c8a296105cdad7255dacacd9db7c8e19d6a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 17 Jun 2013 22:44:49 +0200 Subject: [PATCH] Fix the first half of qqmllocale auto tests Change-Id: I0f37208eaefcb668d3b61d294129134cfaa7c8f4 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmllocale.cpp | 5 +++-- src/qml/qml/v4/qv4dateobject.cpp | 5 +++++ src/qml/qml/v4/qv4dateobject_p.h | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index 1f4503b..32e717e 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -383,8 +383,7 @@ QV4::Value QQmlDateExtension::timeZoneUpdated(QV4::SimpleCallContext *ctx) if (ctx->argumentCount != 0) V4THROW_ERROR("Locale: Date.timeZoneUpdated(): Invalid arguments"); - // ### Anything we need to do here? - //v8::Date::DateTimeConfigurationChangeNotification(); + QV4::DatePrototype::timezoneUpdated(); return QV4::Value::undefinedValue(); } @@ -531,6 +530,7 @@ QV4::Value QQmlLocaleData::method_get_weekDays(QV4::SimpleCallContext *ctx) day = 0; result->arrayData[i].value = QV4::Value::fromInt32(day); } + result->arrayDataLen = days.size(); result->setArrayLengthUnchecked(days.size()); return QV4::Value::fromObject(result); @@ -544,6 +544,7 @@ QV4::Value QQmlLocaleData::method_get_uiLanguages(QV4::SimpleCallContext *ctx) result->arrayReserve(langs.size()); for (int i = 0; i < langs.size(); ++i) result->arrayData[i].value = QV4::Value::fromString(ctx, langs.at(i)); + result->arrayDataLen = langs.size(); result->setArrayLengthUnchecked(langs.size()); return QV4::Value::fromObject(result); diff --git a/src/qml/qml/v4/qv4dateobject.cpp b/src/qml/qml/v4/qv4dateobject.cpp index 8f2bd73..6e5112c 100644 --- a/src/qml/qml/v4/qv4dateobject.cpp +++ b/src/qml/qml/v4/qv4dateobject.cpp @@ -1308,3 +1308,8 @@ Value DatePrototype::method_toJSON(SimpleCallContext *ctx) return toIso->call(ctx, ctx->thisObject, 0, 0); } + +void DatePrototype::timezoneUpdated() +{ + LocalTZA = getLocalTZA(); +} diff --git a/src/qml/qml/v4/qv4dateobject_p.h b/src/qml/qml/v4/qv4dateobject_p.h index 629dfa5..dc94291 100644 --- a/src/qml/qml/v4/qv4dateobject_p.h +++ b/src/qml/qml/v4/qv4dateobject_p.h @@ -126,6 +126,8 @@ struct DatePrototype: DateObject static Value method_toUTCString(SimpleCallContext *ctx); static Value method_toISOString(SimpleCallContext *ctx); static Value method_toJSON(SimpleCallContext *ctx); + + static void timezoneUpdated(); }; } -- 2.7.4