[Xfce4-commits] r23644 - xfdesktop/trunk/src

Brian Tarricone kelnos at xfce.org
Sat Nov 4 13:27:37 CET 2006


Author: kelnos
Date: 2006-11-04 12:27:37 +0000 (Sat, 04 Nov 2006)
New Revision: 23644

Modified:
   xfdesktop/trunk/src/xfdesktop-file-icon-manager.c
   xfdesktop/trunk/src/xfdesktop-regular-file-icon.c
   xfdesktop/trunk/src/xfdesktop-special-file-icon.c
   xfdesktop/trunk/src/xfdesktop-volume-icon.c
Log:
don't allow linking root items, as thunar-vfs throws a critical warning and
then crashes when you try (bug 2470)


Modified: xfdesktop/trunk/src/xfdesktop-file-icon-manager.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-file-icon-manager.c	2006-11-04 12:20:26 UTC (rev 23643)
+++ xfdesktop/trunk/src/xfdesktop-file-icon-manager.c	2006-11-04 12:27:37 UTC (rev 23644)
@@ -3171,26 +3171,18 @@
                 
                 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;
+                    /* root nodes cause crashes */
+                    if(thunar_vfs_path_is_root(path))
+                        continue;
                     
-                    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);
+                    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);

Modified: xfdesktop/trunk/src/xfdesktop-regular-file-icon.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-regular-file-icon.c	2006-11-04 12:20:26 UTC (rev 23643)
+++ xfdesktop/trunk/src/xfdesktop-regular-file-icon.c	2006-11-04 12:27:37 UTC (rev 23644)
@@ -397,9 +397,9 @@
         ThunarVfsPath *dest_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);
+            return FALSE;
+        
+        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-special-file-icon.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-special-file-icon.c	2006-11-04 12:20:26 UTC (rev 23643)
+++ xfdesktop/trunk/src/xfdesktop-special-file-icon.c	2006-11-04 12:27:37 UTC (rev 23644)
@@ -268,9 +268,9 @@
     
     switch(special_file_icon->priv->type) {
         case XFDESKTOP_SPECIAL_FILE_ICON_FILESYSTEM:
-            /* root dir should always be readable, but move is just impossible,
-             * and copy seems a bit retarded. */
-            actions = GDK_ACTION_LINK;
+            /* move is just impossible, and copy seems a bit retarded.  link
+             * is possible, but thunar-vfs doesn't support it (deliberately). */
+            actions = 0;
             break;
         
         case XFDESKTOP_SPECIAL_FILE_ICON_HOME:
@@ -395,9 +395,9 @@
         return FALSE;
     
     if(thunar_vfs_path_is_root(src_info->path))
-        name = src_info->display_name;
-    else
-        name = thunar_vfs_path_get_name(src_info->path);
+        return FALSE;
+    
+    name = thunar_vfs_path_get_name(src_info->path);
     g_return_val_if_fail(name, FALSE);
     
     dest_path = thunar_vfs_path_relative(special_file_icon->priv->info->path,

Modified: xfdesktop/trunk/src/xfdesktop-volume-icon.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-volume-icon.c	2006-11-04 12:20:26 UTC (rev 23643)
+++ xfdesktop/trunk/src/xfdesktop-volume-icon.c	2006-11-04 12:27:37 UTC (rev 23644)
@@ -337,9 +337,9 @@
         return FALSE;
     
     if(thunar_vfs_path_is_root(src_info->path))
-        name = src_info->display_name;
-    else
-        name = thunar_vfs_path_get_name(src_info->path);
+        return FALSE;
+    
+    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