[vino] server: Make libnotify a hard dependency



commit 46c3f826412a607c44cc9dd787cdc27871f73dfa
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jan 28 19:08:30 2013 +0100

    server: Make libnotify a hard dependency
    
    As it's been a blessed dependency for a long while now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=461785

 configure.ac                   |   28 +---------------------------
 server/vino-status-icon.c      |   17 -----------------
 server/vino-status-tube-icon.c |   20 --------------------
 3 files changed, 1 insertions(+), 64 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index cd7f9b0..3995b16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,32 +71,6 @@ AS_IF([test "x$have_telepathy" = "xyes"],
 
 AM_CONDITIONAL([VINO_HAVE_TELEPATHY_GLIB], [test "x$have_telepathy" = "xyes"])
 
-# Check for libnotify
-LIBNOTIFY_DEPS="libnotify >= 0.4.4"
-LIBNOTIFY_0_7_DEPS="libnotify >= 0.7.0"
-
-AC_ARG_WITH([libnotify],
-  [AS_HELP_STRING([--without-libnotify],
-    [ignore the presence of libnotify and disable it])])
-
-AS_IF([test "x$with_libnotify" != "xno"],
-  [PKG_CHECK_EXISTS([$LIBNOTIFY_DEPS],
-    [have_libnotify=yes],
-    [have_libnotify=no])],
-  [have_libnotify=no])
-
-AS_IF([test "x$have_libnotify" = "xyes"],
-  [AC_DEFINE([VINO_HAVE_LIBNOTIFY], [], [Build with libnotify support])
-    PKG_CHECK_EXISTS([$LIBNOTIFY_0_7_DEPS],
-      [have_libnotify_0_7=yes],
-      [have_libnotify_0_7=no])
-    AS_IF([test "x$have_libnotify_0_7" = "xyes"],
-      [LIBNOTIFY_DEPS="$LIBNOTIFY_0_7_DEPS"
-        AC_DEFINE([VINO_HAVE_LIBNOTIFY_0_7], [], [Build with libnotify 0.7 or greater support])])],
-  [LIBNOTIFY_DEPS=""
-    AS_IF([test "x$have_libnotify" = "xyes"],
-    [AC_MSG_ERROR([libnotify support requested but not found])])])
-
 # Check for NetworkManager
 NETWORKMANAGER_DEPS="NetworkManager >= 0.7"
 
@@ -328,7 +302,7 @@ GLIB_VERSION=2.17.0
 GIO_VERSION=2.26
 SOUP_VERSION=2.24.0
 
-PKG_CHECK_MODULES([VINO_SERVER], [glib-2.0 >= $GLIB_VERSION gio-unix-2.0 gtk+-x11-3.0 >= $GTK_VERSION $TELEPATHY_GLIB_DEPS $LIBNOTIFY_DEPS $SECRET_DEPS $NETWORKMANAGER_DEPS $GNUTLS_DEPS $AVAHI_DEPS])
+PKG_CHECK_MODULES([VINO_SERVER], [glib-2.0 >= $GLIB_VERSION gio-unix-2.0 gtk+-x11-3.0 >= $GTK_VERSION $TELEPATHY_GLIB_DEPS libnotify >= 0.7.0 $SECRET_DEPS $NETWORKMANAGER_DEPS $GNUTLS_DEPS $AVAHI_DEPS])
 
 PKG_CHECK_MODULES([VINO_CAPPLET], [glib-2.0 >= $GLIB_VERSION gio-2.0 >= $GIO_VERSION gtk+-3.0 >= $GTK_VERSION libsoup-2.4 >= $SOUP_VERSION $SECRET_DEPS])
 
diff --git a/server/vino-status-icon.c b/server/vino-status-icon.c
index 58d7ceb..dc4f129 100644
--- a/server/vino-status-icon.c
+++ b/server/vino-status-icon.c
@@ -26,9 +26,7 @@
 #include <gtk/gtk.h>
 #include <gio/gdesktopappinfo.h>
 #include <string.h>
-#ifdef VINO_HAVE_LIBNOTIFY
 #include <libnotify/notify.h>
-#endif
 
 #include "vino-status-icon.h"
 #include "vino-enums.h"
@@ -42,9 +40,7 @@ struct _VinoStatusIconPrivate
   GtkWidget  *disconnect_dialog;
   VinoStatusIconVisibility visibility;
 
-#ifdef VINO_HAVE_LIBNOTIFY
   NotifyNotification *new_client_notification;
-#endif
 };
 
 G_DEFINE_TYPE (VinoStatusIcon, vino_status_icon, GTK_TYPE_STATUS_ICON);
@@ -69,11 +65,9 @@ vino_status_icon_finalize (GObject *object)
 {
   VinoStatusIcon *icon = VINO_STATUS_ICON (object);
 
-#ifdef VINO_HAVE_LIBNOTIFY
   if (icon->priv->new_client_notification)
     g_object_unref (icon->priv->new_client_notification);
   icon->priv->new_client_notification = NULL;
-#endif
 
   if (icon->priv->menu)
     gtk_widget_destroy (GTK_WIDGET(icon->priv->menu));
@@ -573,19 +567,16 @@ vino_status_icon_class_init (VinoStatusIconClass *klass)
   g_type_class_add_private (gobject_class, sizeof (VinoStatusIconPrivate));
 }
 
