Mercurial > geeqie
comparison src/filedata.c @ 934:6aa60ae6f274
fixed renaming of directories
author | nadvornik |
---|---|
date | Sat, 26 Jul 2008 19:33:36 +0000 |
parents | 8c5ba3e94e54 |
children | 77e6f7530c88 |
comparison
equal
deleted
inserted
replaced
933:8c5ba3e94e54 | 934:6aa60ae6f274 |
---|---|
1449 GList *work; | 1449 GList *work; |
1450 gchar *dest_path_full = NULL; | 1450 gchar *dest_path_full = NULL; |
1451 | 1451 |
1452 if (fd->parent) fd = fd->parent; | 1452 if (fd->parent) fd = fd->parent; |
1453 | 1453 |
1454 if (!dest_path) dest_path = fd->path; | 1454 if (!dest_path) |
1455 | 1455 { |
1456 if (!strchr(dest_path, G_DIR_SEPARATOR)) /* we got only filename, not a full path */ | 1456 dest_path = fd->path; |
1457 } | |
1458 else if (!strchr(dest_path, G_DIR_SEPARATOR)) /* we got only filename, not a full path */ | |
1457 { | 1459 { |
1458 gchar *dir = remove_level_from_path(fd->path); | 1460 gchar *dir = remove_level_from_path(fd->path); |
1459 | 1461 |
1460 dest_path_full = g_build_filename(dir, dest_path, NULL); | 1462 dest_path_full = g_build_filename(dir, dest_path, NULL); |
1461 g_free(dir); | 1463 g_free(dir); |
1462 dest_path = dest_path_full; | 1464 dest_path = dest_path_full; |
1463 } | 1465 } |
1464 | 1466 else if (fd->change->type != FILEDATA_CHANGE_RENAME && isdir(dest_path)) /* rename should not move files between directories */ |
1465 if (isdir(dest_path)) | |
1466 { | 1467 { |
1467 dest_path_full = g_build_filename(dest_path, fd->name, NULL); | 1468 dest_path_full = g_build_filename(dest_path, fd->name, NULL); |
1468 dest_path = dest_path_full; | 1469 dest_path = dest_path_full; |
1469 } | 1470 } |
1470 | 1471 |