X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.c;h=88440010b3f4e968023dbdf51a5817ead83259ee;hb=43a370feaf206521795b2549b571db5f29b8cf61;hp=18c46eb7b53fb78ba2a2de484fc00fe32df79c80;hpb=167125d68b308962e88efc20081fdab9f442bedd;p=ptask.git diff --git a/src/main.c b/src/main.c index 18c46eb..8844001 100644 --- a/src/main.c +++ b/src/main.c @@ -24,6 +24,7 @@ #include +#include "note.h" #include "tw.h" static struct task **tasks; @@ -171,17 +172,16 @@ static int tasksave_clicked_cbk(GtkButton *btn, gpointer data) printf("tasksave_clicked_cbk %d\n", task->id); - if (task->note) { - buf = gtk_text_view_get_buffer(w_note); - - gtk_text_buffer_get_iter_at_offset(buf, &sIter, 0); - gtk_text_buffer_get_iter_at_offset(buf, &eIter, -1); - txt = gtk_text_buffer_get_text(buf, &sIter, &eIter, TRUE); - - txt = escape(txt); + buf = gtk_text_view_get_buffer(w_note); - printf("%s\n", txt); - } + gtk_text_buffer_get_iter_at_offset(buf, &sIter, 0); + gtk_text_buffer_get_iter_at_offset(buf, &eIter, -1); + txt = gtk_text_buffer_get_text(buf, &sIter, &eIter, TRUE); + + printf("note=%s\n", txt); + + if (!task->note || strcmp(txt, task->note)) + note_put(task->uuid, txt); ctxt = gtk_entry_get_text(w_description); if (!task->description || strcmp(ctxt, task->description))