aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify/config-data.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-10-05 19:57:30 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-10-05 19:57:30 +0800
commit4ec46cc05fcb94d181fb9c2412984a1446647c85 (patch)
treed16ce30e77dd539c03509237dd4c723d46aea97a /calendar/gui/alarm-notify/config-data.c
parent5ea7e23aef0c239af2600c95419ba0bda0f08b3c (diff)
parent19163c2b71e6128fc9b32287b99b1f4422324c2d (diff)
downloadgsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.tar.gz
gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.tar.zst
gsoc2013-evolution-4ec46cc05fcb94d181fb9c2412984a1446647c85.zip
Merge from master
Diffstat (limited to 'calendar/gui/alarm-notify/config-data.c')
-rw-r--r--calendar/gui/alarm-notify/config-data.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c
index aa8755973a..4f30a4e4f3 100644
--- a/calendar/gui/alarm-notify/config-data.c
+++ b/calendar/gui/alarm-notify/config-data.c
@@ -37,8 +37,6 @@ static GConfClient *conf_client = NULL;
static GSetting *calendar_settings = NULL;
static ESourceList *calendar_source_list = NULL, *tasks_source_list = NULL;
-
-
/* Copied from ../calendar-config.c; returns whether the locale has 'am' and
* 'pm' strings defined.
*/
@@ -261,16 +259,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;
- tmval.tv_sec = (glong) t;
- as_text = g_time_val_to_iso8601 (&tmval);
+ if (t > (time_t) curr_tv.tv_sec || (time_t) curr_tv.tv_sec > now) {
+ GTimeVal tmval = {0};
+ gchar *as_text;
- if (as_text) {
- e_source_set_property (source, "last-notified", as_text);
- g_free (as_text);
- return;
+ 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);
+ /* pass through, thus the global last notification time is also changed */
+ }
}
}
}
@@ -317,7 +324,6 @@ config_data_get_last_notification_time (ECalClient *cal)
value = g_settings_get_int (calendar_settings, "last-notification-time");
now = time (NULL);
-
if (val > now)
val = now;