projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2ce90f9
)
improve code (libnotify version checking)
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Mon, 7 Nov 2011 18:49:11 +0000
(18:49 +0000)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Mon, 7 Nov 2011 18:49:11 +0000
(18:49 +0000)
src/ui_notify.c
patch
|
blob
|
history
diff --git
a/src/ui_notify.c
b/src/ui_notify.c
index
57eb63a
..
693473b
100644
(file)
--- a/
src/ui_notify.c
+++ b/
src/ui_notify.c
@@
-22,6
+22,11
@@
#include <libnotify/notify.h>
#include <libnotify/notify.h>
+/* Macro defined since libnotify 0.5.2 */
+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
+
#include "ui.h"
#include "ui_notify.h"
#include "ui.h"
#include "ui_notify.h"
@@
-63,10
+68,7
@@
void ui_notify(struct psensor *sensor, struct ui_psensor *ui)
/*
* Since libnotify 0.7 notify_notification_new has
* only 3 parameters.
/*
* Since libnotify 0.7 notify_notification_new has
* only 3 parameters.
- *
- * NOTIFY_CHECK_VERSION exists since 0.5.2.
*/
*/
-#ifdef NOTIFY_CHECK_VERSION
#if NOTIFY_CHECK_VERSION(0, 7, 0)
notif = notify_notification_new(_("Temperature alert"),
name,
#if NOTIFY_CHECK_VERSION(0, 7, 0)
notif = notify_notification_new(_("Temperature alert"),
name,
@@
-77,12
+79,6
@@
void ui_notify(struct psensor *sensor, struct ui_psensor *ui)
NULL,
GTK_WIDGET(ui->main_window));
#endif
NULL,
GTK_WIDGET(ui->main_window));
#endif
-#else
- notif = notify_notification_new(_("Temperature alert"),
- name,
- NULL,
- GTK_WIDGET(ui->main_window));
-#endif
notify_notification_show(notif, NULL);
notify_notification_show(notif, NULL);