Discussion:
How to use Client.send(...)/call(...) / Code samples?
Kai Denker
2007-09-09 20:30:39 UTC
Permalink
Hi!

I want to use org.kde.DCOP.call(...) respectively .send(...) to call the
function "openComposer()" on kmail. I wonder how to pass arguments to the
function I want to call.

c.send("kmail", "KMailIface", "openComposer()", ...);

I guess, I have to insert them at the dots, but I don't know how to this,
since the signatures of send and call expect an array of bytes or a single
string.

I've searched for code samples, but didn't find any.

Regards,
Kai Denker
--
Kai Denker - Landgraf-Georg-Str. 9 - 64283 Darmstadt
Tel.: 06151/3967959 - Mobil: 0179/2936396
***@gmx.net - http://www.the-distraught-queen.de/
Kevin Krammer
2007-09-09 20:56:14 UTC
Permalink
Post by Kai Denker
Hi!
I want to use org.kde.DCOP.call(...) respectively .send(...) to call the
function "openComposer()" on kmail. I wonder how to pass arguments to the
function I want to call.
c.send("kmail", "KMailIface", "openComposer()", ...);
I guess, I have to insert them at the dots, but I don't know how to this,
since the signatures of send and call expect an array of bytes or a single
string.
In C++ it works like this:

- create a byte array
- create a QDataStream on this array
- write your arguments into it
- use the serialized data as the function's argument.

Btw, the method signature needs to include the parameter types(not their names
though).
No sure if you need to write "QString" or "String" in such a signature.

Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
Loading...