[sugar] [PATCH] fix #6753 Activities should be able to specify "mime_types = */*"

Martin Dengler martin at martindengler.com
Sun Apr 27 22:17:55 EDT 2008


---
 service/bundleregistry.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/service/bundleregistry.py b/service/bundleregistry.py
index 5b12625..be7a6c1 100644
--- a/service/bundleregistry.py
+++ b/service/bundleregistry.py
@@ -140,7 +140,9 @@ class BundleRegistry(gobject.GObject):
     def get_activities_for_type(self, mime_type):
         result = []
         for bundle in self._bundles:
-            if bundle.get_mime_types() and mime_type in bundle.get_mime_types():
+            supported_types = bundle.get_mime_types()
+            if supported_types is not None and \
+                    (mime_type in supported_types or "*/*" in supported_types):
                 if self.get_default_for_type(mime_type) == \
                         bundle.get_bundle_id():
                     result.insert(0, bundle)
-- 
1.5.4.1



More information about the Sugar mailing list