summaryrefslogtreecommitdiff
blob: 5026e724a8f26cd37f919e85054e9ef69bc52761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- libtwnotification/main.cpp
+++ libtwnotification/main.cpp
@@ -2,6 +2,10 @@
 #include <iostream>
 #include <libnotify/notify.h>
 
+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
+
 using namespace std;
 
 int main(int argv, char* argc[])
@@ -9,7 +13,12 @@
     cout << "HOLA" << endl;
     notify_init("Twittaré");
 
-    NotifyNotification* nots = notify_notification_new("New twitt", "Tabaré Caorsi:\nEsto es un twit de prueba", "", 0);
+    NotifyNotification* nots = notify_notification_new("New twitt", "Tabaré Caorsi:\nEsto es un twit de prueba", ""
+#if NOTIFY_CHECK_VERSION (0, 7, 0)
+    );
+#else
+    , 0);
+#endif
     GError* error = 0;
     notify_notification_show(nots, &error);
 
--- libtwnotification/twnotification.cpp
+++ libtwnotification/twnotification.cpp
@@ -1,6 +1,10 @@
 #include "twnotification.h"
 #include <libnotify/notify.h>
 
+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
+
 TwNotification::TwNotification()
 {
         notify_init("Twittaré");
@@ -8,7 +12,12 @@
 
 void TwNotification::notify(const char * title, const char * text, const char * icon)
 {
-    NotifyNotification* nots = notify_notification_new(title, text, icon, 0);
+    NotifyNotification* nots = notify_notification_new(title, text, icon
+#if NOTIFY_CHECK_VERSION (0, 7, 0)
+    );
+#else
+    , 0);
+#endif
     GError* error = 0;
     notify_notification_show(nots, &error);
 }