Remove QJSEngine::ContextOwnership and associated constructor
authorKent Hansen <kent.hansen@nokia.com>
Tue, 22 May 2012 13:30:11 +0000 (15:30 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 24 May 2012 07:41:29 +0000 (09:41 +0200)
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 <jedrzej.nowacki@nokia.com>
src/qml/qml/v8/qjsengine.cpp
src/qml/qml/v8/qjsengine.h
src/qml/qml/v8/qv8engine.cpp
src/qml/qml/v8/qv8engine_p.h

index af47877..167f87d 100644 (file)
@@ -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.
 
index bf1e215..c7afb88 100644 (file)
@@ -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();
index c075fc9..4e53964 100644 (file)
@@ -120,10 +120,10 @@ static bool ObjectComparisonCallback(v8::Local<v8::Object> lhs, v8::Local<v8::Ob
 }
 
 
-QV8Engine::QV8Engine(QJSEngine* qq, QJSEngine::ContextOwnership ownership)
+QV8Engine::QV8Engine(QJSEngine* qq, ContextOwnership ownership)
     : q(qq)
     , m_engine(0)
-    , m_ownsV8Context(ownership == QJSEngine::CreateNewContext)
+    , m_ownsV8Context(ownership == CreateNewContext)
     , m_xmlHttpRequestData(0)
     , m_listModelData(0)
     , m_application(0)
@@ -141,7 +141,7 @@ QV8Engine::QV8Engine(QJSEngine* qq, QJSEngine::ContextOwnership ownership)
     ensurePerThreadIsolate();
 
     v8::HandleScope handle_scope;
-    m_context = (ownership == QJSEngine::CreateNewContext) ? v8::Context::New() : v8::Persistent<v8::Context>::New(v8::Context::GetCurrent());
+    m_context = (ownership == CreateNewContext) ? v8::Context::New() : v8::Persistent<v8::Context>::New(v8::Context::GetCurrent());
     qPersistentRegister(m_context);
     m_originalGlobalObject.init(m_context);
     v8::Context::Scope context_scope(m_context);
index 772fa82..0cd54ae 100644 (file)
@@ -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