[Bugs] #3342 UNSP: Duplicate icons in favorites view

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Sat Mar 3 02:39:03 EST 2012


#3342: Duplicate icons in favorites view
------------------------------------------+---------------------------------
    Reporter:  ajay_garg                  |          Owner:                             
        Type:  defect                     |         Status:  new                        
    Priority:  Unspecified by Maintainer  |      Milestone:  Unspecified by Release Team
   Component:  sugar                      |        Version:  Unspecified                
    Severity:  Unspecified                |       Keywords:  olpc, dx3                  
Distribution:  Unspecified                |   Status_field:  Unconfirmed                
------------------------------------------+---------------------------------

Comment(by ajay_garg):

 This has fixed with the patch for ticket sl#2818, at
 http://patchwork.sugarlabs.org/patch/1214/

 and commit at:
 http://git.sugarlabs.org/dextrose/mainline/commit/2c78ee35e184907b0c63bbc56316fedd36aa8fc3


 The section of the code, that fixes this particular ticket (3342 that is)
 is :

 =============================================================================
 104     diff --git a/src/jarabe/desktop/favoritesview.py
 b/src/jarabe/desktop/favoritesview.py
                 105     index e9c87ea..d91610b 100644
                 106     --- a/src/jarabe/desktop/favoritesview.py
                 107     +++ b/src/jarabe/desktop/favoritesview.py
                 108     @@ -142,11 +142,17 @@ class
 FavoritesView(hippo.Canvas):
                 109     def _add_activity(self, activity_info):
                 110     if activity_info.get_bundle_id() ==
 'org.laptop.JournalActivity':
                 111     return
                 112     - icon = ActivityIcon(activity_info)
                 113     - icon.props.size = style.STANDARD_ICON_SIZE
                 114     - icon.set_resume_mode(self._resume_mode)
                 115     - self._box.insert_sorted(icon, 0,
 self._layout.compare_activities)
                 116     - self._layout.append(icon)
                 117     +
                 118     + # Add icon, if not already present (for the same
 combination of
                 119     + # activity-id and activity-version)
                 120     + icon =
 self._find_activity_icon(activity_info.get_bundle_id(),
                 121     + activity_info.get_activity_version())
                 122     + if icon is None:
                 123     + icon = ActivityIcon(activity_info)
                 124     + icon.props.size = style.STANDARD_ICON_SIZE
                 125     + icon.set_resume_mode(self._resume_mode)
                 126     + self._box.insert_sorted(icon, 0,
 self._layout.compare_activities)
                 127     + self._layout.append(icon)
                 128
                 129     def __activity_added_cb(self, activity_registry,
 activity_info):
                 130     registry = bundleregistry.get_registry()
 =============================================================================

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/3342#comment:2>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list