[gvfs] Remove favicon support



commit 96daf6359e857818c3255d49c0c7d9375870aaa5
Author: William Jon McCann <jmccann redhat com>
Date:   Tue Aug 28 14:27:04 2012 -0400

    Remove favicon support
    
    16px favicons aren't themable or resizable. They don't work very well
    as the default icons for files or mounts.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682892

 daemon/gvfsbackendsftp.c |   81 +--------------------------------------------
 1 files changed, 2 insertions(+), 79 deletions(-)
---
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 6f9cd51..c3d8a65 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -190,10 +190,6 @@ static void parse_attributes (GVfsBackendSftp *backend,
                               GDataInputStream *reply,
                               GFileAttributeMatcher *attribute_matcher);
 
-static void setup_icon (GVfsBackendSftp *op_backend,
-                        GVfsJobMount    *job);
-
-
 G_DEFINE_TYPE (GVfsBackendSftp, g_vfs_backend_sftp, G_VFS_TYPE_BACKEND)
 
 static void
@@ -1695,10 +1691,8 @@ do_mount (GVfsBackend *backend,
   g_vfs_backend_set_display_name (backend, display_name);
   g_free (display_name);
 
-  /* checks for /etc/favicon.png */
-  setup_icon (op_backend, job);
-  
-  /* NOTE: job_succeeded called async from setup_icon reply */
+  g_vfs_backend_set_icon_name (G_VFS_BACKEND (backend), "folder-remote");
+  g_vfs_job_succeeded (G_VFS_JOB (job));
 }
 
 static void
@@ -2432,26 +2426,6 @@ try_open_for_read (GVfsBackend *backend,
   return TRUE;
 }
 
-static gboolean
-try_open_icon_for_read (GVfsBackend *backend,
-                        GVfsJobOpenIconForRead *job,
-                        const char *icon_id)
-{
-  if (g_str_has_prefix (icon_id, "favicon:"))
-    {
-      return try_open_for_read (backend,
-                                G_VFS_JOB_OPEN_FOR_READ (job),
-                                icon_id + sizeof ("favicon:") -1);
-    }
-
-  g_vfs_job_failed (G_VFS_JOB (job),
-                    G_IO_ERROR,
-                    G_IO_ERROR_INVALID_ARGUMENT,
-                    _("Invalid icon_id '%s' in OpenIconForRead"),
-                    icon_id);
-  return TRUE;
-}
-
 static void
 read_reply (GVfsBackendSftp *backend,
             int reply_type,
@@ -4654,56 +4628,6 @@ try_set_attribute (GVfsBackend *backend,
 }
 
 static void
-setup_icon_reply (GVfsBackendSftp *backend,
-                  MultiReply *replies,
-                  int n_replies,
-                  GVfsJob *job,
-                  gpointer user_data)
-{
-  GIcon *icon;
-  gboolean have_favicon;
-  MultiReply *stat_reply;
-
-  have_favicon = FALSE;
-
-  stat_reply = &replies[0];
-  if (stat_reply->type == SSH_FXP_ATTRS)
-    have_favicon = TRUE;
-
-  if (have_favicon)
-    {
-      icon = g_vfs_icon_new (g_vfs_backend_get_mount_spec (G_VFS_BACKEND (backend)),
-                             "favicon:/etc/favicon.png");
-      g_vfs_backend_set_icon (G_VFS_BACKEND (backend), icon);
-      g_object_unref (icon);
-    }
-  else
-    {
-      g_vfs_backend_set_icon_name (G_VFS_BACKEND (backend), "folder-remote");
-    }
-
-  g_vfs_job_succeeded (G_VFS_JOB (job));
-}
-
-/* called from do_mount(); finds out if there's an /etc/favicon.png file; if so, use it as the icon */
-static void
-setup_icon (GVfsBackendSftp *op_backend,
-            GVfsJobMount    *job)
-{
-  GDataOutputStream *command;
-
-  command = new_command_stream (op_backend, SSH_FXP_STAT);
-  put_string (command, "/etc/favicon.png");
-
-  queue_command_streams_and_free (op_backend,
-                                  &command,
-                                  1,
-                                  setup_icon_reply,
-                                  G_VFS_JOB (job),
-                                  NULL);
-}
-
-static void
 g_vfs_backend_sftp_class_init (GVfsBackendSftpClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
@@ -4716,7 +4640,6 @@ g_vfs_backend_sftp_class_init (GVfsBackendSftpClass *klass)
   backend_class->mount = real_do_mount;
   backend_class->try_mount = try_mount;
   backend_class->try_unmount = try_unmount;
-  backend_class->try_open_icon_for_read = try_open_icon_for_read;
   backend_class->try_open_for_read = try_open_for_read;
   backend_class->try_read = try_read;
   backend_class->try_seek_on_read = try_seek_on_read;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]