diff --git a/NEWS b/NEWS index 40c82196..7f27f9af 100644 --- a/NEWS +++ b/NEWS @@ -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) diff --git a/services/shell/bundleregistry.py b/services/shell/bundleregistry.py index 8de49ff1..e66ff6e2 100644 --- a/services/shell/bundleregistry.py +++ b/services/shell/bundleregistry.py @@ -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