diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-26 13:54:52 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-06-30 14:34:35 +0200 |
commit | 318e685ffe73587a01049d92aa0f60a46c1cfb16 (patch) | |
tree | 3e523f07c69b3ffb20fa94f888dd98e4d2ea3eaa /src/day.c | |
parent | 02c90ba53a658686bad5cb5f88c555d9eef06399 (diff) | |
download | calcurse-318e685ffe73587a01049d92aa0f60a46c1cfb16.zip |
Add an item parameter to various day_*() functions
These functions operate on arbitrary items. Pull out the code that gets
the currently selected item, get the current selection when one of the
functions is called and pass it as a parameter.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/day.c')
-rw-r--r-- | src/day.c | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -480,10 +480,8 @@ void day_write_stdout(long date, const char *fmt_apt, const char *fmt_rapt, } /* Display an item inside a popup window. */ -void day_popup_item(void) +void day_popup_item(struct day_item *day) { - struct day_item *day = day_get_item(apoint_hilt()); - if (day->type == EVNT || day->type == RECUR_EVNT) { item_in_popup(NULL, NULL, day_item_get_mesg(day), _("Event :")); } else if (day->type == APPT || day->type == RECUR_APPT) { @@ -681,12 +679,10 @@ int day_item_nb(long date, int day_num, int type) } /* Attach a note to an appointment or event. */ -void day_edit_note(const char *editor) +void day_edit_note(struct day_item *p, const char *editor) { - struct day_item *p; char *note; - p = day_get_item(apoint_hilt()); note = day_item_get_note(p); edit_note(¬e, editor); @@ -707,17 +703,14 @@ void day_edit_note(const char *editor) } /* View a note previously attached to an appointment or event */ -void day_view_note(const char *pager) +void day_view_note(struct day_item *p, const char *pager) { - struct day_item *p = day_get_item(apoint_hilt()); view_note(day_item_get_note(p), pager); } /* Switch notification state for an item. */ -void day_item_switch_notify(void) +void day_item_switch_notify(struct day_item *p) { - struct day_item *p = day_get_item(apoint_hilt()); - switch (p->type) { case RECUR_APPT: recur_apoint_switch_notify(p->item.rapt); |