Skip to content

Commit

Permalink
fixed renaming of directories
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Jul 26, 2008
1 parent f7c504c commit b90ac50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/filedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,18 +1451,19 @@ static void file_data_sc_update_ci(FileData *fd, const gchar *dest_path)

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

dest_path_full = g_build_filename(dir, dest_path, NULL);
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;
Expand Down
5 changes: 4 additions & 1 deletion src/utilops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,10 +1482,13 @@ void file_util_dialog_run(UtilityData *ud)
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;
Expand Down

0 comments on commit b90ac50

Please sign in to comment.