rpms/gvfs/F-12 http-icons.patch,NONE,1.1 gvfs.spec,1.157,1.158

Matthias Clasen mclasen at fedoraproject.org
Tue Sep 29 20:14:51 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/gvfs/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29600

Modified Files:
	gvfs.spec 
Added Files:
	http-icons.patch 
Log Message:
fix lack of icons in the http backend


http-icons.patch:
 gvfsbackendhttp.c |   46 ++++++++++++++++++++++------------------------
 1 file changed, 22 insertions(+), 24 deletions(-)

--- NEW FILE http-icons.patch ---
diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c
index 45ea54d..97c6ce7 100644
--- a/daemon/gvfsbackendhttp.c
+++ b/daemon/gvfsbackendhttp.c
@@ -47,6 +47,7 @@
 #include "gvfsjobqueryattributes.h"
 #include "gvfsjobenumerate.h"
 #include "gvfsdaemonprotocol.h"
+#include "gvfsdaemonutils.h"
 
 #include "soup-input-stream.h"
 
@@ -539,10 +540,12 @@ query_info_ready (SoupSession *session,
   const char            *text;
   GFileInfo             *info;
   char                  *basename;
+  char                  *ed_name;
 
   job     = G_VFS_JOB_QUERY_INFO (user_data);
   info    = job->file_info;
   matcher = job->attribute_matcher;
+  ed_name = NULL;
 
   if (! SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
     {
@@ -562,30 +565,18 @@ query_info_ready (SoupSession *session,
       g_file_attribute_matcher_matches (matcher,
                                         G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
     {
-      char *display_name = g_filename_display_name (basename);
-
-      if (strstr (display_name, "\357\277\275") != NULL)
-        {
-          char *p = display_name;
-          display_name = g_strconcat (display_name, _(" (invalid encoding)"), NULL);
-          g_free (p);
-        }
-
-      g_file_info_set_display_name (info, display_name);
-      g_free (display_name);
+      ed_name = gvfs_file_info_populate_names_as_local (info, basename);
     }
 
-  if (basename != NULL &&
+  if (ed_name != NULL &&
       g_file_attribute_matcher_matches (matcher,
                                         G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME))
     {
-      char *edit_name = g_filename_display_name (basename);
-      g_file_info_set_edit_name (info, edit_name);
-      g_free (edit_name);
-    } 
+      g_file_info_set_edit_name (info, ed_name);
+    }
 
   g_free (basename);
-
+  g_free (ed_name);
 
   text = soup_message_headers_get (msg->response_headers,
                                    "Content-Length");
@@ -601,15 +592,22 @@ query_info_ready (SoupSession *session,
   if (text)
     {
       char *p = strchr (text, ';');
+      char *tmp = NULL;
+      GIcon *icon;
 
       if (p != NULL)
-        {
-          char *tmp = g_strndup (text, p - text);
-          g_file_info_set_content_type (info, tmp);
-          g_free (tmp);
-        }
-      else
-        g_file_info_set_content_type (info, text);
+        text = tmp = g_strndup (text, p - text);
+
+      g_file_info_set_file_type (info, G_FILE_TYPE_REGULAR);
+      g_file_info_set_content_type (info, text);
+      g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, text);
+
+      icon = g_content_type_get_icon (text);
+      g_file_info_set_icon (info, icon);
+      g_object_unref (icon);
+
+      g_free (tmp);
+
     }
 
 


Index: gvfs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gvfs/F-12/gvfs.spec,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -p -r1.157 -r1.158
--- gvfs.spec	21 Sep 2009 15:09:47 -0000	1.157
+++ gvfs.spec	29 Sep 2009 20:14:51 -0000	1.158
@@ -1,7 +1,7 @@
 Summary: Backends for the gio framework in GLib
 Name: gvfs
 Version: 1.4.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 URL: http://www.gtk.org
@@ -34,9 +34,11 @@ Requires(postun): desktop-file-utils
 BuildRequires: automake autoconf
 BuildRequires: libtool
 # http://bugzilla.gnome.org/show_bug.cgi?id=567235
-Patch1: gvfs-archive-integration.patch
+Patch0: gvfs-archive-integration.patch
 # http://bugzilla.gnome.org/show_bug.cgi?id=591005
-Patch10: 0001-Add-AFC-backend.patch
+Patch1: 0001-Add-AFC-backend.patch
+# from upstream
+Patch2: http-icons.patch
 
 %description
 The gvfs package provides backend implementations for the gio
@@ -128,8 +130,9 @@ and iPod Touches to applications using g
 
 %prep
 %setup -q
-%patch1 -p1 -b .archive-integration
-%patch10 -p1 -b .afc
+%patch0 -p1 -b .archive-integration
+%patch1 -p1 -b .afc
+%patch2 -p1 -b .http-icons
 
 %build
 
@@ -283,6 +286,9 @@ update-desktop-database &> /dev/null ||:
 %{_datadir}/gvfs/remote-volume-monitors/afc.monitor
 
 %changelog
+* Tue Sep 29 2009 Matthias Clasen <mclasen at redhat.com> - 1.4.0-2
+- Fix the lack of icons in the http backend
+
 * Mon Sep 21 2009 Tomas Bzatek <tbzatek at redhat.com> - 1.4.0-1
 - Update to 1.4.0
 




More information about the fedora-extras-commits mailing list