Skip to content

Commit

Permalink
allow only existing folders in destination dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Jul 26, 2008
1 parent 0ec9605 commit 12bc9f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ typedef enum {
CHANGE_NO_WRITE_PERM_DEST_DIR = 1 << 6,
CHANGE_NO_WRITE_PERM_DEST = 1 << 7,
CHANGE_DEST_EXISTS = 1 << 8,
CHANGE_NO_SRC = 1 << 9
CHANGE_NO_SRC = 1 << 9,
CHANGE_GENERIC_ERROR = 1 << 16
} ChangeError;

#define MAX_SPLIT_IMAGES 4
Expand Down
8 changes: 6 additions & 2 deletions src/utilops.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,12 @@ void file_util_check_ci(UtilityData *ud)
gint error = CHANGE_OK;
gchar *desc = NULL;

if (ud->dir_fd)
if (ud->dest_path && !isdir(ud->dest_path))
{
error = CHANGE_GENERIC_ERROR;
desc = g_strdup_printf(_("%s is not a directory"), ud->dest_path);
}
else if (ud->dir_fd)
{
error = file_data_sc_verify_ci(ud->dir_fd);
if (error) desc = file_data_get_error_string(error);
Expand All @@ -883,7 +888,6 @@ void file_util_check_ci(UtilityData *ud)
return;
}

// FIXME: the dialogs needs better error messages with a list of files and error descriptions
if (!(error & CHANGE_ERROR_MASK))
{
/* just a warning */
Expand Down

0 comments on commit 12bc9f4

Please sign in to comment.