From 95fc98f1175a8ac97c966ecee9ee4c03e21e327e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Thu, 8 Feb 2024 20:28:04 +0100 Subject: [PATCH] Update powerkit.cpp Only allow one instance of config --- src/powerkit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/powerkit.cpp b/src/powerkit.cpp index cdfec17..264703f 100644 --- a/src/powerkit.cpp +++ b/src/powerkit.cpp @@ -25,6 +25,10 @@ int main(int argc, char *argv[]) QStringList args = QApplication::arguments(); if (args.contains("--config")) { + if (!QDBusConnection::sessionBus().registerService(POWERKIT_CONFIG)) { + qWarning() << QObject::tr("A powerkit config instance is already running"); + return 1; + } PowerKit::Dialog dialog; dialog.show(); return a.exec();