diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-05-08 12:33:22 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-08 15:14:48 +0200 |
commit | f44e3f05650ce540aa2a0392ed547a900839befa (patch) | |
tree | 4783910ceae3fd284eaaf43deb0b64ce09995516 /src/qml/qml/qqmllocale.cpp | |
parent | ba1a2a62c1a761d88912b79804bdf437c9a26aa7 (diff) |
Convert qqmllocale to use QV4::PersistentValue
Change-Id: I9fd82f6f1d76d6ff8cbf0e7626fb32233c563ece
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmllocale.cpp')
-rw-r--r-- | src/qml/qml/qqmllocale.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp index b54df90dd1..770a0017f1 100644 --- a/src/qml/qml/qqmllocale.cpp +++ b/src/qml/qml/qqmllocale.cpp @@ -624,7 +624,7 @@ public: QV8LocaleDataDeletable(QV8Engine *engine); ~QV8LocaleDataDeletable(); - v8::Persistent<v8::Function> constructor; + QV4::PersistentValue constructor; }; QV8LocaleDataDeletable::QV8LocaleDataDeletable(QV8Engine *engine) @@ -662,12 +662,11 @@ QV8LocaleDataDeletable::QV8LocaleDataDeletable(QV8Engine *engine) ft->PrototypeTemplate()->SetAccessor(v8::String::New("textDirection"), locale_get_textDirection); ft->PrototypeTemplate()->SetAccessor(v8::String::New("uiLanguages"), locale_get_uiLanguages); - constructor = qPersistentNew(ft->GetFunction()); + constructor = ft->GetFunction()->v4Value(); } QV8LocaleDataDeletable::~QV8LocaleDataDeletable() { - qPersistentDispose(constructor); } V8_DEFINE_EXTENSION(QV8LocaleDataDeletable, localeV8Data); @@ -777,7 +776,7 @@ QQmlLocale::~QQmlLocale() QV4::Value QQmlLocale::locale(QV8Engine *v8engine, const QString &locale) { QV8LocaleDataDeletable *d = localeV8Data(v8engine); - v8::Handle<v8::Object> v8Value = d->constructor->NewInstance(); + v8::Handle<v8::Object> v8Value = d->constructor.value().asFunctionObject()->newInstance(); QV8LocaleDataResource *r = new QV8LocaleDataResource(v8engine); if (locale.isEmpty()) r->locale = QLocale(); |