KUniqueApplication on windows

Shane King kde at dontletsstart.com
Thu Nov 29 12:06:09 CET 2007


Currently KUniqueApplication registers itself with dcop but never 
unregisters. This has the unfortunate effect of blocking the application 
from running more than once.

For amarok I've added into the app destructor:

+#ifdef Q_WS_WIN
+    // work around for KUniqueApplication being not completely 
implemented on windows
+    QDBusConnectionInterface* dbusService;
+    if (QDBusConnection::sessionBus().isConnected() && (dbusService = 
QDBusConnection::sessionBus().interface()))
+        dbusService->unregisterService("org.kde.amarok");
+#endif

Is a solution along these lines, suitably generic (ie use the name 
calculated in start() rather than hard coded) something that should go 
in ~KUniqueApplication? Or is there a better way to fix this?



More information about the Kde-windows mailing list