From: Kent Hansen Date: Tue, 22 May 2012 13:30:11 +0000 (+0200) Subject: Remove QJSEngine::ContextOwnership and associated constructor X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=2a5d05dd3c9d42794d6863425598b8a838ebfb63;p=konrad%2Fqtdeclarative.git Remove QJSEngine::ContextOwnership and associated constructor This API was intended for QtWebKit integration, but we decided to keep it out of the public headers and introduce it in a different way later. Change-Id: I7f30b20b741eca8569e63a7e4e27171d75293567 Reviewed-by: Jędrzej Nowacki --- diff --git a/src/qml/qml/v8/qjsengine.cpp b/src/qml/qml/v8/qjsengine.cpp index af47877..167f87d 100644 --- a/src/qml/qml/v8/qjsengine.cpp +++ b/src/qml/qml/v8/qjsengine.cpp @@ -152,18 +152,6 @@ QJSEngine::QJSEngine() { } -#ifdef QT_DEPRECATED - -/*! - \internal -*/ -QJSEngine::QJSEngine(QJSEngine::ContextOwnership ownership) - : d(new QV8Engine(this, ownership)) -{ -} - -#endif // QT_DEPRECATED - /*! Constructs a QJSEngine object with the given \a parent. diff --git a/src/qml/qml/v8/qjsengine.h b/src/qml/qml/v8/qjsengine.h index bf1e215..c7afb88 100644 --- a/src/qml/qml/v8/qjsengine.h +++ b/src/qml/qml/v8/qjsengine.h @@ -65,14 +65,6 @@ class Q_QML_EXPORT QJSEngine { Q_OBJECT public: -#ifdef QT_DEPRECATED - enum ContextOwnership { - AdoptCurrentContext, - CreateNewContext - }; - QT_DEPRECATED explicit QJSEngine(ContextOwnership ownership); -#endif - QJSEngine(); explicit QJSEngine(QObject *parent); virtual ~QJSEngine(); diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index c075fc9..4e53964 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -120,10 +120,10 @@ static bool ObjectComparisonCallback(v8::Local lhs, v8::Local::New(v8::Context::GetCurrent()); + m_context = (ownership == CreateNewContext) ? v8::Context::New() : v8::Persistent::New(v8::Context::GetCurrent()); qPersistentRegister(m_context); m_originalGlobalObject.init(m_context); v8::Context::Scope context_scope(m_context); diff --git a/src/qml/qml/v8/qv8engine_p.h b/src/qml/qml/v8/qv8engine_p.h index 772fa82..0cd54ae 100644 --- a/src/qml/qml/v8/qv8engine_p.h +++ b/src/qml/qml/v8/qv8engine_p.h @@ -231,7 +231,11 @@ public: static QV8Engine* get(QJSEngine* q) { Q_ASSERT(q); return q->handle(); } static QJSEngine* get(QV8Engine* d) { Q_ASSERT(d); return d->q; } - QV8Engine(QJSEngine* qq,QJSEngine::ContextOwnership ownership = QJSEngine::CreateNewContext); + enum ContextOwnership { + AdoptCurrentContext, + CreateNewContext + }; + QV8Engine(QJSEngine* qq, ContextOwnership ownership = CreateNewContext); virtual ~QV8Engine(); // This enum should be in sync with QQmlEngine::ObjectOwnership