[Pkg-privacy-commits] [nautilus-wipe] 180/224: Drop GConf dependency for Nautilus 3.x
Ulrike Uhlig
u-guest at moszumanska.debian.org
Thu Jul 7 19:45:48 UTC 2016
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to branch master
in repository nautilus-wipe.
commit 48e9d27c12cf25e7dc2b79e824177adbe2ca7477
Author: Colomban Wendling <ban at herbesfolles.org>
Date: Wed May 15 16:41:03 2013 +0200
Drop GConf dependency for Nautilus 3.x
Nautilus 3.x don't use GConf, and don't seem to have a setting like
'desktop_is_home_dir' anymore, simply relying on XDG directories.
---
README | 2 +-
TODO | 2 --
configure.ac | 5 ++++-
nautilus-wipe/nw-path-list.c | 29 +++++++++++++++++++----------
4 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/README b/README
index 2bee7cd..5dd0cbc 100644
--- a/README
+++ b/README
@@ -14,7 +14,7 @@ Dependancies
- libnautilus-extension 2.x or 3.x (http://live.gnome.org/Nautilus)
- GTK2 >= 2.6 or GTK3 (http://www.gtk.org)
- libgsecuredelete (http://wipetools.tuxfamily.org/libgsecuredelete.html)
-- GConf 2.x (http://projects.gnome.org/gconf/)
+- GConf 2.x (http://projects.gnome.org/gconf/) -- only needed for Nautilus 2.x
Build dependancies
==================
diff --git a/TODO b/TODO
index 702a800..e5ae028 100644
--- a/TODO
+++ b/TODO
@@ -17,5 +17,3 @@
* When one try to remove a single file on a flash device, explain that it's not
useful at all rather than doing it, giving the user a false impression of
security.
-
-* Get Nautilus 3.x settings? GSettings?
diff --git a/configure.ac b/configure.ac
index 8fecdc8..ba73ef6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,9 +55,12 @@ AC_MSG_RESULT([$gtk_pkg])
# mandatory packages
PKG_CHECK_MODULES([GLIB], glib-2.0 >= ${GLIB_REQUIRED})
PKG_CHECK_MODULES([GTK], $gtk_pkg >= ${GTK_REQUIRED})
-PKG_CHECK_MODULES([GCONF], gconf-2.0 >= ${GCONF_REQUIRED})
PKG_CHECK_MODULES([LIBNAUTILUS_EXTENSION], libnautilus-extension >= ${NAUTILUS_EXTENSION})
PKG_CHECK_MODULES([GSECUREDELETE], gsecuredelete >= ${GSECUREDELETE_REQUIRED})
+# GConf is mandatory, but only for Nautilus 2.x
+AS_IF([test "$gtk_pkg" = "gtk+-2.0"],
+ [PKG_CHECK_MODULES([GCONF], gconf-2.0 >= ${GCONF_REQUIRED})
+ AC_DEFINE([HAVE_GCONF], [1], [Whether we have GConf])])
# optional packages
HAVE_GIO_UNIX=0
diff --git a/nautilus-wipe/nw-path-list.c b/nautilus-wipe/nw-path-list.c
index 4380c30..06b0c37 100644
--- a/nautilus-wipe/nw-path-list.c
+++ b/nautilus-wipe/nw-path-list.c
@@ -28,7 +28,9 @@
#include <string.h>
#include <glib.h>
#include <libnautilus-extension/nautilus-file-info.h>
-#include <gconf/gconf-client.h>
+#ifdef HAVE_GCONF
+# include <gconf/gconf-client.h>
+#endif
/* checks whether a #NautilusFileInfo have the given URI scheme */
@@ -53,18 +55,25 @@ nfi_has_uri_scheme (NautilusFileInfo *nfi,
static gchar *
get_desktop_path (void)
{
- gchar *path = NULL;
- GConfClient *conf_client;
+ gchar *path = NULL;
- conf_client = gconf_client_get_default ();
- if (gconf_client_get_bool (conf_client,
- "/apps/nautilus/preferences/desktop_is_home_dir",
- NULL)) {
- path = g_strdup (g_get_home_dir ());
- } else {
+#ifdef HAVE_GCONF
+ if (! path) {
+ GConfClient *conf_client;
+
+ conf_client = gconf_client_get_default ();
+ if (gconf_client_get_bool (conf_client,
+ "/apps/nautilus/preferences/desktop_is_home_dir",
+ NULL)) {
+ path = g_strdup (g_get_home_dir ());
+ }
+ g_object_unref (conf_client);
+ }
+#endif /* HAVE_GCONF */
+
+ if (! path) {
path = g_strdup (g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP));
}
- g_object_unref (conf_client);
return path;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/nautilus-wipe.git
More information about the Pkg-privacy-commits
mailing list