[Pkg-privacy-commits] [nautilus-wipe] 35/224: Fix build on GTK 2.12/Nautilus 2.20

Ulrike Uhlig u-guest at moszumanska.debian.org
Thu Jul 7 19:45:31 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 37752865a90e763815df8802a2d6950d51136ccf
Author: Colomban Wendling <ban at herbesfolles.org>
Date:   Sun Feb 21 01:26:29 2010 +0100

    Fix build on GTK 2.12/Nautilus 2.20
    
    Add necessary checks and wrappers to build and work under
    GTK 2.12 and Nautilus 2.20 (current Debian stable requirements).
---
 configure.ac                    |  5 +++
 nautilus-srm/Makefile.am        |  3 +-
 nautilus-srm/compat.h           | 76 +++++++++++++++++++++++++++++++++++++++++
 nautilus-srm/delete-operation.c |  2 ++
 nautilus-srm/fill-operation.c   |  2 ++
 nautilus-srm/progress-dialog.c  |  6 ++--
 6 files changed, 90 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index cd52486..2775022 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,7 +66,12 @@ AC_SUBST([AM_CPPFLAGS],["${AM_CPPFLAGS} -DG_LOG_DOMAIN=\\\"${PACKAGE}\\\""])
 NA_NAUTILUS_EXTDIR
 
 # Checks for library functions.
+# If we are here we're sure we have libnautilus-extension, but we need this for
+# the check below to work (for the lib to be found).
+AC_CHECK_LIB([nautilus-extension], [nautilus_menu_provider_get_file_items])
+AC_CHECK_FUNCS([nautilus_file_info_get_location])
 
+# Output
 AC_CONFIG_FILES([Makefile po/Makefile.in
                  nautilus-srm/Makefile])
 AC_OUTPUT
diff --git a/nautilus-srm/Makefile.am b/nautilus-srm/Makefile.am
index ba378a1..f1b919f 100644
--- a/nautilus-srm/Makefile.am
+++ b/nautilus-srm/Makefile.am
@@ -11,6 +11,7 @@ libnautilus_srm_la_SOURCES = nautilus-srm.c \
                              fill-operation.c \
                              fill-operation.h \
                              progress-dialog.c \
-                             progress-dialog.h
+                             progress-dialog.h \
+                             compat.h
 
 libnautilus_srm_la_LDFLAGS = $(AM_LIBS) -module -avoid-version
diff --git a/nautilus-srm/compat.h b/nautilus-srm/compat.h
new file mode 100644
index 0000000..be6f2bf
--- /dev/null
+++ b/nautilus-srm/compat.h
@@ -0,0 +1,76 @@
+/*
+ *  nautilus-srm - a nautilus extension to wipe file(s) with srm
+ * 
+ *  Copyright (C) 2009-2010 Colomban Wendling <ban at herbesfolles.org>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 3 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+/* Contains compatibility things for old GTK and Nautilus */
+
+#ifndef NAUTILUS_SRM_COMPAT_H
+#define NAUTILUS_SRM_COMPAT_H
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <glib.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+
+/* GTK stuff */
+
+#if ! GTK_CHECK_VERSION(2, 14, 0)
+# define gtk_dialog_get_action_area(dialog)   ((dialog)->action_area)
+# define gtk_dialog_get_content_area(dialog)  ((dialog)->vbox)
+#endif /* ! GTK_CHECK_VERSION(2, 14, 0) */
+
+#if ! GTK_CHECK_VERSION (2, 18, 0)
+# define gtk_widget_get_sensitive(w) (GTK_WIDGET_SENSITIVE (w))
+#endif /* ! GTK_CHECK_VERSION (2, 18, 0) */
+
+
+/* Nautilus stuff */
+
+#if ! (defined (HAVE_NAUTILUS_FILE_INFO_GET_LOCATION) && \
+       HAVE_NAUTILUS_FILE_INFO_GET_LOCATION)
+# undef HAVE_NAUTILUS_FILE_INFO_GET_LOCATION
+# define HAVE_NAUTILUS_FILE_INFO_GET_LOCATION 1
+
+#include <gio/gio.h>
+#include <libnautilus-extension/nautilus-file-info.h>
+
+static GFile *
+nautilus_file_info_get_location (NautilusFileInfo *nfi)
+{
+  GFile *file;
+  gchar *uri;
+  
+  uri = nautilus_file_info_get_uri (nfi);
+  file = g_file_new_for_uri (uri);
+  g_free (uri);
+  
+  return file;
+}
+#endif /* HAVE_NAUTILUS_FILE_INFO_GET_LOCATION */
+
+
+G_END_DECLS
+
+#endif /* guard */
diff --git a/nautilus-srm/delete-operation.c b/nautilus-srm/delete-operation.c
index 6af20e4..ac2edf1 100644
--- a/nautilus-srm/delete-operation.c
+++ b/nautilus-srm/delete-operation.c
@@ -31,6 +31,8 @@
 #include <gsecuredelete/gsecuredelete.h>
 #include <libnautilus-extension/nautilus-file-info.h>
 
+#include "compat.h" /* for nautilus_file_info_get_location() */
+
 
 /*
  * nsrm_delete_operation:
diff --git a/nautilus-srm/fill-operation.c b/nautilus-srm/fill-operation.c
index a6e79ce..9f22ce1 100644
--- a/nautilus-srm/fill-operation.c
+++ b/nautilus-srm/fill-operation.c
@@ -34,6 +34,8 @@
 #include <gsecuredelete/gsecuredelete.h>
 #include <libnautilus-extension/nautilus-file-info.h>
 
+#include "compat.h" /* for nautilus_file_info_get_location() */
+
 
 #if HAVE_GIO_UNIX
 /*
diff --git a/nautilus-srm/progress-dialog.c b/nautilus-srm/progress-dialog.c
index e492f3a..8feee7a 100644
--- a/nautilus-srm/progress-dialog.c
+++ b/nautilus-srm/progress-dialog.c
@@ -25,10 +25,10 @@
 #include <glib.h>
 #include <gtk/gtk.h>
 
+#include "compat.h" /* for gtk_dialog_get_action_area(),
+                     *     gtk_dialog_get_countent_area() and
+                     *     gtk_widget_get_sensitive() */
 
-#if ! GTK_CHECK_VERSION (2, 18, 0)
-# define gtk_widget_get_sensitive(w) (GTK_WIDGET_SENSITIVE (w))
-#endif
 
 
 struct _NautilusSrmProgressDialogPrivate {

-- 
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