Mercurial > geeqie
diff src/utilops.c @ 1637:cc3ccf3c7c27
unify code paths for New directory
keep the directory visible after rename
https://sourceforge.net/tracker/?func=detail&aid=1951183&group_id=222125&atid=1054680
author | nadvornik |
---|---|
date | Mon, 08 Jun 2009 19:05:49 +0000 |
parents | 2842a051c870 |
children | c16f499ea1ce |
line wrap: on
line diff
--- a/src/utilops.c Sun Jun 07 10:11:05 2009 +0000 +++ b/src/utilops.c Mon Jun 08 19:05:49 2009 +0000 @@ -935,7 +935,8 @@ gint error = CHANGE_OK; gchar *desc = NULL; - if (ud->type != UTILITY_TYPE_CREATE_FOLDER) + if (ud->type != UTILITY_TYPE_CREATE_FOLDER && + ud->type != UTILITY_TYPE_RENAME_FOLDER) { if (ud->dest_path && !isdir(ud->dest_path)) { @@ -2580,7 +2581,7 @@ } -static void file_util_rename_dir_full(FileData *fd, const gchar *new_path, GtkWidget *parent, UtilityPhase phase) +static void file_util_rename_dir_full(FileData *fd, const gchar *new_path, GtkWidget *parent, UtilityPhase phase, FileUtilDoneFunc done_func, gpointer done_data) { UtilityData *ud; @@ -2594,6 +2595,10 @@ ud->flist = NULL; ud->content_list = NULL; ud->parent = parent; + + ud->done_func = done_func; + ud->done_data = done_data; + ud->dest_path = g_strdup(new_path); ud->messages.title = _("Rename"); ud->messages.question = _("Rename folder?"); @@ -2732,9 +2737,9 @@ file_util_create_dir_full(dir_fd, NULL, parent, UTILITY_PHASE_ENTERING, done_func, done_data); } -void file_util_rename_dir(FileData *source_fd, const gchar *new_path, GtkWidget *parent) +void file_util_rename_dir(FileData *source_fd, const gchar *new_path, GtkWidget *parent, FileUtilDoneFunc done_func, gpointer done_data) { - file_util_rename_dir_full(source_fd, new_path, parent, UTILITY_PHASE_ENTERING); + file_util_rename_dir_full(source_fd, new_path, parent, UTILITY_PHASE_ENTERING, done_func, done_data); }