<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Segoe'; font-size:10pt; font-weight:400; font-style:normal;">Am Tuesday 21 April 2009 schrieb Thiago Macieira:<br>
> Thomas Lübking wrote:<br>
> >of course you could check all services whether they provide certain<br>
> > objects providing certain functions, but that's<br>
> >a) heuristic<br>
> >b) not necessarily efficient...<br>
><br>
> c) not possible<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>a) "object" was meant := "path" (sorry, my fault)<br>
you'd have to recurse parse org.freedesktop.DBus.Introspectable.Introspect<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>PoC (... and i even added linebreaks):<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>--- snip ---<br>
for service in $(qdbus | grep org.kde); do<br>
   if qdbus "$service" | grep "/MainApplication" > /dev/null 2>&1; then <br>
      if qdbus "$service" /MainApplication | grep "org.kde.KApplication.quit()" > /dev/null 2>&1; then <br>
         echo "$service has quittable kde mainapplication"<br>
      fi<br>
   fi<br>
done<br>
--- snip ---<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>:-P<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>at least that was what i meant to identify a service to be heuristically sufficient - and "inefficient" as well...<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>(in case that was not clear in the first mail: this is no sane solution at all)<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Thomas</p></body></html>