changeset 850:ff937cdfaee9

fixed in-place renaming
author nadvornik
date Sun, 22 Jun 2008 09:40:57 +0000
parents db68d673448f
children 6e521e987105
files src/view_file_list.c
diffstat 1 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/view_file_list.c	Sun Jun 22 09:19:42 2008 +0000
+++ b/src/view_file_list.c	Sun Jun 22 09:40:57 2008 +0000
@@ -428,16 +428,9 @@
 		}
 	else
 		{
-		gint row = vf_index_by_path(vf, old_path);
-		if (row >= 0)
-			{
-			GList *work = g_list_nth(vf->list, row);
-			FileData *fd = work->data;
-			
-			file_util_rename_simple(fd, new_path, vf->listview);
-
-			}
-
+		FileData *fd = file_data_new_simple(old_path); /* get the fd from cache */
+		file_util_rename_simple(fd, new_path, vf->listview);
+		file_data_unref(fd);
 		}
 	g_free(old_path);
 	g_free(new_path);