From 8ef6c57f8b1ffeb89b155b53e733115df8f6d1b9 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 15 Sep 2007 03:14:30 +0200 Subject: [PATCH] Patch by bertf to fix handling of non-default types. --- NEWS | 2 ++ services/shell/bundleregistry.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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