-#ifdef VINO_HAVE_LIBNOTIFY
 static void
 vino_status_handle_new_client_notification_closed (VinoStatusIcon *icon)
 {
   g_object_unref (icon->priv->new_client_notification);
   icon->priv->new_client_notification = NULL;
 }
-#endif /* VINO_HAVE_LIBNOTIFY */
 
 static gboolean
 vino_status_icon_show_new_client_notification (gpointer user_data)
 {
-#ifdef VINO_HAVE_LIBNOTIFY
 #define NOTIFICATION_TIMEOUT 5
 
   GError     *error;
@@ -640,16 +631,9 @@ vino_status_icon_show_new_client_notification (gpointer user_data)
     }
 
   icon->priv->new_client_notification =
-#ifdef VINO_HAVE_LIBNOTIFY_0_7
     notify_notification_new (summary,
                              body,
                              "preferences-desktop-remote-desktop");
-#else
-    notify_notification_new_with_status_icon (summary,
-                                              body,
-                                              "preferences-desktop-remote-desktop",
-                                              GTK_STATUS_ICON (icon));
-#endif
 
   g_free (body);
 
@@ -673,7 +657,6 @@ vino_status_icon_show_new_client_notification (gpointer user_data)
   g_free (user_data);
 
 #undef NOTIFICATION_TIMEOUT
-#endif /* VINO_HAVE_LIBNOTIFY */
 
   return FALSE;
 }
diff --git a/server/vino-status-tube-icon.c b/server/vino-status-tube-icon.c
index 9b8fef9..578f0a7 100644
--- a/server/vino-status-tube-icon.c
+++ b/server/vino-status-tube-icon.c
@@ -24,10 +24,8 @@
 #include <string.h>
 #include <gtk/gtk.h>
 #include <gio/gdesktopappinfo.h>
-#ifdef VINO_HAVE_LIBNOTIFY
 #include <glib/gi18n.h>
 #include <libnotify/notify.h>
-#endif
 
 #include "vino-status-tube-icon.h"
 #include "vino-enums.h"
@@ -40,9 +38,7 @@ struct _VinoStatusTubeIconPrivate
   GtkWidget *disconnect_dialog;
   VinoStatusTubeIconVisibility visibility;
 
-#ifdef VINO_HAVE_LIBNOTIFY
   NotifyNotification *new_client_notification;
-#endif
 };
 
 G_DEFINE_TYPE (VinoStatusTubeIcon, vino_status_tube_icon, GTK_TYPE_STATUS_ICON);
@@ -59,14 +55,12 @@ vino_status_tube_icon_finalize (GObject *object)
 {
   VinoStatusTubeIcon *icon = VINO_STATUS_TUBE_ICON (object);
 
-#ifdef VINO_HAVE_LIBNOTIFY
   if (icon->priv->new_client_notification != NULL)
     {
       notify_notification_close (icon->priv->new_client_notification, NULL);
       g_object_unref (icon->priv->new_client_notification);
       icon->priv->new_client_notification = NULL;
     }
-#endif
 
   if (icon->priv->menu != NULL)
     {
@@ -107,9 +101,7 @@ static void
 vino_status_tube_icon_init (VinoStatusTubeIcon *icon)
 {
   icon->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, VINO_TYPE_STATUS_TUBE_ICON, VinoStatusTubeIconPrivate);
-#ifdef VINO_HAVE_LIBNOTIFY
   icon->priv->new_client_notification = NULL;
-#endif
 }
 
 static void
@@ -375,7 +367,6 @@ vino_status_tube_icon_set_visibility (VinoStatusTubeIcon *icon,
     }
 }
 
-#ifdef VINO_HAVE_LIBNOTIFY
 static void
 vino_status_tube_icon_show_invalidated_notif_closed
     (VinoStatusTubeIcon *icon)
@@ -383,13 +374,11 @@ vino_status_tube_icon_show_invalidated_notif_closed
   dprintf (TUBE, "Notification was closed");
   vino_tube_server_fire_closed (icon->priv->server);
 }
-#endif
 
 void
 vino_status_tube_icon_show_notif (VinoStatusTubeIcon *icon,
     const gchar *summary, const gchar *body, gboolean invalidated)
 {
-#ifdef VINO_HAVE_LIBNOTIFY
 #define NOTIFICATION_TIMEOUT 5
 
   GError *error;
@@ -414,12 +403,7 @@ vino_status_tube_icon_show_notif (VinoStatusTubeIcon *icon,
       filename = g_strdup ("stock_person");
 
   icon->priv->new_client_notification =
-#ifdef VINO_HAVE_LIBNOTIFY_0_7
       notify_notification_new (summary, body, filename);
-#else
-      notify_notification_new_with_status_icon (summary, body,
-      filename, GTK_STATUS_ICON (icon));
-#endif
 
   g_free (filename);
 
@@ -442,9 +426,5 @@ vino_status_tube_icon_show_notif (VinoStatusTubeIcon *icon,
     }
 
 #undef NOTIFICATION_TIMEOUT
-#else
-  if (invalidated)
-    vino_tube_server_fire_closed (icon->priv->server);
-#endif /* VINO_HAVE_LIBNOTIFY */
 }
 



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