[Kde-bindings] Receiving exit status of an application started with DCOP

Germán Rodríguez Herrera grodrigu at ac.upc.es
Wed Jun 23 07:23:23 UTC 2004


        [NOTE: I had already sent a similiar message to kde-devel]

        I've been trying to do some fancy stuff with .procmailrc and
dcop. I wanted to take an action depending on the exit status of a
dialog presented with Kdialog. I produced the following call:

dcop --user grodrigu klauncher klauncher kdeinit_exec_wait /usr/bin/kdialog [ --title "Mail Alert" --yesno "$MESSAGETEXT\nLaunch Mail Reader?" ] [  ]

        I read the source code, and I found out the dcop will return
0 if the application succeeds, disregarding the actual return code of
the launched application (NOTE I use "_wait").

        I think that I should "serviceresult", but how from a shell
script?

        The fact that I'm able to use dcop doesn't necessarily mean that
I can run kdialog directly. I understand that when the client's dcop
launches kdialog, that dcop knows the DISPLAY and has the authorization
to use it. The .procmailrc commands could be executed by a different
user (mail/root) and even if it weren't so, it could not have the
DISPLAY or AUTHORIZATION variables set in its environment.

        The good thing about dcop would be, that if the program failed,
that is, it didn't run at all (that's the current exit status of dcop),
then I know that it is not possible to use the graphical display, and
act consequently. But if the application did run (kdialog) I would like
to get its result code in some way, maybe an option in dcop such as:
--return_value and the name of a file or something that would store it
there (I'm sure there will be much better ideas)

        Thanks a lot,

                                Germán




More information about the Kde-bindings mailing list