aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-15 22:57:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-15 23:06:45 +0800
commit137a9cea1b588499c7e46e9e1dba341566dd18a1 (patch)
treea207f432e047478e02d6a2c0335ec47cb69c0428
parent4e394d89cf79998592a6436c790fd8bd42ffbb44 (diff)
downloadgsoc2013-evolution-137a9cea1b588499c7e46e9e1dba341566dd18a1.tar
gsoc2013-evolution-137a9cea1b588499c7e46e9e1dba341566dd18a1.tar.gz
gsoc2013-evolution-137a9cea1b588499c7e46e9e1dba341566dd18a1.tar.bz2
gsoc2013-evolution-137a9cea1b588499c7e46e9e1dba341566dd18a1.tar.lz
gsoc2013-evolution-137a9cea1b588499c7e46e9e1dba341566dd18a1.tar.xz
gsoc2013-evolution-137a9cea1b588499c7e46e9e1dba341566dd18a1.tar.zst
gsoc2013-evolution-137a9cea1b588499c7e46e9e1dba341566dd18a1.zip
e_tree_model_node_find: Remove "forward_direction" parameter.
It's always TRUE.
-rw-r--r--e-util/e-tree-model.c51
-rw-r--r--e-util/e-tree-model.h1
-rw-r--r--e-util/e-tree.c6
3 files changed, 14 insertions, 44 deletions
diff --git a/e-util/e-tree-model.c b/e-util/e-tree-model.c
index 0ca6ac206b..88c65f1d31 100644
--- a/e-util/e-tree-model.c
+++ b/e-util/e-tree-model.c
@@ -1045,7 +1045,6 @@ static ETreePath
e_tree_model_node_real_traverse (ETreeModel *model,
ETreePath path,
ETreePath end_path,
- gboolean forward_direction,
ETreePathFunc func,
gpointer data)
{
@@ -1054,30 +1053,21 @@ e_tree_model_node_real_traverse (ETreeModel *model,
g_return_val_if_fail (E_IS_TREE_MODEL (model), NULL);
g_return_val_if_fail (path != NULL, NULL);
- if (forward_direction)
- child = e_tree_model_node_get_first_child (model, path);
- else
- child = e_tree_model_node_get_last_child (model, path);
+ child = e_tree_model_node_get_first_child (model, path);
while (child) {
ETreePath result;
- if (forward_direction && (child == end_path || func (model, child, data)))
+ if (child == end_path || func (model, child, data))
return child;
if ((result = e_tree_model_node_real_traverse (
- model, child, end_path,
- forward_direction, func, data)))
+ model, child, end_path, func, data)))
return result;
- if (!forward_direction && (child == end_path || func (model, child, data)))
- return child;
-
- if (forward_direction)
- child = e_tree_model_node_get_next (model, child);
- else
- child = e_tree_model_node_get_prev (model, child);
+ child = e_tree_model_node_get_next (model, child);
}
+
return NULL;
}
@@ -1086,7 +1076,6 @@ e_tree_model_node_real_traverse (ETreeModel *model,
* @tree_model:
* @path:
* @end_path:
- * @forward_direction:
* @func:
* @data:
*
@@ -1096,7 +1085,6 @@ ETreePath
e_tree_model_node_find (ETreeModel *tree_model,
ETreePath path,
ETreePath end_path,
- gboolean forward_direction,
ETreePathFunc func,
gpointer data)
{
@@ -1110,35 +1098,23 @@ e_tree_model_node_find (ETreeModel *tree_model,
ETreePath root;
root = e_tree_model_get_root (tree_model);
- if (forward_direction && (end_path == root || func (tree_model, root, data)))
+ if (end_path == root || func (tree_model, root, data))
return root;
result = e_tree_model_node_real_traverse (
- tree_model, root, end_path, forward_direction, func, data);
+ tree_model, root, end_path, func, data);
if (result)
return result;
- if (!forward_direction && (end_path == root || func (tree_model, root, data)))
- return root;
-
return NULL;
}
while (1) {
- if (forward_direction) {
- if ((result = e_tree_model_node_real_traverse (
- tree_model, path, end_path,
- forward_direction, func, data)))
- return result;
- next = e_tree_model_node_get_next (tree_model, path);
- } else {
- next = e_tree_model_node_get_prev (tree_model, path);
- if (next && (result = e_tree_model_node_real_traverse (
- tree_model, next, end_path,
- forward_direction, func, data)))
- return result;
- }
+ if ((result = e_tree_model_node_real_traverse (
+ tree_model, path, end_path, func, data)))
+ return result;
+ next = e_tree_model_node_get_next (tree_model, path);
while (next == NULL) {
path = e_tree_model_node_get_parent (tree_model, path);
@@ -1146,10 +1122,7 @@ e_tree_model_node_find (ETreeModel *tree_model,
if (path == NULL)
return NULL;
- if (forward_direction)
- next = e_tree_model_node_get_next (tree_model, path);
- else
- next = path;
+ next = e_tree_model_node_get_next (tree_model, path);
}
if (end_path == next || func (tree_model, next, data))
diff --git a/e-util/e-tree-model.h b/e-util/e-tree-model.h
index 000a017b93..1c42b3d391 100644
--- a/e-util/e-tree-model.h
+++ b/e-util/e-tree-model.h
@@ -260,7 +260,6 @@ void e_tree_model_node_traverse_preorder
ETreePath e_tree_model_node_find (ETreeModel *tree_model,
ETreePath path,
ETreePath end_path,
- gboolean forward_direction,
ETreePathFunc func,
gpointer data);
diff --git a/e-util/e-tree.c b/e-util/e-tree.c
index 5a6b52452e..4ea3a4ae43 100644
--- a/e-util/e-tree.c
+++ b/e-util/e-tree.c
@@ -557,13 +557,11 @@ et_search_search (ETableSearch *search,
}
found = e_tree_model_node_find (
- et->priv->model, cursor, NULL,
- E_TREE_FIND_NEXT_FORWARD,
- search_search_callback, &cb_data);
+ et->priv->model, cursor, NULL,
+ search_search_callback, &cb_data);
if (found == NULL)
found = e_tree_model_node_find (
et->priv->model, NULL, cursor,
- E_TREE_FIND_NEXT_FORWARD,
search_search_callback, &cb_data);
if (found && found != cursor) {