# HG changeset patch # User nadvornik # Date 1217100816 0 # Node ID 6aa60ae6f27478543a2617485e1380b33740e512 # Parent 8c5ba3e94e54301949218fcf4a3b0ad5d5585433 fixed renaming of directories diff -r 8c5ba3e94e54 -r 6aa60ae6f274 src/filedata.c --- 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; diff -r 8c5ba3e94e54 -r 6aa60ae6f274 src/utilops.c --- a/src/utilops.c Sat Jul 26 19:01:20 2008 +0000 +++ b/src/utilops.c Sat Jul 26 19:33:36 2008 +0000 @@ -1482,10 +1482,13 @@ case UTILITY_TYPE_COPY: case UTILITY_TYPE_MOVE: case UTILITY_TYPE_FILTER: - case UTILITY_TYPE_RENAME_FOLDER: case UTILITY_TYPE_CREATE_FOLDER: file_util_dialog_init_dest_folder(ud); break; + case UTILITY_TYPE_RENAME_FOLDER: + ud->phase = UTILITY_PHASE_CANCEL; /* FIXME - not handled for now */ + file_util_dialog_run(ud); + return; } ud->phase = UTILITY_PHASE_ENTERING; break;