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

Igor Gajowiak <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 9e050ba38d89b5335a83889d2dc6a14d2c71babf
Author:	 Igor Gajowiak <[email protected]>
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 *

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.