From b4f8eecaa7d053a905e7893e1c8835e37727502c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 11 Mar 2008 04:17:31 +0000 Subject: [PATCH] port nautilus extension to gio --- file-roller-gio.patch | 100 ++++++++++++++++++++++++++++++++++++++++++ file-roller.spec | 8 +++- 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 file-roller-gio.patch diff --git a/file-roller-gio.patch b/file-roller-gio.patch new file mode 100644 index 0000000..0043c0f --- /dev/null +++ b/file-roller-gio.patch @@ -0,0 +1,100 @@ +Index: configure.in +=================================================================== +--- configure.in (revision 2182) ++++ configure.in (working copy) +@@ -18,13 +18,13 @@ + dnl + dnl ========================================================================== + +-GLIB_REQUIRED=2.12.0 ++GLIB_REQUIRED=2.15.0 + GTK_REQUIRED=2.10.0 + LIBGNOME_REQUIRED=2.6.0 + LIBGNOMEUI_REQUIRED=2.6.0 + GNOME_VFS_REQUIRED=2.10.0 + LIBGLADE_REQUIRED=2.4.0 +-NAUTILUS_REQUIRED=2.10.0 ++NAUTILUS_REQUIRED=2.21.0 + + AC_SUBST(GLIB_REQUIRED) + AC_SUBST(GTK_REQUIRED) +@@ -38,6 +38,7 @@ + + PKG_CHECK_MODULES(FR, \ + glib-2.0 >= $GLIB_REQUIRED \ ++ gio-2.0 >= $GLIB_REQUIRED \ + gthread-2.0 \ + gtk+-2.0 >= $GTK_REQUIRED \ + libgnome-2.0 >= $LIBGNOME_REQUIRED \ +Index: nautilus/nautilus-fileroller.c +=================================================================== +--- nautilus/nautilus-fileroller.c (revision 2182) ++++ nautilus/nautilus-fileroller.c (working copy) +@@ -24,9 +24,7 @@ + #include + #include + #include +-#include +-#include +-#include ++#include + #include + #include + #include +@@ -204,34 +202,31 @@ + return NULL; + + for (scan = files; scan; scan = scan->next) { +- NautilusFileInfo *file = scan->data; ++ NautilusFileInfo *file = scan->data; + +- if (all_archives && ! is_archive (file)) +- all_archives = FALSE; ++ if ((all_archives = is_archive (file)) == FALSE) ++ break; + ++ /* FIXME: Here we should get the parent of the current ++ * file and check if it is the same parent as for the ++ * other files and then check if the parent is writable ++ * ++ * We *MUST NOT* do that synchronous since this function ++ * gets called very often (every time a selection changed) ++ * and it could be a remote location. MUST NOT DO SYNC IO. ++ * ++ * Nautilus actually already has stat'ed the parent and ++ * knows if the parent is writable or not. The API is ++ * just missing. This is filed under bug #521612. Once that ++ * bug is fixed we can actually implement the funcionality. ++ * Until then we just set can_write to TRUE. If that is an ++ * lie we will find out once the user tries to really extract ++ * stuff. ++ * ++ * Christian Kellner ++ * */ ++ } + +- if (can_write) { +- char *parent_uri; +- GnomeVFSFileInfo *info; +- GnomeVFSResult result; +- +- parent_uri = nautilus_file_info_get_parent_uri (file); +- info = gnome_vfs_file_info_new (); +- +- result = gnome_vfs_get_file_info (parent_uri, +- info, +- (GNOME_VFS_FILE_INFO_FOLLOW_LINKS +- | GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS)); +- if ((result == GNOME_VFS_OK) && (info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS)) +- can_write = (info->permissions & GNOME_VFS_PERM_ACCESS_WRITABLE) || (info->permissions & GNOME_VFS_PERM_USER_WRITE); +- +- gnome_vfs_file_info_unref (info); +- g_free (parent_uri); +- } +- } +- +- /**/ +- + one_item = (files != NULL) && (files->next == NULL); + one_archive = one_item && all_archives; + diff --git a/file-roller.spec b/file-roller.spec index a11cd10..20f5aac 100644 --- a/file-roller.spec +++ b/file-roller.spec @@ -11,11 +11,13 @@ Summary: File Roller is a tool for viewing and creating archives Name: file-roller Version: 2.21.92 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: Applications/Archiving URL: http://download.gnome.org/sources/file-roller/ Source: http://download.gnome.org/sources/file-roller/2.21/file-roller-%{version}.tar.bz2 +# http://bugzilla.gnome.org/show_bug.cgi?id=501542 +Patch0: file-roller-gio.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: pango-devel >= %{pango_version} @@ -49,6 +51,7 @@ such as tar files. %prep %setup -q +%patch0 -p0 -b .gio %build %configure --disable-scrollkeeper --disable-static @@ -125,6 +128,9 @@ fi %{_datadir}/icons/hicolor/scalable/apps/file-roller.svg %changelog +* Tue Mar 11 2008 Matthias Clasen - 2.21.92-3 +- Port nautilus extension to gio + * Thu Mar 6 2008 Matthias Clasen - 2.21.92-2 - Don't OnlyShowIn=GNOME