Removing an item from the ModeButton widget renders consecutive item indexes invalid

Bug #1066136 reported by Victor Martinez on 2012-10-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Granite
Fix Released
Medium
Victor Martinez

Bug Description

The current implementation of ModeButton.remove uses Gtk.Widget.destroy to remove an item from the widget. Since the widget's children list is obviously altered after that, the remove() method invalidates the indexes of the items that were following the index which was removed (e.g. if the removed item had index 4, then the current item 5 will be 4, and similarly for the rest of consecutive items).

Test attached (compile with vala 0.18 to get useful assertion messages).

Related branches

Victor Martinez (victored) wrote :
Victor Martinez (victored) wrote :

The linked branch fixes the problem. It passes the test attached to the bug report.

Changed in granite:
assignee: nobody → Victor Eduardo (victored)
importance: Undecided → Medium
milestone: none → 0.1.1
status: New → In Progress
summary: - Removing an item from the ModeButton widget renders consecutive items
- invalid
+ Removing an item from the ModeButton widget renders consecutive item
+ indexes invalid
Cody Garver (codygarver) on 2012-10-26
Changed in granite:
status: In Progress → Fix Committed
Changed in granite:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments