El Dimarts, 18 de juny de 2013, a les 09:55:23, David Faure va escriure:
> Le lundi 17 juin 2013 20:15:23 Albert Astals Cid a écrit :
> > Maybe we should just make sure the qdbus calls in startkde have the full
> > qualified path and that's it?
> 
> Ah! This is for the calls to qdbus from within startkde itself! Well
> spotted.
> 
> You're thinking of using something like @QDBUS_EXECUTABLE@ in startkde.cmake
> and substituting that with the path to qdbus at install time? I guess that
> would work, if someone switches to another version of Qt in another prefix,
> he has to recompile everything anyway.
> 
> But looking at startkde, the code in question runs after ksmserver exits,
> and waits for drkonqi instances to exit, using `qdbus` and `kreadconfig`.
> How about turning this shell code into C++ code, and making it part of
> ksmserver? After all we have C++/Qt/kdelibs APIs to write such stuff,
> without the need to write shell scripting with rudimentary tools :)
> 
> There's also a check that the dbus session is available, but surely we'll
> error out soon enough if this isn't the case?

Sure we could do all that, but given the black magic that is involved in 
startkde (or so I've been told), i'd prefer to go for a simpler solution like 
the attached patch.

If anyone is running without qdbus on the path can you give this a try?

Cheers,
  Albert
--- startkde.orig	2013-06-18 18:34:35.265728739 +0200
+++ startkde	2013-06-18 18:43:20.299344823 +0200
@@ -20,16 +20,9 @@
 bindir=`echo "$0" | sed -n 's,^\(/.*\)/[^/][^/]*$,\1,p'`
 if [ -n "$bindir" ]; then
   qbindir=`$bindir/kde4-config --qt-binaries`
-  if [ -n "$qbindir" ]; then
-    case $PATH in
-      $qbindir|$qbindir:*|*:$qbindir|*:$qbindir:*) ;;
-      *) PATH=$qbindir:$PATH; export PATH;;
-    esac
-  fi
-  case $PATH in
-    $bindir|$bindir:*|*:$bindir|*:$bindir:*) ;;
-    *) PATH=$bindir:$PATH; export PATH;;
-  esac
+  qdbus=$qbindir/qdbus
+else
+  qdbus=qdbus
 fi
 
 # Check if a KDE session already is running and whether it's possible to connect to X
@@ -358,7 +351,7 @@
 if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
     eval `dbus-launch --sh-syntax --exit-with-session`
 fi
-if qdbus >/dev/null 2>/dev/null; then
+if $qdbus >/dev/null 2>/dev/null; then
     : # ok
 else
     echo 'startkde: Could not start D-Bus. Can you call qdbus?'  1>&2
@@ -462,13 +455,13 @@
     # wait for remaining drkonqi instances with timeout (in seconds)
     wait_drkonqi_timeout=`kreadconfig --file startkderc --group WaitForDrKonqi --key Timeout --default 900`
     wait_drkonqi_counter=0
-    while qdbus | grep "^[^w]*org.kde.drkonqi" > /dev/null ; do
+    while $qdbus | grep "^[^w]*org.kde.drkonqi" > /dev/null ; do
         sleep 5
         wait_drkonqi_counter=$((wait_drkonqi_counter+5))
         if test "$wait_drkonqi_counter" -ge "$wait_drkonqi_timeout" ; then
             # ask remaining drkonqis to die in a graceful way
-            qdbus | grep 'org.kde.drkonqi-' | while read address ; do
-                qdbus "$address" "/MainApplication" "quit"
+            $qdbus | grep 'org.kde.drkonqi-' | while read address ; do
+                $qdbus "$address" "/MainApplication" "quit"
             done
             break
         fi

Reply via email to