aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cal-model.c
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchenthill@novell.com>2010-09-08 22:03:39 +0800
committerChenthill Palanisamy <pchenthill@novell.com>2010-09-08 22:04:31 +0800
commit4124ba378b3128ee5f0cb85925559f5fb42cff67 (patch)
treeca11d4786412d86d07c06a2dab855bd68afa7e6d /calendar/gui/e-cal-model.c
parent86bd41c9c374b8b80ed4924d4cc1c3f6e196731a (diff)
downloadgsoc2013-evolution-4124ba378b3128ee5f0cb85925559f5fb42cff67.tar
gsoc2013-evolution-4124ba378b3128ee5f0cb85925559f5fb42cff67.tar.gz
gsoc2013-evolution-4124ba378b3128ee5f0cb85925559f5fb42cff67.tar.bz2
gsoc2013-evolution-4124ba378b3128ee5f0cb85925559f5fb42cff67.tar.lz
gsoc2013-evolution-4124ba378b3128ee5f0cb85925559f5fb42cff67.tar.xz
gsoc2013-evolution-4124ba378b3128ee5f0cb85925559f5fb42cff67.tar.zst
gsoc2013-evolution-4124ba378b3128ee5f0cb85925559f5fb42cff67.zip
Use the and operator only if there are two conditions
Diffstat (limited to 'calendar/gui/e-cal-model.c')
-rw-r--r--calendar/gui/e-cal-model.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index a48fc5d8ca..70d20c30b8 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -2333,11 +2333,18 @@ redo_queries (ECalModel *model)
iso_start = isodate_from_time_t (priv->start);
iso_end = isodate_from_time_t (priv->end);
- priv->full_sexp = g_strdup_printf ("(and (occur-in-time-range? (make-time \"%s\")"
- " (make-time \"%s\"))"
- " %s)",
- iso_start, iso_end,
- priv->search_sexp ? priv->search_sexp : "");
+ if (priv->search_sexp) {
+ priv->full_sexp = g_strdup_printf ("(and (occur-in-time-range? (make-time \"%s\")"
+ " (make-time \"%s\"))"
+ " %s)",
+ iso_start, iso_end,
+ priv->search_sexp ? priv->search_sexp : "");
+ } else {
+ priv->full_sexp = g_strdup_printf ("(occur-in-time-range? (make-time \"%s\")"
+ " (make-time \"%s\"))",
+ iso_start, iso_end);
+ }
+
g_free (iso_start);
g_free (iso_end);
} else if (priv->search_sexp) {