notify_thread_app rewritten
This commit is contained in:
parent
a0117296b4
commit
3c9d6c13cc
@ -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>
|
2009-08-02 Frederic Culot <frederic@culot.org>
|
||||||
|
|
||||||
* src/args.c: help on '--status' flag added
|
* src/args.c: help on '--status' flag added
|
||||||
|
19
src/notify.c
19
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
|
* Calcurse - text-based organizer
|
||||||
@ -426,21 +426,22 @@ notify_thread_app (void *arg)
|
|||||||
{
|
{
|
||||||
struct notify_app_s tmp_app;
|
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 (¬ify_app.mutex);
|
pthread_mutex_lock (¬ify_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
|
else
|
||||||
{
|
{
|
||||||
notify_free_app ();
|
if (!notify_same_item (tmp_app.time))
|
||||||
notify_app.got_app = 0;
|
notify_update_app (tmp_app.time, tmp_app.state, tmp_app.txt);
|
||||||
notify_app.txt = 0;
|
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock (¬ify_app.mutex);
|
pthread_mutex_unlock (¬ify_app.mutex);
|
||||||
|
|
||||||
if (tmp_app.txt != NULL)
|
if (tmp_app.txt)
|
||||||
mem_free (tmp_app.txt);
|
mem_free (tmp_app.txt);
|
||||||
notify_update_bar ();
|
notify_update_bar ();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user