From 5a5c6d2604664478306b29b64bf876d7403b74bb Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 29 Jul 2011 18:01:38 +0200 Subject: Add "force" parameter to notify_check_next_app() This allows to force notify_check_next_app() to update the notification appointment, even if start times are equal (e.g. if the item description was changed). Signed-off-by: Lukas Fleischer --- src/recur.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/recur.c') diff --git a/src/recur.c b/src/recur.c index 430e543..b2980fc 100644 --- a/src/recur.c +++ b/src/recur.c @@ -811,7 +811,7 @@ recur_apoint_erase (long start, unsigned num, unsigned delete_whole, erase_note (&rapt->note, flag); mem_free (rapt); if (need_check_notify) - notify_check_next_app (); + notify_check_next_app (0); break; } } @@ -819,7 +819,7 @@ recur_apoint_erase (long start, unsigned num, unsigned delete_whole, { recur_add_exc (&rapt->exc, start); if (need_check_notify) - notify_check_next_app (); + notify_check_next_app (0); } LLIST_TS_UNLOCK (&recur_alist_p); } -- cgit v1.2.3-54-g00ecf From 0126cbd1b3fd1ee46ce3c6f01fef92761c2193c7 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 29 Jul 2011 18:26:58 +0200 Subject: Update the notification item in *_paste_item() Signed-off-by: Lukas Fleischer --- src/apoint.c | 4 ++++ src/recur.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/recur.c') diff --git a/src/apoint.c b/src/apoint.c index 8771426..859e807 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -729,5 +729,9 @@ apoint_paste_item (void) (void)apoint_new (bkp_cut_apoint.mesg, bkp_cut_apoint.note, bkp_start, bkp_cut_apoint.dur, bkp_cut_apoint.state); + + if (notify_bar ()) + notify_check_added (bkp_cut_apoint.mesg, bkp_start, bkp_cut_apoint.state); + apoint_free_bkp (ERASE_FORCE_KEEP_NOTE); } diff --git a/src/recur.c b/src/recur.c index b2980fc..50e2beb 100644 --- a/src/recur.c +++ b/src/recur.c @@ -1144,5 +1144,9 @@ recur_apoint_paste_item (void) bkp_cut_recur_apoint.rpt->freq, bkp_cut_recur_apoint.rpt->until, &bkp_cut_recur_apoint.exc); + + if (notify_bar ()) + notify_check_repeated (&bkp_cut_recur_apoint); + recur_apoint_free_bkp (ERASE_FORCE_KEEP_NOTE); } -- cgit v1.2.3-54-g00ecf From 1da88589b22ddd4b8525c09fe4519ce1067687cb Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 29 Jul 2011 19:05:18 +0200 Subject: Fix recurrent appointment notification We probably broke this in 9fab24818a119aef08b9726f6c1cd31d5434ce34. Signed-off-by: Lukas Fleischer --- src/recur.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/recur.c') diff --git a/src/recur.c b/src/recur.c index 50e2beb..caa5ec3 100644 --- a/src/recur.c +++ b/src/recur.c @@ -1004,9 +1004,9 @@ recur_exc_scan (llist_t *lexc, FILE *data_file) } static int -recur_apoint_starts_after (struct recur_apoint *rapt, long time) +recur_apoint_starts_before (struct recur_apoint *rapt, long time) { - return (rapt->start > time); + return (rapt->start < time); } /* @@ -1020,9 +1020,7 @@ recur_apoint_check_next (struct notify_app *app, long start, long day) long real_recur_start_time; LLIST_TS_LOCK (&recur_alist_p); - i = LLIST_TS_FIND_FIRST (&recur_alist_p, start, recur_apoint_starts_after); - - if (i) + LLIST_TS_FIND_FOREACH (&recur_alist_p, app->time, recur_apoint_starts_before, i) { struct recur_apoint *rapt = LLIST_TS_GET_DATA (i); @@ -1035,7 +1033,6 @@ recur_apoint_check_next (struct notify_app *app, long start, long day) app->got_app = 1; } } - LLIST_TS_UNLOCK (&recur_alist_p); return (app); -- cgit v1.2.3-54-g00ecf