[Bugs] #442 IMME: After installing activity there are two icons in list and favorites view

SugarLabs Bugs bugtracker-noreply at sugarlabs.org
Fri Feb 27 05:18:50 EST 2009


#442: After installing activity there are two icons in list and favorites view
--------------------------+-------------------------------------------------
    Reporter:  erikos     |          Owner:  erikos           
        Type:  defect     |         Status:  assigned         
    Priority:  Immediate  |      Milestone:  0.84             
   Component:  sugar      |        Version:  Git as of bugdate
    Severity:  Blocker    |     Resolution:                   
    Keywords:  r?         |   Distribution:  Unspecified      
Status_field:  Assigned   |  
--------------------------+-------------------------------------------------
Changes (by erikos):

  * keywords:  => r?


Comment:

 This would do it.

 {{{
 diff --git a/src/jarabe/model/bundleregistry.py
 b/src/jarabe/model/bundleregistry.py
 index 6a05734..62ac6e2 100644
 --- a/src/jarabe/model/bundleregistry.py
 +++ b/src/jarabe/model/bundleregistry.py
 @@ -72,7 +72,15 @@ class BundleRegistry(gobject.GObject):
          if not one_file.get_path().endswith('.activity'):
              return
          if event_type == gio.FILE_MONITOR_EVENT_CREATED:
 -            self.add_bundle(one_file.get_path())
 +            try:
 +                bundle = ActivityBundle(one_file.get_path())
 +            except MalformedBundleException:
 +                logging.error('Error loading bundle %r:\n%s' % (
 +                        one_file.get_path(),
 +
 ''.join(traceback.format_exception(*sys.exc_info()))))
 +                return
 +            if not self.is_installed(bundle):
 +                self.add_bundle(one_file.get_path())
          elif event_type == gio.FILE_MONITOR_EVENT_DELETED:
              self.remove_bundle(one_file.get_path())
 }}}

-- 
Ticket URL: <http://dev.sugarlabs.org/ticket/442#comment:4>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list