diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-07-09 10:53:16 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-07-09 10:53:16 +0800 |
commit | a739c97352e5adb183c85e333f762fc3006b2031 (patch) | |
tree | ec7ed9af95e6b983b16f58798c7dad507a8544bf | |
parent | 0006ecd24503b6c2f7e0ea3941c86ca841cc9263 (diff) | |
download | gsoc2013-evolution-a739c97352e5adb183c85e333f762fc3006b2031.tar.gz gsoc2013-evolution-a739c97352e5adb183c85e333f762fc3006b2031.tar.zst gsoc2013-evolution-a739c97352e5adb183c85e333f762fc3006b2031.zip |
** Fix for bug #234294
svn path=/trunk/; revision=33774
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/cancel-comp.c | 26 |
2 files changed, 34 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index df6d9bb77b..d345d3c0a6 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2007-06-27 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #234294 + + * gui/dialogs/cancel-comp.c: (is_past_event): New helper function. + * gui/dialogs/cancel-comp.c: (cancel_component_dialog): + Returns FALSE to EVENTs in the past, based on date, not time part. + 2007-07-09 Milan Crha <mcrha@redhat.com> ** Fix for bug #300584 diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c index de06b835ec..56547d52c1 100644 --- a/calendar/gui/dialogs/cancel-comp.c +++ b/calendar/gui/dialogs/cancel-comp.c @@ -32,6 +32,28 @@ +/* is_past_event: + * + * returns TRUE if @comp is in the past, FALSE otherwise. + * Comparision is based only on date part, time part is ignored. + */ +static gboolean +is_past_event (ECalComponent *comp) +{ + ECalComponentDateTime end_date; + gboolean res; + + if (!comp) return TRUE; + + e_cal_component_get_dtend (comp, &end_date); + res = icaltime_compare_date_only (*end_date.value, + icaltime_current_time_with_zone (icaltime_get_timezone (*end_date.value)) + ) == -1; + e_cal_component_free_datetime (&end_date); + + return res; +} + /** * cancel_component_dialog: * @@ -53,6 +75,10 @@ cancel_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, g switch (vtype) { case E_CAL_COMPONENT_EVENT: + if (is_past_event (comp)) { + /* don't ask neither send notification to others on past events */ + return FALSE; + } if (deleting) id = "calendar:prompt-cancel-meeting"; else |