[evolution-data-server] [EBookCache/ECalCache] Understand '#t' search expression as 'list all'



commit f1205d1fc04abf0e4a1cdfc7aa918d1901903e0d
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 30 08:46:54 2017 +0200

    [EBookCache/ECalCache] Understand '#t' search expression as 'list all'

 src/addressbook/libedata-book/e-book-cache.c |    2 +-
 src/calendar/libedata-cal/e-cal-cache.c      |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/addressbook/libedata-book/e-book-cache.c b/src/addressbook/libedata-book/e-book-cache.c
index 9b7efa2..db1c1cd 100644
--- a/src/addressbook/libedata-book/e-book-cache.c
+++ b/src/addressbook/libedata-book/e-book-cache.c
@@ -2064,7 +2064,7 @@ query_preflight_initialize (PreflightContext *context,
        ESExpResult *result;
        gint esexp_error, ii;
 
-       if (!sexp || !*sexp) {
+       if (!sexp || !*sexp || g_strcmp0 (sexp, "#t") == 0) {
                context->status = PREFLIGHT_LIST_ALL;
                return;
        }
diff --git a/src/calendar/libedata-cal/e-cal-cache.c b/src/calendar/libedata-cal/e-cal-cache.c
index a3c14ec..c897ef4 100644
--- a/src/calendar/libedata-cal/e-cal-cache.c
+++ b/src/calendar/libedata-cal/e-cal-cache.c
@@ -1526,7 +1526,7 @@ ecc_convert_sexp_to_sql (ECalCache *cal_cache,
        *out_where_clause = NULL;
 
        /* Include everything */
-       if (!sexp_str || !*sexp_str)
+       if (!sexp_str || !*sexp_str || g_strcmp0 (sexp_str, "#t") == 0)
                return TRUE;
 
        ctx.cal_cache = cal_cache;
@@ -2749,7 +2749,7 @@ e_cal_cache_search_with_callback (ECalCache *cal_cache,
        g_return_val_if_fail (E_IS_CAL_CACHE (cal_cache), FALSE);
        g_return_val_if_fail (func != NULL, FALSE);
 
-       if (sexp && *sexp) {
+       if (sexp && *sexp && g_strcmp0 (sexp, "#t") != 0) {
                bsexp = e_cal_backend_sexp_new (sexp);
                if (!bsexp) {
                        g_set_error (error, E_CACHE_ERROR, E_CACHE_ERROR_INVALID_QUERY,
@@ -2758,6 +2758,8 @@ e_cal_cache_search_with_callback (ECalCache *cal_cache,
                }
 
                sexp_id = ecc_take_sexp_object (cal_cache, bsexp);
+       } else {
+               sexp = NULL;
        }
 
        success = ecc_search_internal (cal_cache, sexp, sexp_id, func, user_data, cancellable, error);


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