From: Alex Richardson Date: Fri, 9 Jul 2021 08:32:04 +0000 (+0100) Subject: Don't exit immediately if DBus isn't running X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/3fdd93db97bab9ca15e65047d69774cfbfe22f27?ds=sidebyside Don't exit immediately if DBus isn't running I am trying to run Dolphin on a minimal FreeBSD CHERI-RISC-V QEMU instance and I haven't got DBus running. Without this change, KDBusService causes dolphin to exit immediately since the default behaviour is to exit if it can't connect to DBus. --- diff --git a/src/main.cpp b/src/main.cpp index fba45f43c..ff726401e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -178,7 +178,12 @@ int main(int argc, char **argv) mainWindow->show(); - KDBusService dolphinDBusService; + // Allow starting Dolphin on a system that is not running DBus: + KDBusService::StartupOptions serviceOptions = KDBusService::Multiple; + if (!QDBusConnection::sessionBus().isConnected()) { + serviceOptions |= KDBusService::NoExitOnFailure; + } + KDBusService dolphinDBusService(serviceOptions); DBusInterface interface; if (!app.isSessionRestored()) {