2.5 filebrowser
[blender-staging.git] / source / blender / editors / space_file / filesel.c
index b0bd3a9a5e7b78a8718f4b007fb9c7f250b269fb..e9e09d8f60b2cce3c1ce512bf49cb887c8b6d453 100644 (file)
@@ -124,7 +124,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
        if (op) {
                BLI_strncpy(params->title, op->type->name, sizeof(params->title));
 
-               params->type = RNA_int_get(op->ptr, "type");
+               params->type = RNA_int_get(op->ptr, "filemode");
 
                if (RNA_property_is_set(op->ptr, "path")) {
                        RNA_string_get(op->ptr, "path", name);
@@ -152,8 +152,9 @@ short ED_fileselect_set_params(SpaceFile *sfile)
                if (params->filter != 0)
                        params->flag |= FILE_FILTER;
 
+               params->flag |= FILE_HIDE_DOT;
+
                if (params->type == FILE_LOADLIB) {
-                       params->flag |= FILE_HIDE_DOT;
                        params->flag |= RNA_boolean_get(op->ptr, "link") ? FILE_LINK : 0;
                        params->flag |= RNA_boolean_get(op->ptr, "autoselect") ? FILE_AUTOSELECT : 0;
                        params->flag |= RNA_boolean_get(op->ptr, "active_layer") ? FILE_ACTIVELAY : 0;
@@ -166,20 +167,19 @@ short ED_fileselect_set_params(SpaceFile *sfile)
                
        } else {
                /* default values, if no operator */
+               params->type = FILE_UNIX;
                params->flag |= FILE_HIDE_DOT;
                params->display = FILE_SHORTDISPLAY;
                params->filter = 0;
                params->sort = FILE_SORT_ALPHA;
        }
 
-       /* new params, refresh file list */
-       if(sfile->files) filelist_free(sfile->files);
-
        return 1;
 }
 
 void ED_fileselect_reset_params(SpaceFile *sfile)
 {
+       sfile->params->type = FILE_UNIX;
        sfile->params->flag = 0;
        sfile->params->title[0] = '\0';
 }