From 28e3d6dc45dd4ab5e0d34078fdf86f1923d0e177 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Fri, 26 Mar 2004 05:10:04 +0000 Subject: return the added option. (clone): make sure we set the current option 2004-03-26 Not Zed * filter-option.c (filter_option_add): return the added option. (clone): make sure we set the current option properly on the new copy. See #56028. * filtertypes.xml: s/pipe to shell command/pipe to program/ s/shell command/run program/, cleans up the UI a lot. svn path=/trunk/; revision=25194 --- filter/filter-option.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'filter/filter-option.c') diff --git a/filter/filter-option.c b/filter/filter-option.c index 249e79c98b..7d1530620d 100644 --- a/filter/filter-option.c +++ b/filter/filter-option.c @@ -163,7 +163,7 @@ filter_option_set_current (FilterOption *option, const char *name) } /* used by implementers to add additional options */ -void +struct _filter_option * filter_option_add(FilterOption *fo, const char *value, const char *title, const char *code) { struct _filter_option *op; @@ -179,6 +179,8 @@ filter_option_add(FilterOption *fo, const char *value, const char *title, const fo->options = g_list_append(fo->options, op); if (fo->current == NULL) fo->current = op; + + return op; } static int @@ -349,7 +351,7 @@ clone (FilterElement *fe) { FilterOption *fo = (FilterOption *)fe, *new; GList *l; - struct _filter_option *op; + struct _filter_option *op, *newop; d(printf ("cloning option\n")); @@ -357,7 +359,9 @@ clone (FilterElement *fe) l = fo->options; while (l) { op = l->data; - filter_option_add (new, op->value, op->title, op->code); + newop = filter_option_add (new, op->value, op->title, op->code); + if (fo->current == op) + new->current = newop; l = l->next; } -- cgit v1.2.3