From 3fdd93db97bab9ca15e65047d69774cfbfe22f27 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Fri, 9 Jul 2021 09:32:04 +0100 Subject: [PATCH] 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. --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index fba45f43c4..ff726401ee 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()) {