From 6c7edfbb862b1598b74e4413121dfa42e3a79211 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 2 Sep 2011 11:52:26 +0200 Subject: Do not unlink() note files on note removal Now that we use hash-based note file names, note files should never be unlinked as a note file might be shared. Also, remove the ERASE_FORCE_KEEP_NOTE flag that no longer makes any sense. Signed-off-by: Lukas Fleischer --- src/apoint.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/apoint.c') diff --git a/src/apoint.c b/src/apoint.c index 6fd9e64..a49b156 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -46,21 +46,21 @@ static struct apoint bkp_cut_apoint; static int hilt; void -apoint_free_bkp (enum eraseflg flag) +apoint_free_bkp (void) { if (bkp_cut_apoint.mesg) { mem_free (bkp_cut_apoint.mesg); bkp_cut_apoint.mesg = 0; } - erase_note (&bkp_cut_apoint.note, flag); + erase_note (&bkp_cut_apoint.note); } static void apoint_free (struct apoint *apt) { mem_free (apt->mesg); - erase_note (&apt->note, ERASE_FORCE_KEEP_NOTE); + erase_note (&apt->note); mem_free (apt); } @@ -500,20 +500,18 @@ apoint_delete_bynum (long start, unsigned num, enum eraseflg flag) switch (flag) { case ERASE_FORCE_ONLY_NOTE: - erase_note (&apt->note, flag); + erase_note (&apt->note); break; case ERASE_CUT: - apoint_free_bkp (ERASE_FORCE); + apoint_free_bkp (); apoint_dup (apt, &bkp_cut_apoint); - erase_note (&apt->note, ERASE_FORCE_KEEP_NOTE); + erase_note (&apt->note); /* FALLTHROUGH */ default: if (notify_bar ()) need_check_notify = notify_same_item (apt->start); LLIST_TS_REMOVE (&alist_p, i); mem_free (apt->mesg); - if (flag != ERASE_FORCE_KEEP_NOTE && flag != ERASE_CUT) - erase_note (&apt->note, flag); mem_free (apt); if (need_check_notify) notify_check_next_app (0); @@ -733,5 +731,5 @@ apoint_paste_item (void) if (notify_bar ()) notify_check_added (bkp_cut_apoint.mesg, bkp_start, bkp_cut_apoint.state); - apoint_free_bkp (ERASE_FORCE_KEEP_NOTE); + apoint_free_bkp (); } -- cgit v1.2.3-54-g00ecf