Rename activity service_name to bundle_id

This commit is contained in:
Marco Pesenti Gritti
2007-10-09 13:15:06 +02:00
parent 57961d17bc
commit 6073a396b3
16 changed files with 62 additions and 50 deletions
+5 -5
View File
@@ -70,9 +70,9 @@ class ActivityRegistry(dbus.service.Object):
@dbus.service.method(_ACTIVITY_REGISTRY_IFACE,
in_signature='s', out_signature='a{sv}')
def GetActivity(self, service_name):
def GetActivity(self, bundle_id):
registry = bundleregistry.get_registry()
bundle = registry.get_bundle(service_name)
bundle = registry.get_bundle(bundle_id)
if not bundle:
return {}
@@ -86,8 +86,8 @@ class ActivityRegistry(dbus.service.Object):
for bundle in bundleregistry.get_registry():
name = bundle.get_name().lower()
service_name = bundle.get_service_name().lower()
if name.find(key) != -1 or service_name.find(key) != -1:
bundle_id = bundle.get_bundle_id().lower()
if name.find(key) != -1 or bundle_id.find(key) != -1:
result.append(self._bundle_to_dict(bundle))
return result
@@ -112,7 +112,7 @@ class ActivityRegistry(dbus.service.Object):
def _bundle_to_dict(self, bundle):
return {'name': bundle.get_name(),
'icon': bundle.get_icon(),
'service_name': bundle.get_service_name(),
'bundle_id': bundle.get_bundle_id(),
'path': bundle.get_path(),
'command': bundle.get_command(),
'show_launcher': bundle.get_show_launcher()}
+3 -3
View File
@@ -61,10 +61,10 @@ class BundleRegistry(gobject.GObject):
self._search_path = []
self._mime_defaults = _load_mime_defaults()
def get_bundle(self, service_name):
def get_bundle(self, bundle_id):
"""Returns an bundle given his service name"""
for bundle in self._bundles:
if bundle.get_service_name() == service_name:
if bundle.get_bundle_id() == bundle_id:
return bundle
return None
@@ -116,7 +116,7 @@ class BundleRegistry(gobject.GObject):
result = []
for bundle in self._bundles:
if bundle.get_mime_types() and mime_type in bundle.get_mime_types():
if self.get_default_for_type(mime_type) == bundle.get_service_name():
if self.get_default_for_type(mime_type) == bundle.get_bundle_id():
result.insert(0, bundle)
else:
result.append(bundle)
+1 -1
View File
@@ -73,7 +73,7 @@ class ClipboardObject:
registry = bundleregistry.get_registry()
activities = registry.get_activities_for_type(self.get_mime_type())
if activities:
return [activity.get_service_name() for activity in activities]
return [activity.get_bundle_id() for activity in activities]
else:
return ''