File debug-systemd-boot.diff of Package plasma5-workspace

diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp
index dad8d96ee29c43fb993748f3b2df32fa633a7712..73cff5521d50e81e78f3db96f87223c5f28ff712 100644
--- a/startkde/startplasma.cpp
+++ b/startkde/startplasma.cpp
@@ -474,6 +474,7 @@ void resetSystemdFailedUnits()
 
 bool hasSystemdService(const QString &serviceName)
 {
+    qCDebug(PLASMA_STARTUP) << "hasSystemdService(" << serviceName << ") called";
     auto msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.systemd1"),
                                               QStringLiteral("/org/freedesktop/systemd1"),
                                               QStringLiteral("org.freedesktop.systemd1.Manager"),
@@ -481,26 +482,31 @@ bool hasSystemdService(const QString &serviceName)
     msg << QStringList({QStringLiteral("enabled"), QStringLiteral("static")}) << QStringList({serviceName});
     auto reply = QDBusConnection::sessionBus().call(msg);
     if (reply.type() == QDBusMessage::ErrorMessage) {
+        qCDebug(PLASMA_STARTUP) << "ListUnitFilesByPatterns DBus call failed with error";
         return false;
     }
     // if we have a service returned then it must have found it
+    qCDebug(PLASMA_STARTUP) << "ListUnitFilesByPatterns replied, reply.arguments().isEmpty():" << reply.arguments().isEmpty() << "reply.arguments().count():" << reply.arguments().count();
+    qCDebug(PLASMA_STARTUP) << "Argument 0:" << reply.arguments().first().toStringList();
     return !reply.arguments().isEmpty();
 }
 
 bool useSystemdBoot()
 {
+    qCDebug(PLASMA_STARTUP) << "useSystemdBoot() called";
     auto config = KSharedConfig::openConfig(QStringLiteral("startkderc"), KConfig::NoGlobals);
     const QString configValue = config->group(QStringLiteral("General")).readEntry("systemdBoot", QStringLiteral("false")).toLower();
 
     if (configValue == QLatin1String("false")) {
+        qCDebug(PLASMA_STARTUP) << "Systemd boot disabled in config file";
         return false;
     }
-
+    qCDebug(PLASMA_STARTUP) << "Systemd boot enabled in config file";
     if (!hasSystemdService(QStringLiteral("plasma-workspace@.target"))) {
         qWarning() << "Systemd boot requested, but plasma services were not found";
         return false;
     }
-
+    qCDebug(PLASMA_STARTUP) << "plasma-workspace@.target found";
     if (configValue == QLatin1String("force")) {
         qInfo() << "Systemd boot forced";
         return true;
@@ -509,7 +514,10 @@ bool useSystemdBoot()
     // xdg-desktop-autostart.target is shipped with an systemd 246 and provides a generator
     // for creating units out of existing autostart files
     // only enable our systemd boot if that exists, unless the user has forced the systemd boot above
-    return hasSystemdService(QStringLiteral("xdg-desktop-autostart.target"));
+    qCDebug(PLASMA_STARTUP) << "Checking xdg-desktop-autostart.target";
+    bool res=hasSystemdService(QStringLiteral("xdg-desktop-autostart.target"));
+    qCDebug(PLASMA_STARTUP) << "hasSystemdService returned" << res;
+    return res;
 }
 
 bool startPlasmaSession(bool wayland)
openSUSE Build Service is sponsored by