[Xfce4-commits] <midori:master> Clear the history folders on collapse, repopulate on expand
Christian Dywan
noreply at xfce.org
Wed Feb 3 22:20:03 CET 2010
Updating branch refs/heads/master
to 1a236a380098971bf3fedb68ac46ca7ae48d98a2 (commit)
from 42a29682e6081afcf2aee07df19099278c4ebd65 (commit)
commit 1a236a380098971bf3fedb68ac46ca7ae48d98a2
Author: Alexander Butenko <a.butenka at gmail.com>
Date: Wed Feb 3 22:13:00 2010 +0100
Clear the history folders on collapse, repopulate on expand
panels/midori-history.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/panels/midori-history.c b/panels/midori-history.c
index 3f56ddb..1c6f748 100644
--- a/panels/midori-history.c
+++ b/panels/midori-history.c
@@ -808,20 +808,26 @@ midori_history_row_expanded_cb (GtkTreeView* treeview,
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview));
gtk_tree_model_get (model, iter, 0, &item, -1);
- /* FIXME: We need always repopulate parent. Now ignoring dupes */
- if (gtk_tree_model_iter_n_children (model, iter) < 2)
- midori_history_read_from_db (history, GTK_TREE_STORE (model),
- iter, katze_item_get_added (item));
+ midori_history_read_from_db (history, GTK_TREE_STORE (model),
+ iter, katze_item_get_added (item));
g_object_unref (item);
}
static void
midori_history_row_collapsed_cb (GtkTreeView *treeview,
- GtkTreeIter *iter,
+ GtkTreeIter *parent,
GtkTreePath *path,
gpointer user_data)
{
- /* FIXME: Free parent childs on close and repopulate them again on open */
+ GtkTreeModel* model;
+ GtkTreeIter child;
+
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview));
+ while (gtk_tree_model_iter_n_children (model, parent) > 1)
+ {
+ if (gtk_tree_model_iter_children (model, &child, parent))
+ gtk_tree_store_remove (GTK_TREE_STORE (model), &child);
+ }
}
#endif
More information about the Xfce4-commits
mailing list