src/todo.c: Remove several unneeded variables
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
dfe835190f
commit
a01cbe0c36
27
src/todo.c
27
src/todo.c
@ -248,27 +248,19 @@ todo_delete (void)
|
|||||||
_("This item has a note attached to it. "
|
_("This item has a note attached to it. "
|
||||||
"Delete (t)odo or just its (n)ote ?");
|
"Delete (t)odo or just its (n)ote ?");
|
||||||
char *erase_choice = _("[t/n] ");
|
char *erase_choice = _("[t/n] ");
|
||||||
unsigned go_for_todo_del = 0;
|
|
||||||
int answer, has_note;
|
int answer, has_note;
|
||||||
|
|
||||||
if (conf.confirm_delete)
|
if (conf.confirm_delete)
|
||||||
{
|
{
|
||||||
status_mesg (del_todo_str, choices);
|
status_mesg (del_todo_str, choices);
|
||||||
answer = wgetch (win[STA].p);
|
answer = wgetch (win[STA].p);
|
||||||
if ((answer == 'y') && (todos > 0))
|
if ((answer != 'y') || (todos <= 0))
|
||||||
{
|
|
||||||
go_for_todo_del = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
wins_erase_status_bar ();
|
wins_erase_status_bar ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (todos > 0)
|
else if (todos <= 0)
|
||||||
go_for_todo_del = 1;
|
|
||||||
|
|
||||||
if (go_for_todo_del == 0)
|
|
||||||
{
|
{
|
||||||
wins_erase_status_bar ();
|
wins_erase_status_bar ();
|
||||||
return;
|
return;
|
||||||
@ -335,7 +327,6 @@ todo_chg_priority (int action)
|
|||||||
char backup_mesg[BUFSIZ];
|
char backup_mesg[BUFSIZ];
|
||||||
int backup_id;
|
int backup_id;
|
||||||
char backup_note[MAX_NOTESIZ + 1];
|
char backup_note[MAX_NOTESIZ + 1];
|
||||||
int do_chg = 1;
|
|
||||||
|
|
||||||
backup = todo_get_item (hilt);
|
backup = todo_get_item (hilt);
|
||||||
strncpy (backup_mesg, backup->mesg, strlen (backup->mesg) + 1);
|
strncpy (backup_mesg, backup->mesg, strlen (backup->mesg) + 1);
|
||||||
@ -347,21 +338,25 @@ todo_chg_priority (int action)
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case KEY_RAISE_PRIORITY:
|
case KEY_RAISE_PRIORITY:
|
||||||
(backup_id > 1) ? backup_id-- : do_chg--;
|
if (backup_id > 1)
|
||||||
|
backup_id--;
|
||||||
|
else
|
||||||
|
return;
|
||||||
break;
|
break;
|
||||||
case KEY_LOWER_PRIORITY:
|
case KEY_LOWER_PRIORITY:
|
||||||
(backup_id > 0 && backup_id < 9) ? backup_id++ : do_chg--;
|
if (backup_id > 0 && backup_id < 9)
|
||||||
|
backup_id++;
|
||||||
|
else
|
||||||
|
return;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
EXIT (_("no such action"));
|
EXIT (_("no such action"));
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
if (do_chg)
|
|
||||||
{
|
|
||||||
todo_delete_bynum (hilt - 1);
|
todo_delete_bynum (hilt - 1);
|
||||||
backup = todo_add (backup_mesg, backup_id, backup_note);
|
backup = todo_add (backup_mesg, backup_id, backup_note);
|
||||||
hilt = todo_get_position (backup);
|
hilt = todo_get_position (backup);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Edit the description of an already existing todo item. */
|
/* Edit the description of an already existing todo item. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user