summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2008-12-15 20:02:00 +0000
committerFrederic Culot <calcurse@culot.org>2008-12-15 20:02:00 +0000
commitb1d3178bba66089726e6f93a49af97371bdf5db8 (patch)
tree1a1bb5ea6c9c4147c6358b2929210e163684b28d /src
parent8220580918078bebcd339fdc7492ab28223552b4 (diff)
downloadcalcurse-b1d3178bba66089726e6f93a49af97371bdf5db8.tar.gz
calcurse-b1d3178bba66089726e6f93a49af97371bdf5db8.zip
small bugfixes and a major one (freeze when deleting an appointment's note, thanks Jan for reporting it)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/apoint.c11
-rwxr-xr-xsrc/day.c12
-rwxr-xr-xsrc/keys.c4
-rwxr-xr-xsrc/todo.c6
-rwxr-xr-xsrc/utils.c4
5 files changed, 21 insertions, 16 deletions
diff --git a/src/apoint.c b/src/apoint.c
index 1b067ba..75b2235 100755
--- a/src/apoint.c
+++ b/src/apoint.c
@@ -1,4 +1,4 @@
-/* $calcurse: apoint.c,v 1.27 2008/12/14 15:54:51 culot Exp $ */
+/* $calcurse: apoint.c,v 1.28 2008/12/15 20:02:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -269,9 +269,7 @@ apoint_delete (conf_t *conf, unsigned *nb_events, unsigned *nb_apoints)
to_be_removed = 3;
}
else if (deleted_item_type == 0)
- {
- to_be_removed = 0;
- }
+ return;
else
EXIT (_("no such type"));
/* NOTREACHED */
@@ -425,7 +423,10 @@ apoint_delete_bynum (long start, unsigned num, erase_flag_e flag)
if (n == num)
{
if (flag == ERASE_FORCE_ONLY_NOTE)
- erase_note (&i->note, flag);
+ {
+ erase_note (&i->note, flag);
+ pthread_mutex_unlock (&(alist_p->mutex));
+ }
else
{
if (notify_bar ())
diff --git a/src/day.c b/src/day.c
index c727cf2..884fd3b 100755
--- a/src/day.c
+++ b/src/day.c
@@ -1,4 +1,4 @@
-/* $calcurse: day.c,v 1.41 2008/12/12 20:44:50 culot Exp $ */
+/* $calcurse: day.c,v 1.42 2008/12/15 20:02:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -728,7 +728,7 @@ day_edit_item (conf_t *conf)
p = day_get_item (item_num);
date = calendar_get_slctd_day_sec ();
- ch = 0;
+ ch = -1;
switch (p->type)
{
case RECUR_EVNT:
@@ -819,9 +819,10 @@ day_erase_item (long date, int item_number, erase_flag_e flag)
"Delete (i)tem or just its (n)ote ?");
char *note_choice = _("[i/n] ");
char *erase_choice = _("[a/o] ");
- int ch = 0, ans;
+ int ch, ans;
unsigned delete_whole;
+ ch = -1;
p = day_get_item (item_number);
if (flag == ERASE_DONT_FORCE)
{
@@ -877,7 +878,10 @@ day_erase_item (long date, int item_number, erase_flag_e flag)
recur_apoint_erase (date, p->appt_pos, delete_whole, flag);
}
}
- return (p->type);
+ if (flag == ERASE_FORCE_ONLY_NOTE)
+ return 0;
+ else
+ return (p->type);
}
/* Returns a structure containing the selected item. */
diff --git a/src/keys.c b/src/keys.c
index 57fac95..790a03a 100755
--- a/src/keys.c
+++ b/src/keys.c
@@ -1,4 +1,4 @@
-/* $calcurse: keys.c,v 1.9 2008/12/12 20:44:50 culot Exp $ */
+/* $calcurse: keys.c,v 1.10 2008/12/15 20:02:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -49,7 +49,7 @@ static struct key_str_s *keys[NBKEYS];
static keys_e actions[MAXKEYVAL];
static struct keydef_s keydef[NBKEYS] = {
- {"generic-escape", "ESC"},
+ {"generic-cancel", "ESC"},
{"generic-select", "SPC"},
{"generic-credits", "@"},
{"generic-help", "?"},
diff --git a/src/todo.c b/src/todo.c
index 16c9a79..68d5eb5 100755
--- a/src/todo.c
+++ b/src/todo.c
@@ -1,4 +1,4 @@
-/* $calcurse: todo.c,v 1.27 2008/12/12 20:44:50 culot Exp $ */
+/* $calcurse: todo.c,v 1.28 2008/12/15 20:02:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -239,7 +239,7 @@ todo_delete (conf_t *conf)
"Delete (t)odo or just its (n)ote ?");
char *erase_choice = _("[t/n] ");
bool go_for_todo_del = false;
- int answer = 0, has_note;
+ int answer, has_note;
if (conf->confirm_delete)
{
@@ -264,7 +264,7 @@ todo_delete (conf_t *conf)
return;
}
- answer = 0;
+ answer = -1;
has_note = (todo_get_item (hilt)->note != NULL) ? 1 : 0;
if (has_note == 0)
answer = 't';
diff --git a/src/utils.c b/src/utils.c
index 147229e..f4d82fe 100755
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,4 +1,4 @@
-/* $calcurse: utils.c,v 1.59 2008/12/14 15:54:51 culot Exp $ */
+/* $calcurse: utils.c,v 1.60 2008/12/15 20:02:00 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -329,7 +329,7 @@ getstring (WINDOW *win, char *str, int l, int x, int y)
newpos++;
break;
- case KEY_GENERIC_CANCEL: /* cancel editing */
+ case ESCAPE: /* cancel editing */
return (GETSTRING_ESC);
break;