Fix the Qt build.
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Mar 2008 12:17:15 +0000 (12:17 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Mar 2008 12:17:15 +0000 (12:17 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@31027 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bridge/qt/qt_instance.cpp
WebCore/bridge/qt/qt_instance.h
WebCore/bridge/qt/qt_runtime.cpp
WebCore/page/qt/FrameQt.cpp
WebKit/qt/Api/qwebframe.cpp
WebKit/qt/ChangeLog

index a8b8999..5adf4cf 100644 (file)
@@ -1,3 +1,18 @@
+2008-03-13  Simon Hausmann  <hausmann@webkit.org>
+
+        Fix the Qt build.
+
+        * bridge/qt/qt_instance.cpp:
+        (KJS::Bindings::QtInstance::getQtInstance):
+        (KJS::Bindings::QtInstance::getRuntimeObject):
+        * bridge/qt/qt_instance.h:
+        (KJS::Bindings::QtInstance::create):
+        * bridge/qt/qt_runtime.cpp:
+        (KJS::Bindings::convertQVariantToValue):
+        (KJS::Bindings::QtConnectionObject::execute):
+        * page/qt/FrameQt.cpp:
+        (WebCore::Frame::createScriptInstanceForWidget):
+
 2008-03-12  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Darin Adler.
index 853b1ac..6c5eb22 100644 (file)
@@ -132,7 +132,7 @@ PassRefPtr<QtInstance> QtInstance::getQtInstance(QObject* o, PassRefPtr<RootObje
 
     foreach(QtInstance* instance, cachedInstances.values(o)) {
         if (instance->rootObject() == rootObject)
-            return instance.get();
+            return instance;
     }
 
     RefPtr<QtInstance> ret = adoptRef(new QtInstance(o, rootObject));
@@ -147,7 +147,7 @@ JSObject* QtInstance::getRuntimeObject(PassRefPtr<QtInstance> instance)
     JSObject* ret = cachedObjects.value(instance.get());
     if (!ret) {
         ret = new QtRuntimeObjectImp(instance);
-        cachedObjects.insert(ret->getInternalInstance(), ret);
+        cachedObjects.insert(instance.get(), ret);
     }
     return ret;
 }
index f2ba426..8828cc8 100644 (file)
@@ -38,6 +38,11 @@ class QtRuntimeMetaMethod;
 class QtInstance : public Instance
 {
 public:
+    static PassRefPtr<QtInstance> create(QObject *instance, PassRefPtr<RootObject> rootObject) 
+    {
+        return adoptRef(new QtInstance(instance, rootObject));
+    }
+
     ~QtInstance ();
 
     virtual Class* getClass() const;
index f1513c8..eb5e184 100644 (file)
@@ -681,7 +681,7 @@ JSValue* convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, co
 
     if (type == QMetaType::QObjectStar || type == QMetaType::QWidgetStar) {
         QObject* obj = variant.value<QObject*>();
-        return Instance::createRuntimeObject(Instance::QtLanguage, obj, root);
+        return Instance::createRuntimeObject(QtInstance::create(obj, root));
     }
 
     if (type == QMetaType::QVariantMap) {
@@ -1514,7 +1514,7 @@ void QtConnectionObject::execute(void **argv)
                     if (m_funcObject->inherits(&FunctionImp::info)) {
                         FunctionImp* fimp = static_cast<FunctionImp*>(m_funcObject.get());
 
-                        JSObject* qt_sender = Instance::createRuntimeObject(Instance::QtLanguage, sender(), ro);
+                        JSObject* qt_sender = Instance::createRuntimeObject(QtInstance::create(sender(), ro));
                         JSObject* wrapper = new JSObject();
                         wrapper->put(exec, "__qt_sender__", qt_sender);
                         ScopeChain oldsc = fimp->scope();
index 28dad5f..d6140c3 100644 (file)
@@ -62,6 +62,7 @@
 #include "kjs_proxy.h"
 #include "TypingCommand.h"
 #include "JSLock.h"
+#include "qt_instance.h"
 #include "runtime_root.h"
 #include "runtime.h"
 #include "JSDOMWindow.h"
@@ -101,9 +102,7 @@ PassRefPtr<KJS::Bindings::Instance> Frame::createScriptInstanceForWidget(WebCore
     QWidget* nativeWidget = widget->nativeWidget();
     if (!nativeWidget)
         return 0;
-    return KJS::Bindings::Instance::createBindingForLanguageInstance(KJS::Bindings::Instance::QtLanguage,
-                                                                     nativeWidget,
-                                                                     bindingRootObject());
+    return KJS::Bindings::QtInstance::create(nativeWidget, bindingRootObject());
 }
 
 void Frame::clearPlatformScriptObjects()
index 240e727..5055246 100644 (file)
@@ -55,6 +55,7 @@
 #include "runtime.h"
 #include "runtime_root.h"
 #include "JSDOMWindow.h"
+#include "qt_instance.h"
 #include "kjs_proxy.h"
 #include "kjs_binding.h"
 #include "ExecState.h"
@@ -175,8 +176,7 @@ void QWebFrame::addToJSWindowObject(const QString &name, QObject *object)
       }
 
       KJS::JSObject *runtimeObject =
-        KJS::Bindings::Instance::createRuntimeObject(KJS::Bindings::Instance::QtLanguage,
-                                                     object, root);
+        KJS::Bindings::Instance::createRuntimeObject(KJS::Bindings::QtInstance::create(object, root));
 
       window->put(window->globalExec(), KJS::Identifier((const UChar *) name.constData(), name.length()), runtimeObject);
 }
index a002b15..65c9689 100644 (file)
@@ -1,3 +1,10 @@
+2008-03-13  Simon Hausmann  <hausmann@webkit.org>
+
+        Fix the Qt build.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::addToJSWindowObject):
+
 2008-03-12  Simon Hausmann  <hausmann@webkit.org>
 
         Fix compilation against Qt 4.3