[evolution-data-server] Bug #632177 - Hide source group when none source lefts after remove
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug #632177 - Hide source group when none source lefts after remove
- Date: Fri, 29 Oct 2010 12:58:13 +0000 (UTC)
commit 0d1cae7e4727ffb769b11959fee8c33981689b16
Author: Aparna <aparna nand wipro com>
Date: Fri Oct 29 14:56:52 2010 +0200
Bug #632177 - Hide source group when none source lefts after remove
libedataserverui/e-source-selector.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/libedataserverui/e-source-selector.c b/libedataserverui/e-source-selector.c
index 5ffdc4c..4f67d2a 100644
--- a/libedataserverui/e-source-selector.c
+++ b/libedataserverui/e-source-selector.c
@@ -353,11 +353,21 @@ rebuild_model (ESourceSelector *selector)
for (p = rebuild_data->deleted_uids; p; p = p->next) {
GtkTreeRowReference *row_ref = p->data;
GtkTreePath *path;
+ GtkTreeIter parent_iter;
+ gboolean parent_exists = FALSE;
path = gtk_tree_row_reference_get_path (row_ref);
gtk_tree_model_get_iter (model, &iter, path);
+
+ /* If it is the last source in the group, delete the group from the tree */
+ if (gtk_tree_model_iter_parent (model, &parent_iter, &iter))
+ parent_exists = TRUE;
+
gtk_tree_store_remove (store, &iter);
+ if (parent_exists && !gtk_tree_model_iter_has_child (model, &parent_iter))
+ gtk_tree_store_remove (store, &parent_iter);
+
gtk_tree_path_free (path);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]