Registered Member
|
Hi,
I am trying to warn the user when he tries to start a unique application under Windows a second time. I use the following code: if (!KUniqueApplication::start()) { fprintf(stderr, "App is already running!"); exit(0); } // create the app KUniqueApplication app; The problem is that start() exits with code 255 because the dbusService can not be registered. I can register the dbus when no other instance of my application is running. So obviously the first instance causes the ::exit(255) which gives me no chance to warn the user. Any idea how to solve this issue? Thanks! |
Administrator
|
I think kdelibs already provides an error message. In any case, there isn't much you can do in this case. What you could do is implement the newInstance() part of KUniqueApplication in your application and use it to send your main window to the top.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thanks! Will check this...
|
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, mickae, Sogou [Bot]