All pastes #384240 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-06 22:42 UTC
rendered paste body
Index: python/deskbar-handler/tracker-handler.py
===================================================================
--- python/deskbar-handler/tracker-handler.py	(revision 531)
+++ python/deskbar-handler/tracker-handler.py	(working copy)
@@ -27,6 +27,15 @@
 		try :
 			if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
 				import dbus.glib
+			
+			# Check that Tracker can be started via dbus activation, we will have trouble if it's not
+			bus = dbus.SessionBus()
+			proxy_obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
+			dbus_iface = dbus.Interface(proxy_obj, 'org.freedesktop.DBus')
+			activatables = dbus_iface.ListActivatableNames()
+			if not "org.freedesktop.Tracker" in activatables:
+				return (deskbar.Handler.HANDLER_IS_NOT_APPLICABLE, "Tracker is not activatable via dbus", None)	
+				
 		except:
 			return (deskbar.Handler.HANDLER_IS_NOT_APPLICABLE, "Python dbus.glib bindings not found.", None)
 		return (deskbar.Handler.HANDLER_IS_HAPPY, None, None)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 531)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2007-03-06  Mikkel Kamstrup Erlandsen <kamstrup@cvs.gnome.org>
+
+	* python/deskbar-handler/tracker-handler.py:
+	Check that Tracker is available via dbus activation or don't mark the handler
+	as available.
+
 2007-03-05  Edward Duffy <eduffy@gmail.com>
 
 	* src/trackerd/tracker-dbus-search.c: