[Xfce4-commits] <xfdesktop:master> Remove a bunch of ThunarVFS code that is no longer being used.

Jannis Pohlmann noreply at xfce.org
Tue Nov 2 01:14:49 CET 2010


Updating branch refs/heads/master
         to 4d92a998de3b8b2e88e94cd2bf3978787d7b32e1 (commit)
       from 8fb00c02d5a5225ba1619357173f0abb6c27a21b (commit)

commit 4d92a998de3b8b2e88e94cd2bf3978787d7b32e1
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Sat Oct 30 00:14:53 2010 +0200

    Remove a bunch of ThunarVFS code that is no longer being used.

 src/xfdesktop-file-icon.c         |   15 ---------------
 src/xfdesktop-file-icon.h         |   10 ----------
 src/xfdesktop-regular-file-icon.c |   36 +++++-------------------------------
 src/xfdesktop-special-file-icon.c |   28 ++++------------------------
 src/xfdesktop-volume-icon.c       |   13 -------------
 5 files changed, 9 insertions(+), 93 deletions(-)

diff --git a/src/xfdesktop-file-icon.c b/src/xfdesktop-file-icon.c
index 8d60c86..98cc4cc 100644
--- a/src/xfdesktop-file-icon.c
+++ b/src/xfdesktop-file-icon.c
@@ -96,21 +96,6 @@ xfdesktop_file_icon_activated(XfdesktopIcon *icon)
 }
 
 
-G_CONST_RETURN ThunarVfsInfo *
-xfdesktop_file_icon_peek_info(XfdesktopFileIcon *icon)
-{
-    XfdesktopFileIconClass *klass;
-    
-    g_return_val_if_fail(XFDESKTOP_IS_FILE_ICON(icon), NULL);
-    
-    klass = XFDESKTOP_FILE_ICON_GET_CLASS(icon);
-    
-    if(klass->peek_info)
-       return klass->peek_info(icon);
-    else
-        return NULL;
-}
-
 GFileInfo *
 xfdesktop_file_icon_peek_file_info(XfdesktopFileIcon *icon)
 {
diff --git a/src/xfdesktop-file-icon.h b/src/xfdesktop-file-icon.h
index 6a98d00..a8e431c 100644
--- a/src/xfdesktop-file-icon.h
+++ b/src/xfdesktop-file-icon.h
@@ -25,8 +25,6 @@
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 
-#include <thunar-vfs/thunar-vfs.h>
-
 #include "xfdesktop-icon.h"
 
 G_BEGIN_DECLS
@@ -53,7 +51,6 @@ struct _XfdesktopFileIconClass
     XfdesktopIconClass parent;
     
     /*< virtual functions >*/
-    G_CONST_RETURN ThunarVfsInfo *(*peek_info)(XfdesktopFileIcon *icon);
     GFileInfo *(*peek_file_info)(XfdesktopFileIcon *icon);
     GFileInfo *(*peek_filesystem_info)(XfdesktopFileIcon *icon);
     GFile *(*peek_file)(XfdesktopFileIcon *icon);
@@ -65,7 +62,6 @@ struct _XfdesktopFileIconClass
 
 GType xfdesktop_file_icon_get_type(void) G_GNUC_CONST;
 
-G_CONST_RETURN ThunarVfsInfo *xfdesktop_file_icon_peek_info(XfdesktopFileIcon *icon);
 GFileInfo *xfdesktop_file_icon_peek_file_info(XfdesktopFileIcon *icon);
 GFileInfo *xfdesktop_file_icon_peek_filesystem_info(XfdesktopFileIcon *icon);
 GFile *xfdesktop_file_icon_peek_file(XfdesktopFileIcon *icon);
@@ -76,12 +72,6 @@ gboolean xfdesktop_file_icon_can_rename_file(XfdesktopFileIcon *icon);
 
 gboolean xfdesktop_file_icon_can_delete_file(XfdesktopFileIcon *icon);
 
-void xfdesktop_file_icon_add_active_job(XfdesktopFileIcon *icon,
-                                        ThunarVfsJob *job);
-gboolean xfdesktop_file_icon_remove_active_job(XfdesktopFileIcon *icon,
-                                               ThunarVfsJob *job);
-
-
 G_END_DECLS
 
 #endif  /* __XFDESKTOP_FILE_ICON_H__ */
diff --git a/src/xfdesktop-regular-file-icon.c b/src/xfdesktop-regular-file-icon.c
index 0522b4b..c46a639 100644
--- a/src/xfdesktop-regular-file-icon.c
+++ b/src/xfdesktop-regular-file-icon.c
@@ -67,7 +67,6 @@ struct _XfdesktopRegularFileIconPrivate
     GFileInfo *file_info;
     GFileInfo *filesystem_info;
     GFile *file;
-    ThunarVfsInfo *info;
     GdkScreen *gscreen;
 };
 
