aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-09-29 20:29:17 +0800
committerMilan Crha <mcrha@redhat.com>2011-09-29 20:29:17 +0800
commit14f152070d536316d3ae627e4455318e056189d6 (patch)
tree56add06187c1464955069374f9ade5af5f8aa16e /calendar/gui
parent2208edefe8a8072cd27ab0f9ae4a3e2de1c40064 (diff)
downloadgsoc2013-evolution-14f152070d536316d3ae627e4455318e056189d6.tar.gz
gsoc2013-evolution-14f152070d536316d3ae627e4455318e056189d6.tar.zst
gsoc2013-evolution-14f152070d536316d3ae627e4455318e056189d6.zip
Bug #659517 - Calendar reminds of old events following upgrade
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/alarm-notify/config-data.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c
index d056131280..b68268635d 100644
--- a/calendar/gui/alarm-notify/config-data.c
+++ b/calendar/gui/alarm-notify/config-data.c
@@ -270,16 +270,25 @@ config_data_set_last_notification_time (ECalClient *cal,
if (cal) {
ESource *source = e_client_get_source (E_CLIENT (cal));
if (source) {
- GTimeVal tmval = {0};
- gchar *as_text;
+ const gchar *prop_str;
+ GTimeVal curr_tv = {0};
+
+ prop_str = e_source_get_property (source, "last-notified");
+ if (!prop_str || !g_time_val_from_iso8601 (prop_str, &curr_tv))
+ curr_tv.tv_sec = 0;
+
+ if (t > (time_t) curr_tv.tv_sec || (time_t) curr_tv.tv_sec > now) {
+ GTimeVal tmval = {0};
+ gchar *as_text;
- tmval.tv_sec = (glong) t;
- as_text = g_time_val_to_iso8601 (&tmval);
+ tmval.tv_sec = (glong) t;
+ as_text = g_time_val_to_iso8601 (&tmval);
- if (as_text) {
- e_source_set_property (source, "last-notified", as_text);
- g_free (as_text);
- return;
+ if (as_text) {
+ e_source_set_property (source, "last-notified", as_text);
+ g_free (as_text);
+ /* pass through, thus the global last notification time is also changed */
+ }
}
}
}