allow only existing folders in destination dialog
authorVladimir Nadvornik <nadvornik@suse.cz>
Sat, 26 Jul 2008 18:17:56 +0000 (18:17 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Sat, 26 Jul 2008 18:17:56 +0000 (18:17 +0000)
http://sourceforge.net/tracker/index.php?func=detail&aid=2011243&group_id=222125&atid=1054680

src/typedefs.h
src/utilops.c

index 49a6598..c8754ad 100644 (file)
@@ -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
index fb55d65..752f9d8 100644 (file)
@@ -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);
@@ -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 */