[Kde-bindings] Path kjsembed UrlUrlArgs signature

Koos Vriezen koos.vriezen at xs4all.nl
Mon Jun 21 11:30:01 UTC 2004


Hi,

Small patch to at least make it possible to build a browser
with kjsembed.
Is such a patch correct or to specific for this case? Also,
because URLArgs argument is ignored now, should there be a
special binding for it or could a in place js object (like
{docState:[],reload:false,xOffset:0,..} conversion be sufficient
here?

Koos
-------------- next part --------------
Index: jsobjectproxy_imp.cpp
===================================================================
RCS file: /home/kde/kdebindings/kjsembed/jsobjectproxy_imp.cpp,v
retrieving revision 1.60
diff -u -3 -p -r1.60 jsobjectproxy_imp.cpp
--- jsobjectproxy_imp.cpp	12 Jun 2004 00:52:11 -0000	1.60
+++ jsobjectproxy_imp.cpp	21 Jun 2004 10:31:44 -0000
@@ -432,6 +432,9 @@ KJS::Boolean JSObjectProxyImp::connect( 
 	case JSSlotUtils::SignatureURL:
 	    ok = JSSlotUtils::connect( sender, sig, slotp, "slot_url(const KURL&)" );
 	    break;
+	case JSSlotUtils::SignatureURLURLArgs:
+	    ok = JSSlotUtils::connect( sender, sig, slotp, "slot_urlurlargs(const KURL&,const KParts::URLArgs&)" );
+	    break;
 	case JSSlotUtils::SignatureIntInt:
 	    ok = JSSlotUtils::connect( sender, sig, slotp, "slot_intint(int, int)" );
 	    break;
Index: slotproxy.cpp
===================================================================
RCS file: /home/kde/kdebindings/kjsembed/slotproxy.cpp,v
retrieving revision 1.16
diff -u -3 -p -r1.16 slotproxy.cpp
--- slotproxy.cpp	12 Jun 2004 00:52:11 -0000	1.16
+++ slotproxy.cpp	21 Jun 2004 10:31:44 -0000
@@ -164,6 +164,17 @@ void KJSEmbed::JSSlotProxy::slot_url( co
     execute( args );
 } 
 
+void KJSEmbed::JSSlotProxy::slot_urlurlargs( const KURL & url, const KParts::URLArgs & )
+{
+    KJS::List args;
+#ifndef QT_ONLY
+    args.append( convertToValue(js->globalExec(), url.prettyURL() ));
+#else // QT_ONLY
+    args.append( convertToValue(js->globalExec(), url.toString() ));
+#endif // QT_ONLY
+    execute( args );
+} 
+
 void KJSEmbed::JSSlotProxy::slot_intint( int arg, int arg1)
 {
     KJS::List args;
Index: slotproxy.h
===================================================================
RCS file: /home/kde/kdebindings/kjsembed/slotproxy.h,v
retrieving revision 1.13
diff -u -3 -p -r1.13 slotproxy.h
--- slotproxy.h	12 Jun 2004 00:52:11 -0000	1.13
+++ slotproxy.h	21 Jun 2004 10:31:44 -0000
@@ -39,6 +39,10 @@ namespace KJS {
 class Interpreter;
 }
 
+namespace KParts {
+class URLArgs;
+}
+
 namespace KJSEmbed {
 
 class JSObjectProxy;
@@ -79,6 +83,7 @@ public slots:
     void slot_size( const QSize &size );
     void slot_pixmap( const QPixmap &pix );
     void slot_url( const KURL &url );
+    void slot_urlurlargs( const KURL &url, const KParts::URLArgs &args );
     void slot_intint( int , int );
     void slot_intbool( int , bool );
     void slot_intintint( int , int , int );
Index: slotutils.cpp
===================================================================
RCS file: /home/kde/kdebindings/kjsembed/slotutils.cpp,v
retrieving revision 1.51
diff -u -3 -p -r1.51 slotutils.cpp
--- slotutils.cpp	12 Jun 2004 00:52:11 -0000	1.51
+++ slotutils.cpp	21 Jun 2004 10:31:44 -0000
@@ -438,6 +438,8 @@ int JSSlotUtils::findSignature( const QS
 	return SignatureCString;
     else if ( sig.contains("(const KURL&)") )
 	return SignatureURL;
+    else if ( sig.contains("(const KURL&,const KParts::URLArgs&)") )
+	return SignatureURLURLArgs;
     else if ( sig.contains("(const QColor&)") )
 	return SignatureColor;
     else if ( sig.contains("(const QPoint&)") )
Index: slotutils.h
===================================================================
RCS file: /home/kde/kdebindings/kjsembed/slotutils.h,v
retrieving revision 1.28
diff -u -3 -p -r1.28 slotutils.h
--- slotutils.h	12 Jun 2004 00:52:11 -0000	1.28
+++ slotutils.h	21 Jun 2004 10:31:44 -0000
@@ -64,7 +64,7 @@ public:
 	SignatureIntInt, SignatureStringInt, SignatureRectBool,
 	SignatureStringString, SignatureDateDate, SignatureColorString,
 	SignatureStringBool, SignatureIntColor, SignatureIntBool,
-	SignatureURLURL, SignatureURLString, SignatureStringURL,
+	SignatureURLURL, SignatureURLString, SignatureStringURL, SignatureURLURLArgs,
 
 	SignatureStringStringString, SignatureStringBoolBool, SignatureStringIntInt,
 	SignatureIntColorBool, SignatureIntIntBool, SignatureIntIntString,


More information about the Kde-bindings mailing list