diff src/filedata.c @ 934:6aa60ae6f274

fixed renaming of directories
author nadvornik
date Sat, 26 Jul 2008 19:33:36 +0000
parents 8c5ba3e94e54
children 77e6f7530c88
line wrap: on
line diff
--- a/src/filedata.c	Sat Jul 26 19:01:20 2008 +0000
+++ b/src/filedata.c	Sat Jul 26 19:33:36 2008 +0000
@@ -1451,9 +1451,11 @@
 	
 	if (fd->parent) fd = fd->parent;
 	
-	if (!dest_path) dest_path = fd->path;
-	
-	if (!strchr(dest_path, G_DIR_SEPARATOR)) /* we got only filename, not a full path */
+	if (!dest_path) 
+		{
+		dest_path = fd->path;
+		}
+	else if (!strchr(dest_path, G_DIR_SEPARATOR)) /* we got only filename, not a full path */
 		{
 		gchar *dir = remove_level_from_path(fd->path);
 		
@@ -1461,8 +1463,7 @@
 		g_free(dir);
 		dest_path = dest_path_full;
 		}
-	
-	if (isdir(dest_path))
+	else if (fd->change->type != FILEDATA_CHANGE_RENAME && isdir(dest_path)) /* rename should not move files between directories */
 		{
 		dest_path_full = g_build_filename(dest_path, fd->name, NULL);
 		dest_path = dest_path_full;