]> www.fi.muni.cz Git - evince.git/commitdiff
Make gnome-keyring optional. Fixes bug #509676.
authorMarcelo Lira <setanta@gmail.com>
Fri, 18 Jan 2008 17:06:51 +0000 (17:06 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Fri, 18 Jan 2008 17:06:51 +0000 (17:06 +0000)
2008-01-18  Marcelo Lira  <setanta@gmail.com>
* configure.a:
* shell/ev-password.c:
Make gnome-keyring optional. Fixes bug #509676.

svn path=/trunk/; revision=2830

ChangeLog
configure.ac
shell/ev-password.c

index a659655dfe4c8d19e359f34e613634975c93a257..1fff2a53ebf9634f9b7c0225a81f89c8228fc6f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-18  Marcelo Lira  <setanta@gmail.com>
+
+       * configure.a:
+       * shell/ev-password.c:
+
+       Make gnome-keyring optional. Fixes bug #509676.
+       
 2008-01-16  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-pixbuf-cache.c: (add_job):
index 381f29d606e42c0141c3af653642d624dd8b5624..01b391d3339965480327acca875ac9f22e2cbeb5 100644 (file)
@@ -60,11 +60,26 @@ GTK_PRINT_REQUIRED=2.10.0
 PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED gnome-vfs-2.0)
 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED)
 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 gnome-vfs-2.0)
-PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED)
+PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0)
 
 BACKEND_LIBTOOL_FLAGS="-module -avoid-version"
 AC_SUBST(BACKEND_LIBTOOL_FLAGS)
 
+AC_ARG_WITH(keyring,
+        AC_HELP_STRING([--without-keyring],[disable the use of gnome-keyring]),
+       [case "${withval}" in
+       yes) WITH_KEYRING=yes ;;
+       no) WITH_KEYRING=no ;;
+       *) AC_MSG_ERROR(bad value ${withval} for --with-keyring) ;;
+       esac],
+       [WITH_KEYRING=yes]) dnl Default value
+AM_CONDITIONAL(WITH_KEYRING, test x$WITH_KEYRING = "xyes")
+
+if test x$WITH_KEYRING = "xyes"; then
+        PKG_CHECK_MODULES(KEYRING, gnome-keyring-1 >= $KEYRING_REQUIRED)
+        AC_DEFINE([WITH_KEYRING],[1],[Define if KEYRING support is enabled])
+fi
+
 AC_ARG_WITH(libgnome,
         AC_HELP_STRING([--without-libgnome],[disable the use of libgnome]),
        [case "${withval}" in
@@ -162,8 +177,8 @@ BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
 AC_SUBST(BACKEND_CFLAGS)
 AC_SUBST(BACKEND_LIBS)
 
-SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $GNOMEUI_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
-SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $GNOMEUI_LIBS -lz"
+SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $GNOMEUI_CFLAGS $KEYRING_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE"
+SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $GNOMEUI_LIBS $KEYRING_LIBS -lz"
 AC_SUBST(SHELL_CFLAGS)
 AC_SUBST(SHELL_LIBS)
 
@@ -503,6 +518,7 @@ echo "
 Configure summary:
        GNOME Support......:  $WITH_GNOME
        Print Support......:  $enable_print
+       Keyring Support....:  $WITH_KEYRING
        DBUS Support.......:  $enable_dbus
        Nautilus Plugin....:  $HAVE_NAUTILUS
        Thumbnailer........:  $ENABLE_THUMBNAILER
index b6298f38493b22763e9ef561a5ad3367822ceff3..463d1e71af71d049c5b54781b8dd14a9e3c4071f 100644 (file)
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <glade/glade.h>
-#include <gnome-keyring.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
 
+#ifdef WITH_KEYRING
+#include <gnome-keyring.h>
+#else
+#define gnome_keyring_is_available()   FALSE
+#endif
+
 #include "ev-password.h"
 
 enum {
@@ -173,7 +178,7 @@ ev_password_dialog_init (EvPasswordDialog *dialog)
        g_signal_connect (dialog->priv->entry, "activate", G_CALLBACK (ev_password_dialog_entry_activated_cb), dialog);
 
        ev_password_set_bad_password_label (dialog, " ");
-       
+
        if (!gnome_keyring_is_available ()) {
                gtk_widget_hide (dialog->priv->check_default);
                gtk_widget_hide (dialog->priv->check_session);
@@ -219,6 +224,7 @@ ev_password_dialog_entry_activated_cb (GtkEntry *entry,
        gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 }
 
+#ifdef WITH_KEYRING
 static void
 ev_password_item_created_callback (GnomeKeyringResult result,
                                   guint32            val,
@@ -226,11 +232,13 @@ ev_password_item_created_callback (GnomeKeyringResult result,
 {
        /* Nothing yet */
        return;
-}                                 
+}
+#endif
 
 void
 ev_password_dialog_save_password (EvPasswordDialog *dialog)
 {
+#ifdef WITH_KEYRING
        GnomeKeyringAttributeList *attributes;
        GnomeKeyringAttribute attribute;
        gchar *name;
@@ -274,10 +282,12 @@ ev_password_dialog_save_password (EvPasswordDialog *dialog)
        gnome_keyring_attribute_list_free (attributes);
        g_free (name);
        g_free (unescaped_uri);
-       
+
+#endif /* WITH_KEYRING */
        return;
 }
 
+#ifdef WITH_KEYRING
 static void 
 ev_password_keyring_found_cb (GnomeKeyringResult result,
                              GList             *list,
@@ -293,10 +303,12 @@ ev_password_keyring_found_cb (GnomeKeyringResult result,
        found = list->data;
        gtk_entry_set_text (GTK_ENTRY (dialog->priv->entry), found->secret);
 }                        
+#endif /* WITH_KEYRING */
 
 static void
 ev_password_search_in_keyring (EvPasswordDialog *dialog, const gchar *uri)
 {
+#ifdef WITH_KEYRING
        GnomeKeyringAttributeList *attributes;
        GnomeKeyringAttribute attribute;
        
@@ -318,6 +330,7 @@ ev_password_search_in_keyring (EvPasswordDialog *dialog, const gchar *uri)
                                   g_object_ref (dialog),
                                   g_object_unref);
        gnome_keyring_attribute_list_free (attributes);
+#endif /* WITH_KEYRING */
        return;
 }