[seahorse-plugins] libseahorse: fix build with libnotify-0.7
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse-plugins] libseahorse: fix build with libnotify-0.7
- Date: Thu, 10 Feb 2011 08:14:49 +0000 (UTC)
commit fb74a75aa237c97c90dc1df2cfe36656a320e93e
Author: Nirbheek Chauhan <nirbheek chauhan gmail com>
Date: Fri Jan 14 06:32:17 2011 +0530
libseahorse: fix build with libnotify-0.7
* notify_notification_new cannot attach itself to widgets with 0.7
libseahorse/seahorse-notification.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/libseahorse/seahorse-notification.c b/libseahorse/seahorse-notification.c
index 5660bf7..cc92cd2 100644
--- a/libseahorse/seahorse-notification.c
+++ b/libseahorse/seahorse-notification.c
@@ -34,6 +34,11 @@
#ifdef HAVE_LIBNOTIFY
#include <libnotify/notify.h>
+
+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
+
#endif
/* -----------------------------------------------------------------------------
@@ -199,7 +204,7 @@ libnotify_closed (NotifyNotification *notif, SeahorseNotification *snotif)
}
static void
-setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent,
+setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent,
GtkWidget *attachto)
{
NotifyNotification *notif;
@@ -212,8 +217,13 @@ setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent,
heading = format_key_text (snotif->heading);
message = format_key_text (snotif->message);
-
+
+/* libnotify 0.7.0 and later has no support for attaching to widgets */
+#if NOTIFY_CHECK_VERSION(0,7,0)
+ notif = notify_notification_new (heading, message, snotif->icon);
+#else
notif = notify_notification_new (heading, message, snotif->icon, attachto);
+#endif
g_free (heading);
g_free (message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]