KUniqueApplication and dcopClient()->registerAs()

Waldo Bastian bastian at kde.org
Fri Apr 30 15:27:39 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri April 30 2004 15:51, Andras Mantia wrote:
> Hi,
>
>  I have a problem with KUniqueApplication when the application is
> registered with a different name, namely it will not detect that the
> application is already running. :-( 
<snip>
> Do you have any idea what can I do?

Check manually with DCOPClient::isApplicationRegistered:

if (!KUniqueApplication::start())
{
       fprintf(stderr, "quanta is already running!\n");
       exit(0);
}
if (KUniqueApplication::dcopClient()->isApplicationRegistered("quanta_be"))
{
       DCOPRef("quanta_be", "quanta_be").call("newInstance()"); // Activate it
       fprintf(stderr, "quanta_be is already running!\n");
       exit(0);
}

KUniqueApplication a;
a.exec();

Cheers,
Waldo
- -- 
bastian at kde.org  |   SUSE Linux 9.1 Order Now!   |  bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFAkmJbN4pvrENfboIRAilTAJwMoE9eeYBoOdHBYHjIlCdTstsTQQCfd4QS
HLn6b7wolnmp33bJQ0RW6dw=
=bbf5
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list