aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-03-13 15:10:22 +0800
committerChris Lahey <clahey@src.gnome.org>2002-03-13 15:10:22 +0800
commitabd6567ea011ed5546aa8b17bea86567ad9fb5f7 (patch)
treeb62808ef22f53beba97f22a50f3f9bd96d74aeda /widgets/table/e-tree.c
parente03e086323ba306b53f27f6e9e95d4c627a51717 (diff)
downloadgsoc2013-evolution-abd6567ea011ed5546aa8b17bea86567ad9fb5f7.tar.gz
gsoc2013-evolution-abd6567ea011ed5546aa8b17bea86567ad9fb5f7.tar.zst
gsoc2013-evolution-abd6567ea011ed5546aa8b17bea86567ad9fb5f7.zip
Replaced e_marshal_BOOL__STRING with this since the function it was used
2002-03-13 Christopher James Lahey <clahey@ximian.com> * gal/util/e-util.c, gal/util/e-util.h (e_marshal_BOOL__STRING_INT): Replaced e_marshal_BOOL__STRING with this since the function it was used for has been modified. From gal/e-table/ChangeLog: 2002-03-13 Christopher James Lahey <clahey@ximian.com> * e-table-extras.c (e_string_search): Check for a NULL haystack here. * e-table-search.c, e-table-search.h: Added a parameter to the search signal here to pass in flags. Specifically, added the E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST flag. Improved the search behavior here. * e-table.c, e-tree.c: Handle the new signature for the search signal here. svn path=/trunk/; revision=16139
Diffstat (limited to 'widgets/table/e-tree.c')
-rw-r--r--widgets/table/e-tree.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index 7b1d1cffc7..91f9a500ce 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -419,7 +419,7 @@ search_search_callback (ETreeModel *model, ETreePath path, gpointer data)
}
static gboolean
-et_search_search (ETableSearch *search, char *string, ETree *et)
+et_search_search (ETableSearch *search, char *string, ETableSearchFlags flags, ETree *et)
{
ETreePath cursor;
ETreePath found;
@@ -436,11 +436,21 @@ et_search_search (ETableSearch *search, char *string, ETree *et)
cursor = e_tree_get_cursor (et);
cursor = e_tree_sorted_model_to_view_path (et->priv->sorted, cursor);
+ if (flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST) {
+ const void *value;
+
+ value = e_tree_model_value_at (E_TREE_MODEL (et->priv->sorted), cursor, et->priv->current_search_col);
+
+ if (et->priv->current_search (value, string)) {
+ return TRUE;
+ }
+ }
+
found = e_tree_model_node_find (E_TREE_MODEL (et->priv->sorted), cursor, NULL, E_TREE_FIND_NEXT_FORWARD, search_search_callback, &cb_data);
if (found == NULL)
found = e_tree_model_node_find (E_TREE_MODEL (et->priv->sorted), NULL, cursor, E_TREE_FIND_NEXT_FORWARD, search_search_callback, &cb_data);
- if (found) {
+ if (found && found != cursor) {
int model_row;
e_tree_table_adapter_show_node (et->priv->etta, found);
@@ -450,9 +460,14 @@ et_search_search (ETableSearch *search, char *string, ETree *et)
e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->priv->selection), model_row, col, GDK_CONTROL_MASK);
return TRUE;
- } else {
+ } else if (!(flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST)) {
+ const void *value;
+
+ value = e_tree_model_value_at (E_TREE_MODEL (et->priv->sorted), cursor, et->priv->current_search_col);
+
+ return et->priv->current_search (value, string);
+ } else
return FALSE;
- }
}
static void