aboutsummaryrefslogtreecommitdiff
path: root/src/gtkutils.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-01-27 07:28:23 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-01-27 07:28:23 +0000
commit87e24b01c2163658cd35762d3cb596a35e4271da (patch)
tree63b2b88e687e3c59702a00968e74bbf2a1b93372 /src/gtkutils.c
parent3421560291575cc9a94a7464712be4e69d1631ec (diff)
when deleting a collapsed thread, all the messages in the thread will be removed.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@935 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/gtkutils.c')
-rw-r--r--src/gtkutils.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/gtkutils.c b/src/gtkutils.c
index 54091314..cdeb4c26 100644
--- a/src/gtkutils.c
+++ b/src/gtkutils.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2005 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -415,6 +415,31 @@ gboolean gtkut_tree_model_find_by_column_data(GtkTreeModel *model,
return FALSE;
}
+void gtkut_tree_model_foreach(GtkTreeModel *model, GtkTreeIter *start,
+ GtkTreeModelForeachFunc func, gpointer user_data)
+{
+ gboolean valid = TRUE;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+
+ g_return_if_fail(func != NULL);
+
+ if (!start) {
+ gtk_tree_model_foreach(model, func, user_data);
+ return;
+ }
+
+ path = gtk_tree_model_get_path(model, start);
+ func(model, path, start, user_data);
+ gtk_tree_path_free(path);
+
+ valid = gtk_tree_model_iter_children(model, &iter, start);
+ while (valid) {
+ gtkut_tree_model_foreach(model, &iter, func, user_data);
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+}
+
gboolean gtkut_tree_row_reference_get_iter(GtkTreeModel *model,
GtkTreeRowReference *ref,
GtkTreeIter *iter)