DCOPRef and dynamic stubs ( 3.1? )

Matthias Ettrich ettrich at trolltech.com
Mon Sep 9 09:22:52 BST 2002

On Monday 09 September 2002 09:46, Simon Hausmann wrote:
> On Sun, Sep 08, 2002 at 04:50:57PM +0200, Matthias Ettrich wrote:
> > I was playing with the idea to extend DCOPRef to allow using if for calls
> > and sends.
> Nice! One thing that impressed me very much in Qtopia was
> QCopEnvelope, inherited from QDataStream, for sending one-way messages:
> DCOPEnvelope( "kdesktop", "default", "void setFoo( int, QString )" )
>               << blah << blubb;
> I think it would be cool to have such a class in kdelibs, too. But I
> don't know if that's possible with regard to licensing...

Of course it was possible.  I looked at the DCOPEnvelope (which inherits 
QDataStream), but I don't think it's good enough. The pattern does not 
support return values and it doesn't do type checking at all. With DCOPRef, 
your send call would look like

   DCOPRef( "desktop" ).send( "setFoo", blah, blubb );

Doesn't that look even better? "setFoo" is automatically extended to 
"setFoo(int, QString)" depending on the types of the arguments 'blah' and 

> Another thought: How about changing the DCOPRef constructor to
> DCOPRef( const QCString &app, const QCString &obj = "default" ); ?

Good point, already used in the example above :)


More information about the kde-core-devel mailing list