aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2009-08-09 15:34:56 +0000
committerFrederic Culot <calcurse@culot.org>2009-08-09 15:34:56 +0000
commit3c9d6c13cc0d65d4d439288a11b5e683ac151db6 (patch)
treeda1201203ee5a6e3c03a1d3207da4bb690964f66
parenta0117296b4132f690ee17ecac307acef4a52229d (diff)
downloadcalcurse-3c9d6c13cc0d65d4d439288a11b5e683ac151db6.tar.gz
calcurse-3c9d6c13cc0d65d4d439288a11b5e683ac151db6.zip
notify_thread_app rewritten
-rwxr-xr-xChangeLog4
-rwxr-xr-xsrc/notify.c19
2 files changed, 14 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 712426a..524cde7 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-09 Frederic Culot <frederic@culot.org>
+
+ * src/notify.c (notify_thread_app): rewritten
+
2009-08-02 Frederic Culot <frederic@culot.org>
* src/args.c: help on '--status' flag added
diff --git a/src/notify.c b/src/notify.c
index 5b2ffe0..1d4eb51 100755
--- a/src/notify.c
+++ b/src/notify.c
@@ -1,4 +1,4 @@
-/* $calcurse: notify.c,v 1.44 2009/08/02 09:30:01 culot Exp $ */
+/* $calcurse: notify.c,v 1.45 2009/08/09 15:34:56 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -426,21 +426,22 @@ notify_thread_app (void *arg)
{
struct notify_app_s tmp_app;
- (void)notify_get_next (&tmp_app);
+ if (!notify_get_next (&tmp_app))
+ pthread_exit ((void *)0);
+
pthread_mutex_lock (&notify_app.mutex);
- if (tmp_app.got_app)
+ if (!tmp_app.got_app)
{
- notify_update_app (tmp_app.time, tmp_app.state, tmp_app.txt);
+ notify_free_app ();
}
else
{
- notify_free_app ();
- notify_app.got_app = 0;
- notify_app.txt = 0;
+ if (!notify_same_item (tmp_app.time))
+ notify_update_app (tmp_app.time, tmp_app.state, tmp_app.txt);
}
pthread_mutex_unlock (&notify_app.mutex);
-
- if (tmp_app.txt != NULL)
+
+ if (tmp_app.txt)
mem_free (tmp_app.txt);
notify_update_bar ();