[balsa/gtk4: 207/248] identity: Simplify emptying a GtkBox




commit 4a52f7e1e74c7042aa7bef54184ff33604a14fce
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Oct 22 13:02:33 2020 -0400

    identity: Simplify emptying a GtkBox

 libbalsa/identity.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index 5767e53ff..c474d2989 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -1227,12 +1227,9 @@ md_face_path_changed(const gchar * filename, gboolean active,
         return;
     }
 
-    child = gtk_widget_get_first_child(face_box);
-    while (child != NULL) {
-        GtkWidget *this_child = child;
-        child = gtk_widget_get_next_sibling(child);
-        gtk_box_remove(GTK_BOX(face_box), this_child);
-    }
+    while ((child = gtk_widget_get_first_child(face_box)) != NULL)
+        gtk_box_remove(GTK_BOX(face_box), child);
+
     gtk_box_append(GTK_BOX(face_box), image);
     gtk_widget_show(face_box);
 


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