diff options
author | Damon Chaplin <damon@ximian.com> | 2001-01-25 11:51:43 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-01-25 11:51:43 +0800 |
commit | bf64278f45cb952f9254a364beee6757f65bea3d (patch) | |
tree | f3de916635533b84ff8a2e83b3f51267447f52ad /calendar/gui | |
parent | 9e60ca1bb2c10e5f299714b1fde83d1d8da73a04 (diff) | |
download | gsoc2013-evolution-bf64278f45cb952f9254a364beee6757f65bea3d.tar.gz gsoc2013-evolution-bf64278f45cb952f9254a364beee6757f65bea3d.tar.zst gsoc2013-evolution-bf64278f45cb952f9254a364beee6757f65bea3d.zip |
don't tag the calendar if no dates are shown.
2001-01-25 Damon Chaplin <damon@ximian.com>
* gui/tag-calendar.c: don't tag the calendar if no dates are shown.
(e_calendar_item_get_date_range() now returns FALSE in this case.)
svn path=/trunk/; revision=7800
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/tag-calendar.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c index 1a45d7fa85..12cc264f1c 100644 --- a/calendar/gui/tag-calendar.c +++ b/calendar/gui/tag-calendar.c @@ -37,8 +37,9 @@ struct calendar_tag_closure { /* Clears all the tags in a calendar and fills a closure structure with the * necessary information for iterating over occurrences. + * Returns FALSE if the calendar has no dates shown. */ -static void +static gboolean prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c) { gint start_year, start_month, start_day; @@ -47,9 +48,11 @@ prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c) e_calendar_item_clear_marks (ecal->calitem); - e_calendar_item_get_date_range (ecal->calitem, - &start_year, &start_month, &start_day, - &end_year, &end_month, &end_day); + if (!e_calendar_item_get_date_range (ecal->calitem, + &start_year, &start_month, + &start_day, + &end_year, &end_month, &end_day)) + return FALSE; start_tm.tm_year = start_year - 1900; start_tm.tm_mon = start_month; @@ -70,6 +73,8 @@ prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c) c->calitem = ecal->calitem; c->start_time = mktime (&start_tm); c->end_time = mktime (&end_tm); + + return TRUE; } /* Marks the specified range in an ECalendar; called from cal_client_generate_instances() */ @@ -124,7 +129,8 @@ tag_calendar_by_client (ECalendar *ecal, CalClient *client) if (cal_client_get_load_state (client) != CAL_CLIENT_LOAD_LOADED) return; - prepare_tag (ecal, &c); + if (!prepare_tag (ecal, &c)) + return; #if 0 g_print ("DateNavigator generating instances\n"); @@ -156,7 +162,9 @@ tag_calendar_by_comp (ECalendar *ecal, CalComponent *comp) if (!GTK_WIDGET_VISIBLE (ecal)) return; - prepare_tag (ecal, &c); + if (!prepare_tag (ecal, &c)) + return; + #if 0 g_print ("DateNavigator generating instances\n"); #endif |