[Xfce4-commits] <orage:master> 4.8.0.5: Fix BUG 7204: orage-4.8.0 fails to compile with libnotify-0.7 API

Juha Kautto noreply at xfce.org
Sun Jan 30 08:56:01 CET 2011


Updating branch refs/heads/master
         to bfa601ba135f84163eded2bb2e060e21d9ca08ce (commit)
       from 3f8833c836991b8e2707f8035918ff7d7e630841 (commit)

commit bfa601ba135f84163eded2bb2e060e21d9ca08ce
Author: Juha Kautto <juha at xfce.org>
Date:   Sun Jan 30 09:52:54 2011 +0200

    4.8.0.5: Fix BUG 7204: orage-4.8.0 fails to compile with libnotify-0.7 API
    
    libnotify was changed quite a lot in version 0.7.0. Making Orage compatible
    with it.

 configure.in.in |    2 +-
 src/reminder.c  |   15 ++++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 9a2e92d..fac4e9a 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
 dnl
 
 dnl Version information
-m4_define([orage_version], [4.8.0.4-git])
+m4_define([orage_version], [4.8.0.5-git])
 
 m4_define([gtk_minimum_version], [2.10.0])
 m4_define([xfce_minimum_version], [4.6.0])
diff --git a/src/reminder.c b/src/reminder.c
index fb9ff23..fccef05 100644
--- a/src/reminder.c
+++ b/src/reminder.c
@@ -60,6 +60,12 @@
 #define ORAGE_DEBUG 1
 */
 
+/* Compatibility macro for < libnotify-0.7 */
+/* NOTIFY_CHECK_VERSION was created in 0.5.2 */
+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
+
 typedef struct _orage_ddmmhh_hbox
 {
     GtkWidget *time_hbox
@@ -557,12 +563,19 @@ static void create_notify_reminder(alarm_struct *l_alarm)
         g_strlcat(heading, l_alarm->action_time, 90);
         g_strlcat(heading, "<\b>", 10);
     }
+    /* since version 0.7.0, libnotify does not have the widget parameter in 
+       notify_notification_new and it does not have function
+       notify_notification_attach_to_status_icon at all */
+#if NOTIFY_CHECK_VERSION(0, 7, 0)
+    n = notify_notification_new(heading, l_alarm->description, NULL);
+#else
     n = notify_notification_new(heading, l_alarm->description, NULL, NULL);
-    l_alarm->active_alarm->active_notify = n;
     if (g_par.trayIcon 
     && gtk_status_icon_is_embedded((GtkStatusIcon *)g_par.trayIcon))
         notify_notification_attach_to_status_icon(n
                 , (GtkStatusIcon *)g_par.trayIcon);
+#endif
+    l_alarm->active_alarm->active_notify = n;
 
     if (l_alarm->notify_timeout == -1)
         notify_notification_set_timeout(n, NOTIFY_EXPIRES_NEVER);



More information about the Xfce4-commits mailing list