evolution-data-server r9118 - branches/camel-db-summary/camel



Author: psankar
Date: Mon Jul 14 08:10:39 2008
New Revision: 9118
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9118&view=rev

Log:
Enable search of system flags


Modified:
   branches/camel-db-summary/camel/camel-folder-search.c

Modified: branches/camel-db-summary/camel/camel-folder-search.c
==============================================================================
--- branches/camel-db-summary/camel/camel-folder-search.c	(original)
+++ branches/camel-db-summary/camel/camel-folder-search.c	Mon Jul 14 08:10:39 2008
@@ -1362,14 +1362,25 @@
 	if (search->current) {
 		gboolean truth = FALSE;
 		
-		if (argc == 1)
-			truth = camel_system_flag_get (camel_message_info_flags(search->current), argv[0]->value.string);
+		if (argc == 1) 
+				truth = camel_system_flag_get (camel_message_info_flags(search->current), argv[0]->value.string);
 		
 		r = e_sexp_result_new(f, ESEXP_RES_BOOL);
 		r->value.bool = truth;
 	} else {
-		r = e_sexp_result_new(f, ESEXP_RES_ARRAY_PTR);
-		r->value.ptrarray = g_ptr_array_new ();
+			char * value = argv[0]->value.string;
+
+			if (g_str_has_suffix (search->query->str, " "))
+					g_string_append_printf (search->query, "WHERE %s = 0", value);
+			else {
+					if (f->operators)
+							g_string_append_printf (search->query, " %s %s = 0", (char *) (g_slist_nth_data (f->operators, 0)), value);
+					else
+							g_string_append_printf (search->query, " OR %s = 0", value);
+			}
+
+			r = e_sexp_result_new(f, ESEXP_RES_BOOL);
+			r->value.bool = FALSE; 
 	}
 	
 	return r;



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