@@ -83,7 +82,6 @@ static gboolean xfdesktop_regular_file_icon_do_drop_dest(XfdesktopIcon *icon,
                                                          XfdesktopIcon *src_icon,
                                                          GdkDragAction action);
 
-static G_CONST_RETURN ThunarVfsInfo *xfdesktop_regular_file_icon_peek_info(XfdesktopFileIcon *icon);
 static GFileInfo *xfdesktop_regular_file_icon_peek_file_info(XfdesktopFileIcon *icon);
 static GFileInfo *xfdesktop_regular_file_icon_peek_filesystem_info(XfdesktopFileIcon *icon);
 static GFile *xfdesktop_regular_file_icon_peek_file(XfdesktopFileIcon *icon);
@@ -129,7 +127,6 @@ xfdesktop_regular_file_icon_class_init(XfdesktopRegularFileIconClass *klass)
     icon_class->get_allowed_drop_actions = xfdesktop_regular_file_icon_get_allowed_drop_actions;
     icon_class->do_drop_dest = xfdesktop_regular_file_icon_do_drop_dest;
     
-    file_icon_class->peek_info = xfdesktop_regular_file_icon_peek_info;
     file_icon_class->peek_file_info = xfdesktop_regular_file_icon_peek_file_info;
     file_icon_class->peek_filesystem_info = xfdesktop_regular_file_icon_peek_filesystem_info;
     file_icon_class->peek_file = xfdesktop_regular_file_icon_peek_file;
@@ -160,9 +157,6 @@ xfdesktop_regular_file_icon_finalize(GObject *obj)
     if(icon->priv->pix)
         g_object_unref(G_OBJECT(icon->priv->pix));
     
-    if(icon->priv->info)
-        thunar_vfs_info_unref(icon->priv->info);
-
     if(icon->priv->file_info)
         g_object_unref(icon->priv->file_info);
 
@@ -301,8 +295,11 @@ xfdesktop_regular_file_icon_peek_pixbuf(XfdesktopIcon *icon,
 static G_CONST_RETURN gchar *
 xfdesktop_regular_file_icon_peek_label(XfdesktopIcon *icon)
 {
+    GFileInfo *info = XFDESKTOP_REGULAR_FILE_ICON(icon)->priv->file_info;
+
     g_return_val_if_fail(XFDESKTOP_IS_REGULAR_FILE_ICON(icon), NULL);
-    return XFDESKTOP_REGULAR_FILE_ICON(icon)->priv->info->display_name;
+
+    return info ? g_file_info_get_display_name(info) : NULL;
 }
 
 static GdkDragAction
@@ -487,7 +484,7 @@ xfdesktop_regular_file_can_write_parent(XfdesktopFileIcon *icon)
     GFileInfo *parent_info;
     gboolean writable;
 
-    g_return_val_if_fail(file_icon && file_icon->priv->info, FALSE);
+    g_return_val_if_fail(file_icon, FALSE);
 
     parent_file = g_file_get_parent(file_icon->priv->file);
     if(!parent_file)
@@ -511,13 +508,6 @@ xfdesktop_regular_file_can_write_parent(XfdesktopFileIcon *icon)
 
 }
 
