[gnome-contacts/wip/sorted] Remove iter with on container.remove



commit b56d38b78d6f8b7cdcd4e0ed2347bd89d2a503fd
Author: Alexander Larsson <alexl redhat com>
Date:   Fri May 11 15:38:56 2012 +0200

    Remove iter with on container.remove

 src/contacts-sorted.vala |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/contacts-sorted.vala b/src/contacts-sorted.vala
index b2552d6..7a48118 100644
--- a/src/contacts-sorted.vala
+++ b/src/contacts-sorted.vala
@@ -665,12 +665,13 @@ public class Contacts.Sorted : Container {
 
   public override void remove (Widget widget) {
     unowned ChildInfo? info = lookup_info (widget);
-    if (info == null)
+    if (info == null) {
+      warning ("Tried to remove non-child %p\n", widget);
       return;
+    }
 
-    if (info == selected_child) {
+    if (info == selected_child)
       update_selected (null);
-    }
     if (info == prelight_child)
       prelight_child = null;
     if (info == cursor_child)
@@ -682,6 +683,7 @@ public class Contacts.Sorted : Container {
     widget.unparent ();
 
     child_hash.unset (widget);
+    children.remove (info.iter);
 
     update_separator (next, false);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]