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);
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;
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;