[krb5-auth-dialog] Check for notify_notification_new_with_status_icon



commit 3dabce3c1cd248bfb8799c6a60cb3bda0bf97e06
Author: Guido Günther <agx sigxcpu org>
Date:   Mon Nov 1 17:35:31 2010 +0100

    Check for notify_notification_new_with_status_icon
    
    to fix build with recent libnotify (>= 0.7). We keep the old code for
    the GTK+2 build.

 configure.ac    |    9 +++++++++
 src/ka-applet.c |    4 ++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 14fb2a6..8a02673 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,6 +211,15 @@ AM_CONDITIONAL(HAVE_LIBNOTIFY, [test "x$with_libnotify" = "xyes"])
 AC_SUBST(LIBNOTIFY_CFLAGS)
 AC_SUBST(LIBNOTIFY_LIBS)
 
+if test "x$with_libnotify" = "xyes" ; then
+    savedCFLAGS="$CFLAGS"
+    CFLAGS="$LIBNOTIFY_CFLAGS $CFLAGS"
+    savedLIBS="$LIBS"
+    LIBS="$LIBNOTIFY_LIBS $LIBS"
+    AC_CHECK_FUNCS([notify_notification_new_with_status_icon])
+    CFLAGS="$savedCFLAGS"
+    LIBS="$savedLIBS"
+fi
 
 dnl secmem
 dnl Checks for library functions.
diff --git a/src/ka-applet.c b/src/ka-applet.c
index a68760b..bbde096 100644
--- a/src/ka-applet.c
+++ b/src/ka-applet.c
@@ -489,10 +489,14 @@ ka_send_event_notification (KaApplet *applet,
     notify_icon = icon ? icon : "krb-valid-ticket";
 
     applet->priv->notification =
+#if HAVE_NOTIFY_NOTIFICATION_NEW_WITH_STATUS_ICON
         notify_notification_new_with_status_icon (summary,
                                                   message,
                                                   notify_icon,
                                                   applet->priv->tray_icon);
+#else
+        notify_notification_new (summary, message, notify_icon);
+#endif
 
     notify_notification_set_urgency (applet->priv->notification,
                                      NOTIFY_URGENCY_NORMAL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]