-static G_CONST_RETURN ThunarVfsInfo *
-xfdesktop_regular_file_icon_peek_info(XfdesktopFileIcon *icon)
-{
-    g_return_val_if_fail(XFDESKTOP_IS_REGULAR_FILE_ICON(icon), NULL);
-    return XFDESKTOP_REGULAR_FILE_ICON(icon)->priv->info;
-}
-
 static GFileInfo *
 xfdesktop_regular_file_icon_peek_file_info(XfdesktopFileIcon *icon)
 {
@@ -544,10 +534,8 @@ xfdesktop_regular_file_icon_update_file_info(XfdesktopFileIcon *icon,
                                              GFileInfo *info)
 {
     XfdesktopRegularFileIcon *regular_file_icon = XFDESKTOP_REGULAR_FILE_ICON(icon);
-    ThunarVfsPath *path;
     const gchar *old_display_name, *new_display_name;
     gboolean label_changed = FALSE;
-    gchar *uri;
     
     g_return_if_fail(XFDESKTOP_IS_REGULAR_FILE_ICON(icon));
     g_return_if_fail(G_IS_FILE_INFO(info));
@@ -573,12 +561,6 @@ xfdesktop_regular_file_icon_update_file_info(XfdesktopFileIcon *icon,
                                                                             XFDESKTOP_FILESYSTEM_INFO_NAMESPACE,
                                                                             NULL, NULL);
 
-    uri = g_file_get_uri(regular_file_icon->priv->file);
-    path = thunar_vfs_path_new(uri, NULL);
-    regular_file_icon->priv->info = thunar_vfs_info_new_for_path(path, NULL);
-    thunar_vfs_path_unref(path);
-    g_free(uri);
-    
     if(label_changed)
         xfdesktop_icon_label_changed(XFDESKTOP_ICON(icon));
     
@@ -596,8 +578,6 @@ xfdesktop_regular_file_icon_new(GFile *file,
                                 GdkScreen *screen)
 {
     XfdesktopRegularFileIcon *regular_file_icon;
-    ThunarVfsPath *path;
-    gchar *uri;
 
     g_return_val_if_fail(G_IS_FILE(file), NULL);
     g_return_val_if_fail(G_IS_FILE_INFO(file_info), NULL);
@@ -613,12 +593,6 @@ xfdesktop_regular_file_icon_new(GFile *file,
                                                                             XFDESKTOP_FILESYSTEM_INFO_NAMESPACE,
                                                                             NULL, NULL);
 
-    uri = g_file_get_uri(file);
-    path = thunar_vfs_path_new(uri, NULL);
-    regular_file_icon->priv->info = thunar_vfs_info_new_for_path(path, NULL);
-    thunar_vfs_path_unref(path);
-    g_free(uri);
-    
     /* query file information from GIO */
     regular_file_icon->priv->file_info = g_file_query_info(regular_file_icon->priv->file,
                                                            XFDESKTOP_FILE_INFO_NAMESPACE,
diff --git a/src/xfdesktop-special-file-icon.c b/src/xfdesktop-special-file-icon.c
index d15e615..8bad3f7 100644
--- a/src/xfdesktop-special-file-icon.c
+++ b/src/xfdesktop-special-file-icon.c
@@ -61,7 +61,6 @@ struct _XfdesktopSpecialFileIconPrivate
     GdkPixbuf *pix;
     gchar *tooltip;
     gint cur_pix_size;
-    ThunarVfsInfo *info;
     GFileInfo *file_info;
     GFileInfo *filesystem_info;
     GFile *file;
@@ -86,7 +85,6 @@ static gboolean xfdesktop_special_file_icon_do_drop_dest(XfdesktopIcon *icon,
 static gboolean xfdesktop_special_file_icon_populate_context_menu(XfdesktopIcon *icon,
                                                                   GtkWidget *menu);
 
-static G_CONST_RETURN ThunarVfsInfo *xfdesktop_special_file_icon_peek_info(XfdesktopFileIcon *icon);
 static GFileInfo *xfdesktop_special_file_icon_peek_file_info(XfdesktopFileIcon *icon);
 static GFileInfo *xfdesktop_special_file_icon_peek_filesystem_info(XfdesktopFileIcon *icon);
 static GFile *xfdesktop_special_file_icon_peek_file(XfdesktopFileIcon *icon);
@@ -131,7 +129,6 @@ xfdesktop_special_file_icon_class_init(XfdesktopSpecialFileIconClass *klass)
     icon_class->do_drop_dest = xfdesktop_special_file_icon_do_drop_dest;
     icon_class->populate_context_menu = xfdesktop_special_file_icon_populate_context_menu;
     
-    file_icon_class->peek_info = xfdesktop_special_file_icon_peek_info;
     file_icon_class->peek_file_info = xfdesktop_special_file_icon_peek_file_info;
     file_icon_class->peek_filesystem_info = xfdesktop_special_file_icon_peek_filesystem_info;
     file_icon_class->peek_file = xfdesktop_special_file_icon_peek_file;
@@ -165,9 +162,6 @@ xfdesktop_special_file_icon_finalize(GObject *obj)
     if(icon->priv->file_info)
         g_object_unref(icon->priv->file_info);
     
-    if(icon->priv->info)
-        thunar_vfs_info_unref(icon->priv->info);
-    
     if(icon->priv->tooltip)
         g_free(icon->priv->tooltip);
     
@@ -247,11 +241,14 @@ static G_CONST_RETURN gchar *
 xfdesktop_special_file_icon_peek_label(XfdesktopIcon *icon)
 {
     XfdesktopSpecialFileIcon *special_file_icon = XFDESKTOP_SPECIAL_FILE_ICON(icon);
+    GFileInfo *info = special_file_icon->priv->file_info;
     
     if(XFDESKTOP_SPECIAL_FILE_ICON_HOME == special_file_icon->priv->type)
         return _("Home");
+    else if(XFDESKTOP_SPECIAL_FILE_ICON_FILESYSTEM == special_file_icon->priv->type)
+        return _("File System");
     else
-        return special_file_icon->priv->info->display_name;
+        return info ? g_file_info_get_display_name(info) : NULL;
 }
 
 static GdkDragAction
@@ -603,14 +600,6 @@ xfdesktop_special_file_icon_populate_context_menu(XfdesktopIcon *icon,
     return TRUE;
 }
 
-
-static G_CONST_RETURN ThunarVfsInfo *
-xfdesktop_special_file_icon_peek_info(XfdesktopFileIcon *icon)
-{
-    g_return_val_if_fail(XFDESKTOP_IS_SPECIAL_FILE_ICON(icon), NULL);
-    return XFDESKTOP_SPECIAL_FILE_ICON(icon)->priv->info;
-}
-
 static GFileInfo *
 xfdesktop_special_file_icon_peek_file_info(XfdesktopFileIcon *icon)
 {
@@ -639,9 +628,7 @@ xfdesktop_special_file_icon_new(XfdesktopSpecialFileIconType type,
                                 GdkScreen *screen)
 {
     XfdesktopSpecialFileIcon *special_file_icon;
-    ThunarVfsPath *path = NULL;
     GFile *file = NULL;
-    gchar *uri;
     
     switch(type) {
         case XFDESKTOP_SPECIAL_FILE_ICON_FILESYSTEM:
@@ -680,13 +667,6 @@ xfdesktop_special_file_icon_new(XfdesktopSpecialFileIconType type,
                                                                             XFDESKTOP_FILESYSTEM_INFO_NAMESPACE,
                                                                             NULL, NULL);
 
-    /* query a ThunarVfsInfo for the icon URI */
-    uri = g_file_get_uri(file);
-    path = thunar_vfs_path_new(uri, NULL);
-    special_file_icon->priv->info = thunar_vfs_info_new_for_path(path, NULL);
-    thunar_vfs_path_unref(path);
-    g_free(uri);
-    
     g_signal_connect_swapped(G_OBJECT(gtk_icon_theme_get_for_screen(screen)),
                              "changed",
                              G_CALLBACK(xfdesktop_special_file_icon_invalidate_pixbuf),
diff --git a/src/xfdesktop-volume-icon.c b/src/xfdesktop-volume-icon.c
index 5c96f2d..0af4902 100644
--- a/src/xfdesktop-volume-icon.c
+++ b/src/xfdesktop-volume-icon.c
@@ -59,7 +59,6 @@ struct _XfdesktopVolumeIconPrivate
     gint cur_pix_size;
     gchar *label;
     GVolume *volume;
-    ThunarVfsInfo *info;
     GFileInfo *file_info;
     GFileInfo *filesystem_info;
     GFile *file;
@@ -80,7 +79,6 @@ static gboolean xfdesktop_volume_icon_do_drop_dest(XfdesktopIcon *icon,
 static gboolean xfdesktop_volume_icon_populate_context_menu(XfdesktopIcon *icon,
                                                             GtkWidget *menu);
 
-static G_CONST_RETURN ThunarVfsInfo *xfdesktop_volume_icon_peek_info(XfdesktopFileIcon *icon);
 static GFileInfo *xfdesktop_volume_icon_peek_file_info(XfdesktopFileIcon *icon);
 static GFileInfo *xfdesktop_volume_icon_peek_filesystem_info(XfdesktopFileIcon *icon);
 static GFile *xfdesktop_volume_icon_peek_file(XfdesktopFileIcon *icon);
@@ -128,7 +126,6 @@ xfdesktop_volume_icon_class_init(XfdesktopVolumeIconClass *klass)
     icon_class->populate_context_menu = xfdesktop_volume_icon_populate_context_menu;
     icon_class->activated = xfdesktop_volume_icon_activated;
     
-    file_icon_class->peek_info = xfdesktop_volume_icon_peek_info;
     file_icon_class->peek_file_info = xfdesktop_volume_icon_peek_file_info;
     file_icon_class->peek_filesystem_info = xfdesktop_volume_icon_peek_filesystem_info;
     file_icon_class->peek_file = xfdesktop_volume_icon_peek_file;
@@ -162,9 +159,6 @@ xfdesktop_volume_icon_finalize(GObject *obj)
     if(icon->priv->pix)
         g_object_unref(G_OBJECT(icon->priv->pix));
     
-    if(icon->priv->info)
-        thunar_vfs_info_unref(icon->priv->info);
-
     if(icon->priv->file_info)
         g_object_unref(icon->priv->file_info);
 
@@ -710,13 +704,6 @@ xfdesktop_volume_icon_populate_context_menu(XfdesktopIcon *icon,
 }
 
 
-static G_CONST_RETURN ThunarVfsInfo *
-xfdesktop_volume_icon_peek_info(XfdesktopFileIcon *icon)
-{
-    g_return_val_if_fail(XFDESKTOP_IS_VOLUME_ICON(icon), NULL);
-    return XFDESKTOP_VOLUME_ICON(icon)->priv->info;
-}
-
 static GFileInfo *
 xfdesktop_volume_icon_peek_file_info(XfdesktopFileIcon *icon)
 {



More information about the Xfce4-commits mailing list