summaryrefslogtreecommitdiff
path: root/src/ui-day.c
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-02-16 07:55:19 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2016-02-16 07:55:19 +0100
commit8c32812fe1b08d819cb62727dbe8f00d5afbba10 (patch)
tree739c3f39a873edcb2b5c7ae2410d18dedd002e25 /src/ui-day.c
parent65b699f7708eba7c504d8593be749fa4e0cd57c3 (diff)
downloadcalcurse-8c32812fe1b08d819cb62727dbe8f00d5afbba10.zip
ui-day.c: Simplify code using ui_day_selitem()
Use the new ui_day_selitem() utility function to retrieve the currently selected item. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/ui-day.c')
-rw-r--r--src/ui-day.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ui-day.c b/src/ui-day.c
index 4b004f7..f424563 100644
--- a/src/ui-day.c
+++ b/src/ui-day.c
@@ -315,7 +315,7 @@ void ui_day_item_edit(void)
if (day_item_count(0) <= 0)
return;
- struct day_item *p = day_get_item(listbox_get_sel(&lb_apt));
+ struct day_item *p = ui_day_selitem();
switch (p->type) {
case RECUR_EVNT:
@@ -441,7 +441,7 @@ void ui_day_item_pipe(void)
if (day_item_count(0) <= 0)
return;
- struct day_item *p = day_get_item(listbox_get_sel(&lb_apt));
+ struct day_item *p = ui_day_selitem();
status_mesg(_("Pipe item to external command:"), "");
if (getstring(win[STA].p, cmd, BUFSIZ, 0, 1) != GETSTRING_VALID)
@@ -605,7 +605,7 @@ void ui_day_item_delete(unsigned reg)
if (day_item_count(0) <= 0)
return;
- struct day_item *p = day_get_item(listbox_get_sel(&lb_apt));
+ struct day_item *p = ui_day_selitem();
if (conf.confirm_delete) {
if (status_ask_bool(del_app_str) != 1) {
@@ -834,7 +834,7 @@ void ui_day_item_copy(unsigned reg)
if (day_item_count(0) <= 0 || reg == REG_BLACK_HOLE)
return;
- struct day_item *item = day_get_item(listbox_get_sel(&lb_apt));
+ struct day_item *item = ui_day_selitem();
ui_day_item_cut_free(reg);
day_item_fork(item, &day_cut[reg]);
}
@@ -929,7 +929,7 @@ void ui_day_popup_item(void)
if (day_item_count(0) <= 0)
return;
- struct day_item *item = day_get_item(listbox_get_sel(&lb_apt));
+ struct day_item *item = ui_day_selitem();
day_popup_item(item);
}
@@ -938,7 +938,7 @@ void ui_day_flag(void)
if (day_item_count(0) <= 0)
return;
- struct day_item *item = day_get_item(listbox_get_sel(&lb_apt));
+ struct day_item *item = ui_day_selitem();
day_item_switch_notify(item);
io_set_modified();
}
@@ -948,7 +948,7 @@ void ui_day_view_note(void)
if (day_item_count(0) <= 0)
return;
- struct day_item *item = day_get_item(listbox_get_sel(&lb_apt));
+ struct day_item *item = ui_day_selitem();
day_view_note(item, conf.pager);
}
@@ -957,7 +957,7 @@ void ui_day_edit_note(void)
if (day_item_count(0) <= 0)
return;
- struct day_item *item = day_get_item(listbox_get_sel(&lb_apt));
+ struct day_item *item = ui_day_selitem();
day_edit_note(item, conf.editor);
io_set_modified();
}