[Xfce4-commits] <xfdesktop:jannis/port-to-gio> Remove xfdesktop_file_icon_rename_file().

Jannis Pohlmann noreply at xfce.org
Fri Oct 22 13:14:01 CEST 2010


Updating branch refs/heads/jannis/port-to-gio
         to 5576ca9dac83187fc3d4760de274be537793a9c6 (commit)
       from dd52df43423c03ff543e4c1aa0598dbd38f3964b (commit)

commit 5576ca9dac83187fc3d4760de274be537793a9c6
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Fri Oct 22 13:13:15 2010 +0200

    Remove xfdesktop_file_icon_rename_file().
    
    We no longer need this because renaming is done in Thunar now.

 src/xfdesktop-file-icon.c         |   17 -----------------
 src/xfdesktop-file-icon.h         |    3 ---
 src/xfdesktop-regular-file-icon.c |   32 --------------------------------
 3 files changed, 0 insertions(+), 52 deletions(-)

diff --git a/src/xfdesktop-file-icon.c b/src/xfdesktop-file-icon.c
index 78eb518..337680d 100644
--- a/src/xfdesktop-file-icon.c
+++ b/src/xfdesktop-file-icon.c
@@ -227,23 +227,6 @@ xfdesktop_file_icon_can_rename_file(XfdesktopFileIcon *icon)
 }
 
 gboolean
-xfdesktop_file_icon_rename_file(XfdesktopFileIcon *icon,
-                                const gchar *new_name)
-{
-    XfdesktopFileIconClass *klass;
-    
-    g_return_val_if_fail(XFDESKTOP_IS_FILE_ICON(icon), FALSE);
-    g_return_val_if_fail(new_name && *new_name, FALSE);
-    
-    klass = XFDESKTOP_FILE_ICON_GET_CLASS(icon);
-    
-    if(klass->rename_file)
-       return klass->rename_file(icon, new_name);
-    else
-        return FALSE;
-}
-
-gboolean
 xfdesktop_file_icon_can_delete_file(XfdesktopFileIcon *icon)
 {
     XfdesktopFileIconClass *klass;
diff --git a/src/xfdesktop-file-icon.h b/src/xfdesktop-file-icon.h
index b3b51d4..fb8c2b4 100644
--- a/src/xfdesktop-file-icon.h
+++ b/src/xfdesktop-file-icon.h
@@ -61,7 +61,6 @@ struct _XfdesktopFileIconClass
     void (*update_file_info)(XfdesktopFileIcon *icon, GFileInfo *info);
     
     gboolean (*can_rename_file)(XfdesktopFileIcon *icon);
-    gboolean (*rename_file)(XfdesktopFileIcon *icon, const gchar *new_name);
     
     gboolean (*can_delete_file)(XfdesktopFileIcon *icon);
     gboolean (*delete_file)(XfdesktopFileIcon *icon);
@@ -79,8 +78,6 @@ void xfdesktop_file_icon_update_file_info(XfdesktopFileIcon *icon,
                                           GFileInfo *info);
 
 gboolean xfdesktop_file_icon_can_rename_file(XfdesktopFileIcon *icon);
-gboolean xfdesktop_file_icon_rename_file(XfdesktopFileIcon *icon,
-                                         const gchar *new_name);
 
 gboolean xfdesktop_file_icon_can_delete_file(XfdesktopFileIcon *icon);
 gboolean xfdesktop_file_icon_delete_file(XfdesktopFileIcon *icon);
diff --git a/src/xfdesktop-regular-file-icon.c b/src/xfdesktop-regular-file-icon.c
index be52c28..1e08508 100644
--- a/src/xfdesktop-regular-file-icon.c
+++ b/src/xfdesktop-regular-file-icon.c
@@ -92,8 +92,6 @@ static void xfdesktop_regular_file_icon_update_info(XfdesktopFileIcon *icon,
 static void xfdesktop_regular_file_icon_update_file_info(XfdesktopFileIcon *icon,
                                                          GFileInfo *info);
 static gboolean xfdesktop_regular_file_can_write_parent(XfdesktopFileIcon *icon);
-static gboolean xfdesktop_regular_file_icon_rename_file(XfdesktopFileIcon *icon,
-                                                        const gchar *new_name);
 static gboolean xfdesktop_regular_file_icon_delete_file(XfdesktopFileIcon *icon);
 
 #ifdef HAVE_THUNARX
@@ -144,7 +142,6 @@ xfdesktop_regular_file_icon_class_init(XfdesktopRegularFileIconClass *klass)
     file_icon_class->update_info = xfdesktop_regular_file_icon_update_info;
     file_icon_class->update_file_info = xfdesktop_regular_file_icon_update_file_info;
     file_icon_class->can_rename_file = xfdesktop_regular_file_can_write_parent;
-    file_icon_class->rename_file = xfdesktop_regular_file_icon_rename_file;
     file_icon_class->can_delete_file = xfdesktop_regular_file_can_write_parent;
     file_icon_class->delete_file = xfdesktop_regular_file_icon_delete_file;
 }
@@ -616,35 +613,6 @@ xfdesktop_regular_file_icon_delete_file(XfdesktopFileIcon *icon)
     return (job != NULL);
 }
 
-static gboolean
-xfdesktop_regular_file_icon_rename_file(XfdesktopFileIcon *icon,
-                                        const gchar *new_name)
-{
-    XfdesktopRegularFileIcon *regular_file_icon = XFDESKTOP_REGULAR_FILE_ICON(icon);
-    GError *error = NULL;
-    
-    g_return_val_if_fail(XFDESKTOP_IS_REGULAR_FILE_ICON(icon) && new_name
-                         && *new_name, FALSE);
-    
-    if(!thunar_vfs_info_rename(regular_file_icon->priv->info, new_name, &error)) {
-        GtkWidget *icon_view = xfdesktop_icon_peek_icon_view(XFDESKTOP_ICON(icon));
-        GtkWidget *toplevel = gtk_widget_get_toplevel(icon_view);
-        gchar *primary = g_markup_printf_escaped(_("Failed to rename \"%s\" to \"%s\":"),
-                                                 regular_file_icon->priv->info->display_name,
-                                                 new_name);
-        xfce_message_dialog(GTK_WINDOW(toplevel), _("Error"),
-                            GTK_STOCK_DIALOG_ERROR,
-                            primary, error->message,
-                            GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT, NULL);
-        g_free(primary);
-        g_error_free(error);
-        
-        return FALSE;
-    }
-    
-    return TRUE;
-}
-
 static G_CONST_RETURN ThunarVfsInfo *
 xfdesktop_regular_file_icon_peek_info(XfdesktopFileIcon *icon)
 {



More information about the Xfce4-commits mailing list