aboutsummaryrefslogtreecommitdiffstats
path: root/src/apoint.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-06-27 08:02:30 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-06-30 14:34:36 +0200
commit47d5fe2d45688c376a9646e798ca564e6bb4a6b6 (patch)
treec48a55edb3b8d97a88c21f53264a26617a1100f0 /src/apoint.c
parent44d3c96828a856b67f87411e4cf8c933677f6d01 (diff)
downloadcalcurse-47d5fe2d45688c376a9646e798ca564e6bb4a6b6.tar.gz
calcurse-47d5fe2d45688c376a9646e798ca564e6bb4a6b6.zip
Move apoint_{cut,paste}() to interaction unit
These functions get the current selection, call day_*_item() and fix the current selection on the appointment panel, so move them where they belong. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/apoint.c')
-rw-r--r--src/apoint.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/apoint.c b/src/apoint.c
index e6e02c4..ce872df 100644
--- a/src/apoint.c
+++ b/src/apoint.c
@@ -135,57 +135,6 @@ struct apoint *apoint_new(char *mesg, char *note, long start, long dur,
return apt;
}
-/* Cut an item, so that it can be pasted somewhere else later. */
-int apoint_cut(unsigned *nb_events, unsigned *nb_apoints)
-{
- const int NBITEMS = *nb_apoints + *nb_events;
- int item_type, to_be_removed;
- long date;
-
- if (NBITEMS == 0)
- return 0;
-
- date = calendar_get_slctd_day_sec();
- item_type = day_cut_item(date, hilt);
- if (item_type == EVNT || item_type == RECUR_EVNT) {
- (*nb_events)--;
- to_be_removed = 1;
- } else if (item_type == APPT || item_type == RECUR_APPT) {
- (*nb_apoints)--;
- to_be_removed = 3;
- } else
- EXIT(_("no such type"));
- /* NOTREACHED */
-
- if (hilt > 1)
- hilt--;
- if (apad.first_onscreen >= to_be_removed)
- apad.first_onscreen = apad.first_onscreen - to_be_removed;
- if (NBITEMS == 1)
- hilt = 0;
-
- return item_type;
-}
-
-/* Paste a previously cut item. */
-void apoint_paste(unsigned *nb_events, unsigned *nb_apoints, int cut_item_type)
-{
- int item_type;
- long date;
-
- date = calendar_get_slctd_day_sec();
- item_type = day_paste_item(date, cut_item_type);
- if (item_type == EVNT || item_type == RECUR_EVNT)
- (*nb_events)++;
- else if (item_type == APPT || item_type == RECUR_APPT)
- (*nb_apoints)++;
- else
- return;
-
- if (hilt == 0)
- hilt++;
-}
-
unsigned apoint_inday(struct apoint *i, long *start)
{
return (i->start <= *start + DAYINSEC && i->start + i->dur > *start);