[Xfce4-commits] r23632 - xfdesktop/trunk/src
Brian Tarricone
kelnos at xfce.org
Sat Nov 4 11:55:42 CET 2006
Author: kelnos
Date: 2006-11-04 10:55:42 +0000 (Sat, 04 Nov 2006)
New Revision: 23632
Modified:
xfdesktop/trunk/src/xfdesktop-file-icon-manager.c
xfdesktop/trunk/src/xfdesktop-regular-file-icon.c
xfdesktop/trunk/src/xfdesktop-volume-icon.c
Log:
this should fix the crash when dragging thunar's 'file system' icon to the
desktop (bug 2470), but it doesn't because thunar-vfs craps out when you try
to do that, for no reason i can see. if benny wants to keep it this way, i'll
have to add a workaround :-p
Modified: xfdesktop/trunk/src/xfdesktop-file-icon-manager.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-file-icon-manager.c 2006-11-04 10:55:02 UTC (rev 23631)
+++ xfdesktop/trunk/src/xfdesktop-file-icon-manager.c 2006-11-04 10:55:42 UTC (rev 23632)
@@ -3105,7 +3105,7 @@
tinfo = xfdesktop_file_icon_peek_info(file_icon);
}
- copy_only = (context->suggested_action != GDK_ACTION_MOVE);
+ copy_only = (context->action != GDK_ACTION_MOVE);
path_list = thunar_vfs_path_list_from_string((gchar *)data->data, NULL);
@@ -3163,21 +3163,32 @@
for(l = path_list; l; l = l->next) {
ThunarVfsPath *path = (ThunarVfsPath *)l->data;
+ ThunarVfsInfo *dinfo = NULL;
/* only work with file:// URIs here */
if(thunar_vfs_path_get_scheme(path) != THUNAR_VFS_PATH_SCHEME_FILE)
continue;
- name = thunar_vfs_path_get_name(path);
+ if(thunar_vfs_path_is_root(path)) {
+ ThunarVfsInfo *dinfo = thunar_vfs_info_new_for_path(path, NULL);
+ if(dinfo)
+ name = dinfo->display_name;
+ else
+ continue;
+ } else
+ name = thunar_vfs_path_get_name(path);
dest_path = thunar_vfs_path_relative(base_dest_path,
name);
dest_path_list = g_list_prepend(dest_path_list, dest_path);
+
+ if(dinfo)
+ thunar_vfs_info_unref(dinfo);
}
thunar_vfs_path_unref(base_dest_path);
dest_path_list = g_list_reverse(dest_path_list);
if(dest_path_list) {
- if(context->suggested_action == GDK_ACTION_LINK && !dest_is_trash)
+ if(context->action == GDK_ACTION_LINK && !dest_is_trash)
job = thunar_vfs_link_files(path_list, dest_path_list, NULL);
else if(copy_only && !dest_is_trash)
job = thunar_vfs_copy_files(path_list, dest_path_list, NULL);
Modified: xfdesktop/trunk/src/xfdesktop-regular-file-icon.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-regular-file-icon.c 2006-11-04 10:55:02 UTC (rev 23631)
+++ xfdesktop/trunk/src/xfdesktop-regular-file-icon.c 2006-11-04 10:55:42 UTC (rev 23632)
@@ -396,7 +396,10 @@
const gchar *name;
ThunarVfsPath *dest_path;
- name = thunar_vfs_path_get_name(src_info->path);
+ if(thunar_vfs_path_is_root(src_info->path))
+ name = src_info->display_name;
+ else
+ name = thunar_vfs_path_get_name(src_info->path);
g_return_val_if_fail(name, FALSE);
dest_path = thunar_vfs_path_relative(regular_file_icon->priv->info->path,
Modified: xfdesktop/trunk/src/xfdesktop-volume-icon.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-volume-icon.c 2006-11-04 10:55:02 UTC (rev 23631)
+++ xfdesktop/trunk/src/xfdesktop-volume-icon.c 2006-11-04 10:55:42 UTC (rev 23632)
@@ -336,7 +336,10 @@
if(!src_info)
return FALSE;
- name = thunar_vfs_path_get_name(src_info->path);
+ if(thunar_vfs_path_is_root(src_info->path))
+ name = src_info->display_name;
+ else
+ name = thunar_vfs_path_get_name(src_info->path);
g_return_val_if_fail(name, FALSE);
dest_path = thunar_vfs_path_relative(volume_icon->priv->info->path,
More information about the Xfce4-commits
mailing list