Re: [evolution-patches] #55579: Search is buggy and not usable.



I think it's ok now.
sorry for my carelessness of the formatting.

please help me commit to trunk.

在2004年03月15日的15:09,Not Zed写道:
You shouldn't call copy_values, clone() already copies the values, so
remove this.

Could you also add a changelog and fix the formatting please? (blank
line after the declaration block) and resubmit.  It basically looks ok
otherwise (not that i've run the patch but it looks ok).

On Mon, 2004-03-15 at 11:34 +0800, Bill Zhu wrote:

> hi, please see this bug
>     http://bugzilla.ximian.com/show_bug.cgi?id=55579
> 
> 
> This a bug of filter_rule_clone.
> When we invoke the "advanced search" dialog, we use
> g_object_set_data_full to band a rule to the dialog on creating it.
> the rule banded with the dialog is a clone 
> of  efb->current_query. we use this bit of code to do it:
>     rule = filter_rule_clone (efb->current_query);
> but there is a problem in filter_rule_clone.
> because when we copy a the parts of a rule, the pointers of parts are
> copied but the actual data isn't.
> so this cause the current result:
> for example after we select the "not contain" menu item, the current
> query is changed too.
> As a result, when clicking the "clear" button...
> 
> Regards
> 
> Bill
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/filter/ChangeLog,v
retrieving revision 1.393
diff -u -r1.393 ChangeLog
--- ChangeLog	20 Feb 2004 20:34:24 -0000	1.393
+++ ChangeLog	16 Mar 2004 01:57:51 -0000
@@ -1,3 +1,8 @@
+2004-03-14  Bill Zhu  <bill zhu sun com>
+
+	* filter-rule.c (rule_copy): When copying a FilterPart of a rule, we
+	need copy the data of parts together but not only copy the pointer.
+	
 2004-02-20  Jeffrey Stedfast  <fejj ximian com>
 
 	* rule-editor.c (rule_delete): After setting the new selected
Index: filter-rule.c
===================================================================
RCS file: /cvs/gnome/evolution/filter/filter-rule.c,v
retrieving revision 1.57
diff -u -r1.57 filter-rule.c
--- filter-rule.c	11 Apr 2003 19:11:50 -0000	1.57
+++ filter-rule.c	16 Mar 2004 01:58:10 -0000
@@ -436,8 +436,9 @@
 	
 	node = src->parts;
 	while (node) {
-		FilterPart *part = node->data;
-		
+		FilterPart *part;
+
+		part = filter_part_clone (node->data);
 		g_object_ref (part);
 		dest->parts = g_list_append (dest->parts, part);
 		node = node->next;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]