[evolution-data-server] libedataserver: Don't print warning if e_sexp_parse() fails



commit 2dee25020ae99319f6882ad22bdce4c30bcd3776
Author: Mathias Hasselmann <mathias openismus com>
Date:   Thu Dec 6 15:40:03 2012 +0100

    libedataserver: Don't print warning if e_sexp_parse() fails
    
    Backends that don't support the full range of queries call e_sexp_parse() with
    their reduced set of symbols to check if they actually can process a query or
    if they must resort to full table scans. If now such a backend is used from
    within a GTest based test this warning causes the test to fail, which obviously
    is bad. Therefore this patch drops the warning in e_sexp_parse() and moves it
    to hopefully more appropriate places.

 addressbook/libebook/e-book-query.c             |    6 +++++-
 addressbook/libedata-book/e-book-backend-sexp.c |    1 +
 calendar/libedata-cal/e-cal-backend-sexp.c      |    1 +
 libedataserver/e-sexp.c                         |    4 +---
 4 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libebook/e-book-query.c b/addressbook/libebook/e-book-query.c
index c39b9ba..22bf92b 100644
--- a/addressbook/libebook/e-book-query.c
+++ b/addressbook/libebook/e-book-query.c
@@ -686,7 +686,11 @@ e_book_query_from_string (const gchar *query_string)
 	}
 
 	e_sexp_input_text (sexp, query_string, strlen (query_string));
-	e_sexp_parse (sexp);
+
+	if (e_sexp_parse (sexp)) {
+		g_warning ("%s: Error in parsing: %s", G_STRFUNC, sexp->error);
+		return NULL;
+	}
 
 	r = e_sexp_eval (sexp);
 
diff --git a/addressbook/libedata-book/e-book-backend-sexp.c b/addressbook/libedata-book/e-book-backend-sexp.c
index db905de..2789a73 100644
--- a/addressbook/libedata-book/e-book-backend-sexp.c
+++ b/addressbook/libedata-book/e-book-backend-sexp.c
@@ -994,6 +994,7 @@ e_book_backend_sexp_new (const gchar *text)
 	esexp_error = e_sexp_parse (sexp->priv->search_sexp);
 
 	if (esexp_error == -1) {
+		g_warning ("%s: Error in parsing: %s", G_STRFUNC, sexp->priv->search_sexp->error);
 		g_object_unref (sexp);
 		sexp = NULL;
 	}
diff --git a/calendar/libedata-cal/e-cal-backend-sexp.c b/calendar/libedata-cal/e-cal-backend-sexp.c
index a8afa80..8b3261e 100644
--- a/calendar/libedata-cal/e-cal-backend-sexp.c
+++ b/calendar/libedata-cal/e-cal-backend-sexp.c
@@ -1618,6 +1618,7 @@ e_cal_backend_sexp_new (const gchar *text)
 	esexp_error = e_sexp_parse (sexp->priv->search_sexp);
 
 	if (esexp_error == -1) {
+		g_warning ("%s: Error in parsing: %s", G_STRFUNC, sexp->priv->search_sexp->error);
 		g_object_unref (sexp);
 		sexp = NULL;
 	}
diff --git a/libedataserver/e-sexp.c b/libedataserver/e-sexp.c
index 0e057a9..67ad75b 100644
--- a/libedataserver/e-sexp.c
+++ b/libedataserver/e-sexp.c
@@ -1672,10 +1672,8 @@ e_sexp_parse (ESExp *f)
 {
 	g_return_val_if_fail (IS_E_SEXP (f), -1);
 
-	if (setjmp (f->failenv)) {
-		g_warning ("Error in parsing: %s", f->error);
+	if (setjmp (f->failenv))
 		return -1;
-	}
 
 	if (f->tree)
 		parse_term_free (f, f->tree);



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