diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-12-20 11:02:10 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-20 06:37:53 +0100 |
commit | f0c82e77aa2811c326c543468fc422c18ca98a47 (patch) | |
tree | d8fb0d1338fe7d4c741c506cd6c3f42314d9896a /src/declarative | |
parent | 2ac33932be979452e1d4fa3ec4e6b6a301e5f6e4 (diff) |
Qt.locale() always returns the 'C' locale.
QLocale(QString()) does not return the default locale. If no
locale is specified, use the QLocale() constructor.
Change-Id: I76198b7ea66a6326483ec47ac36e080159ca459a
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativelocale.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativelocale.cpp b/src/declarative/qml/qdeclarativelocale.cpp index ae57edb941..9f2116f8fd 100644 --- a/src/declarative/qml/qdeclarativelocale.cpp +++ b/src/declarative/qml/qdeclarativelocale.cpp @@ -811,7 +811,10 @@ v8::Handle<v8::Value> QDeclarativeLocale::locale(QV8Engine *v8engine, const QStr QV8LocaleDataDeletable *d = localeV8Data(v8engine); v8::Local<v8::Object> v8Value = d->constructor->NewInstance(); QV8LocaleDataResource *r = new QV8LocaleDataResource(v8engine); - r->locale = QLocale(locale); + if (locale.isEmpty()) + r->locale = QLocale(); + else + r->locale = QLocale(locale); v8Value->SetExternalResource(r); return v8Value; |