]> www.fi.muni.cz Git - evince.git/commitdiff
Make use of GConf optional. Based on patch by Hib Eris. See bug #339172.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Thu, 5 Feb 2009 09:01:14 +0000 (09:01 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Thu, 5 Feb 2009 09:01:14 +0000 (09:01 +0000)
2009-02-05  Carlos Garcia Campos  <carlosgc@gnome.org>

* configure.ac:
* shell/ev-window.c: (ev_window_setup_action_sensitivity):

Make use of GConf optional. Based on patch by Hib Eris. See bug
#339172.

svn path=/trunk/; revision=3414

ChangeLog
configure.ac
shell/ev-window.c

index 01929de6bee48cac7be1a36cccd78b628284b4bf..35bd25de28cc0214306f1a275a05c8449f6c66f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-05  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * configure.ac:
+       * shell/ev-window.c: (ev_window_setup_action_sensitivity):
+
+       Make use of GConf optional. Based on patch by Hib Eris. See bug
+       #339172.
+       
 2009-02-04  Christian Persch  <chpe@gnome.org>
 
        * libdocument/ev-init.c: (ev_init): Make ev_init() also bind the
index e50c404b079dbc2f3de7a25a615b24b2465f37cc..c04a07b1c09f35e4d9bea06b37b99d4c4d6f0489 100644 (file)
@@ -95,7 +95,7 @@ PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIR
 PKG_CHECK_MODULES(LIBVIEW, gtk+-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED)
 PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
-PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gthread-2.0 gconf-2.0)
+PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gtk+-unix-print-2.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gthread-2.0)
 
 PKG_CHECK_MODULES(SMCLIENT, gtk+-2.0 gthread-2.0)
 AC_SUBST(SMCLIENT_CFLAGS)
@@ -110,6 +110,7 @@ LIBS="$LIBS $BACKEND_LIBS"
 AC_CHECK_FUNCS(cairo_format_stride_for_width)
 LIBS=$evince_save_LIBS
 
+dnl ========= Check for Keyring
 AC_ARG_WITH(keyring,
         AC_HELP_STRING([--without-keyring],[disable the use of gnome-keyring]),
        [case "${withval}" in
@@ -157,6 +158,22 @@ AC_SUBST([DBUS_LIBS])
 AM_CONDITIONAL([ENABLE_DBUS], [test "x$enable_dbus" = "xyes"])
 AM_CONDITIONAL([DBUS_TOOL_NO_PREFIX], [test "x$DBUS_VERSION" = "x33"])
 
+dnl ========= Check for GConf
+AC_ARG_WITH(gconf,
+       AC_HELP_STRING([--without-gconf],[disable the use of gconf]),
+       [case "${withval}" in
+       yes) WITH_GCONF=yes ;;
+       no) WITH_GCONF=no ;;
+       *) AC_MSG_ERROR(bad value ${withval} for --with-gconf) ;;
+       esac],
+       [WITH_GCONF=yes]) dnl Default value
+AM_CONDITIONAL(WITH_GCONF, test x$WITH_GCONF = "xyes")
+
+if test x$WITH_GCONF = "xyes"; then
+   PKG_CHECK_MODULES(GCONF, gconf-2.0)
+   AC_DEFINE([WITH_GCONF],[1],[Define if GConf support is enabled])
+fi
+
 dnl Debug mode
 AC_ARG_ENABLE([debug],
        AC_HELP_STRING([--enable-debug],
@@ -182,8 +199,8 @@ BACKEND_CFLAGS="$BACKEND_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG
 AC_SUBST(BACKEND_CFLAGS)
 AC_SUBST(BACKEND_LIBS)
 
-SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $KEYRING_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
-SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $KEYRING_LIBS -lz"
+SHELL_CFLAGS="$SHELL_CORE_CFLAGS $DBUS_CFLAGS $KEYRING_CFLAGS $GCONF_CFLAGS -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE $DEBUG_FLAGS"
+SHELL_LIBS="$SHELL_CORE_LIBS $DBUS_LIBS $KEYRING_LIBS $GCONF_LIBS -lz"
 AC_SUBST(SHELL_CFLAGS)
 AC_SUBST(SHELL_LIBS)
 
@@ -536,6 +553,7 @@ AC_OUTPUT
 
 echo "
 Configure summary:
+        GConf Support......:  $WITH_GCONF
        Keyring Support....:  $WITH_KEYRING
        DBUS Support.......:  $enable_dbus
        Nautilus Plugin....:  $HAVE_NAUTILUS
index 523a8c6aa164342bde35b792b2512eb5f026ef21..77455c637e3fee69805b81233fc9621f74d91f49 100644 (file)
@@ -43,7 +43,9 @@
 #else
 #include <gtk/gtkprintunixdialog.h>
 #endif
+#ifdef WITH_GCONF
 #include <gconf/gconf-client.h>
+#endif
 
 #include "egg-editable-toolbar.h"
 #include "egg-toolbar-editor.h"
@@ -340,8 +342,9 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
        gboolean can_get_text = FALSE;
        gboolean has_pages = FALSE;
        gboolean can_find = FALSE;
-
+#ifdef WITH_GCONF
        GConfClient *client;
+#endif
 
        if (document) {
                has_document = TRUE;
@@ -364,10 +367,12 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
                can_find = TRUE;
        }
 
+#ifdef WITH_GCONF
        client = gconf_client_get_default ();
        override_restrictions = gconf_client_get_bool (client, 
                                                       GCONF_OVERRIDE_RESTRICTIONS, 
                                                       NULL);
+#endif
        if (!override_restrictions && info && info->fields_mask & EV_DOCUMENT_INFO_PERMISSIONS) {
                ok_to_print = (info->permissions & EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT);
                ok_to_copy = (info->permissions & EV_DOCUMENT_PERMISSIONS_OK_TO_COPY);
@@ -376,7 +381,7 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
        if (has_document && !EV_IS_FILE_EXPORTER(document))
                ok_to_print = FALSE;
 
-       
+#ifdef WITH_GCONF
        if (gconf_client_get_bool (client, GCONF_LOCKDOWN_SAVE, NULL)) {
                ok_to_copy = FALSE;
        }
@@ -386,6 +391,7 @@ ev_window_setup_action_sensitivity (EvWindow *ev_window)
        }
 
        g_object_unref (client);
+#endif
 
        /* File menu */
        ev_window_set_action_sensitive (ev_window, "FileOpenCopy", has_document);