[evolution-patches] patch for 33243 (calendar)



? config.guess
? config.sub
? depcomp
? install-sh
? ltmain.sh
? missing
? mkinstalldirs
? ylwrap
? libical/src/libicalss/icalssyacc.output
? libical/src/python/Makefile
? libical/src/python/Makefile.in
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.196
diff -u -p -r1.196 ChangeLog
--- ChangeLog	1 Mar 2004 15:45:54 -0000	1.196
+++ ChangeLog	1 Mar 2004 22:15:05 -0000
@@ -1,5 +1,14 @@
 2004-03-01  Rodrigo Moya <rodrigo ximian com>
 
+	Fixes #33243
+
+	* libedata-cal/e-cal-backend-sexp.c (matches_location): new function
+	to check if a component's location matches a string.
+	(matches_any): call matches_location also.
+	(func_contains): added support for searching the location also.
+
+2004-03-01  Rodrigo Moya <rodrigo ximian com>
+
 	* idl/Evolution-DataServer-Calendar.idl: added new arguments to the
 	notifyObjectsSent method for backends to return the list of users and
 	events for which it operated.
Index: libedata-cal/e-cal-backend-sexp.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libedata-cal/e-cal-backend-sexp.c,v
retrieving revision 1.11
diff -u -p -r1.11 e-cal-backend-sexp.c
--- libedata-cal/e-cal-backend-sexp.c	26 Jan 2004 14:55:08 -0000	1.11
+++ libedata-cal/e-cal-backend-sexp.c	1 Mar 2004 22:15:06 -0000
@@ -404,6 +404,20 @@ matches_summary (ECalComponent *comp, co
 	return e_util_utf8_strstrcasedecomp (text.value, str) != NULL;
 }
 
+/* Returns whether the location in a component matches the specified string */
+static gboolean
+matches_location (ECalComponent *comp, const char *str)
+{
+	const char *location = NULL;
+
+	e_cal_component_get_location (comp, &location);
+
+	if (!location)
+		return FALSE;
+
+	return e_util_utf8_strstrcasedecomp (location, str) != NULL;
+}
+
 /* Returns whether any text field in a component matches the specified string */
 static gboolean
 matches_any (ECalComponent *comp, const char *str)
@@ -417,12 +431,13 @@ matches_any (ECalComponent *comp, const 
 
 	return (matches_comment (comp, str)
 		|| matches_description (comp, str)
-		|| matches_summary (comp, str));
+		|| matches_summary (comp, str)
+		|| matches_location (comp, str));
 }
 
 /* (contains? FIELD STR)
  *
- * FIELD - string, name of field to match (any, comment, description, summary)
+ * FIELD - string, name of field to match (any, comment, description, summary, location)
  * STR - string, match string
  *
  * Returns a boolean indicating whether the specified field contains the
@@ -471,10 +486,12 @@ func_contains (ESExp *esexp, int argc, E
 		matches = matches_description (ctx->comp, str);
 	else if (strcmp (field, "summary") == 0)
 		matches = matches_summary (ctx->comp, str);
+	else if (strcmp (field, "location") == 0)
+		matches = matches_location (ctx->comp, str);
 	else {
 		e_sexp_fatal_error (esexp, _("\"%s\" expects the first "
 					     "argument to be either \"any\", "
-					     "\"summary\", or \"description\""),
+					     "\"summary\", or \"description\", or \"location\""),
 				    "contains");
 		return NULL;
 	}


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