KDE/kdebase/workspace

Thiago Macieira thiago at kde.org
Tue Oct 24 23:51:10 BST 2006


SVN commit 598899 by thiago:

Use a slightly more intelligent way of detecting whether the D-Bus
daemon is running: instead of trying to kill -0 it, try to connect to
its address (using qdbus).

This has the added benefit that it works with the autolaunch method
that was introduced with D-Bus 0.94. If you're using 0.94, you no
longer need to run "eval `dbus-launch --auto-syntax`" before starting
your KDE4 applications (this is valid for individual applications, not
just startkde).

Note: this requires qdbus to be in your $PATH. But everyone has Qt
4.2's bindir there, right?

CCMAIL:kde-core-devel at kde.org


 M  +10 -10    startkde  


--- trunk/KDE/kdebase/workspace/startkde #598898:598899
@@ -271,17 +271,17 @@
 dl=$DESKTOP_LOCKED
 unset DESKTOP_LOCKED # Don't want it in the environment
 
-need_dbus=0
-if test -z "$DBUS_SESSION_BUS_PID"; then
-    need_dbus=1
-elif ! kill -0 $DBUS_SESSION_BUS_PID; then
-    need_dbus=1
+# Make sure that D-Bus is running
+if ! qdbus >/dev/null 2>/dev/null; then
+  # Remove the next two lines after D-Bus 1.0 is released.
+  # It comes with auto-starting, so running dbus-launch won't be necessary
+  eval `dbus-launch --auto-syntax --exit-with-session < /dev/null`
+  if ! qdbus >/dev/null 2>/dev/null; then
+    # Startup error
+    echo 'startkde: Could not start D-Bus. Check your installation.'  1>&2
+    xmessage -geometry 500x100 "Could not start D-Bus. Check your installation."
+  fi
 fi
-if test $need_dbus -eq 1; then
-  eval `dbus-launch --auto-syntax --exit-with-session`
-fi
-# Workaround for missing export in dbus-launch's output
-export DBUS_SESSION_BUS_PID
 
 if test -z "$dl"; then
   # the splashscreen and progress indicator




More information about the kde-core-devel mailing list