Patch by bertf to fix handling of non-default types.

This commit is contained in:
Marco Pesenti Gritti 2007-09-15 03:14:30 +02:00
parent 8aecf00060
commit 8ef6c57f8b
2 changed files with 9 additions and 1 deletions

2
NEWS
View File

@ -1,3 +1,5 @@
* #3478 Fix handling of non-default types. (bertf)
Snapshot 0a666e23cf
* #2977 Associate activity with his journal object if there is one. (marco)

View File

@ -135,12 +135,18 @@ 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._mime_defaults[mime_type] == bundle.get_service_name():
if self.get_default_for_type(mime_type) == bundle.get_service_name():
result.insert(0, bundle)
else:
result.append(bundle)
return result
def get_default_for_type(self, mime_type):
if self._mime_defaults.has_key(mime_type):
return self._mime_defaults[mime_type]
else:
return None
def get_registry():
return _bundle_registry