aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-02 15:49:03 -0600
committerTed Gould <ted@gould.cx>2011-03-02 15:49:03 -0600
commitc11d4e2486832419d1d89f798eb71ce4c1c6a092 (patch)
tree2fae6d531f4856d67c9ca097190a347ab7b94503
parentb79665734363a3644d3eb7b13a110908ac05d3a1 (diff)
parent2de6f443b603965a7fc786df9ef58fcc63841daf (diff)
downloadayatana-indicator-datetime-c11d4e2486832419d1d89f798eb71ce4c1c6a092.tar.gz
ayatana-indicator-datetime-c11d4e2486832419d1d89f798eb71ce4c1c6a092.tar.bz2
ayatana-indicator-datetime-c11d4e2486832419d1d89f798eb71ce4c1c6a092.zip
Use the query language to specify the dates instead of building them ourselves
-rw-r--r--src/datetime-service.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 6303a98..078ede0 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -462,8 +462,7 @@ update_appointment_menu_items (gpointer user_data) {
if (calendar == NULL) return FALSE;
if (!g_settings_get_boolean(conf, SETTINGS_SHOW_EVENTS_S)) return FALSE;
- time_t t1, t2;
- gchar *query, *is, *ie, *ad;
+ gchar *query, *ad;
GList *objects = NULL, *l;
GList *allobjects = NULL;
GSList *g;
@@ -472,13 +471,6 @@ update_appointment_menu_items (gpointer user_data) {
gint width, height;
ESourceList * sources = NULL;
- time(&t1);
- time(&t2);
- t2 += (time_t) (7 * 24 * 60 * 60); /* 7 days ahead of now */
-
- is = isodate_from_time_t(t1);
- ie = isodate_from_time_t(t2);
-
gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
/* Remove all of the previous appointments */
@@ -497,7 +489,7 @@ update_appointment_menu_items (gpointer user_data) {
// TODO Remove all highlights from the calendar widget
// FIXME can we put a limit on the number of results? Or if not complete, or is event/todo? Or sort it by date?
- query = g_strdup_printf("(occur-in-time-range? (make-time\"%s\") (make-time\"%s\"))", is, ie);
+ query = g_strdup_printf("(occur-in-time-range? (time-now) (time-add-day (time-now) 7))");
if (!e_cal_get_sources(&sources, E_CAL_SOURCE_TYPE_EVENT, &gerror)) {
g_debug("Failed to get ecal sources\n");