/soc/2015/igor.gajowiak/chatlog: 9e050ba38d89: Fixed an empty gr...

Igor Gajowiak igor.gajowiak at gmail.com
Sun Aug 9 04:24:10 EDT 2015


Changeset: 9e050ba38d89b5335a83889d2dc6a14d2c71babf
Author:	 Igor Gajowiak <igor.gajowiak at gmail.com>
Date:	 2015-08-09 10:23 +0200
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/igor.gajowiak/chatlog/rev/9e050ba38d89

Description:

Fixed an empty group issue after removing a log for a buddy.

diffstat:

 pidgin/gtkgenericlog.c |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (22 lines):

diff --git a/pidgin/gtkgenericlog.c b/pidgin/gtkgenericlog.c
--- a/pidgin/gtkgenericlog.c
+++ b/pidgin/gtkgenericlog.c
@@ -467,7 +467,18 @@ on_wipe_log_for_buddy_item_clicked(GtkAc
 	gboolean selected = gtk_tree_selection_get_selected(sel, NULL, &row);
 	g_return_if_fail(selected);
 
+	GtkTreeIter parent;
+	gboolean has_parent = gtk_tree_model_iter_parent(
+		GTK_TREE_MODEL(viewer->blist_tree_store), &parent, &row);
+
+	g_assert(has_parent);
+
 	gtk_tree_store_remove(viewer->blist_tree_store, &row);
+
+	if (!gtk_tree_model_iter_has_child(GTK_TREE_MODEL(viewer->blist_tree_store),
+			&parent)) {
+		gtk_tree_store_remove(viewer->blist_tree_store, &parent);
+	}
 }
 
 static GtkWidget *



More information about the Commits mailing list