rename RNA_property_is_set() --> RNA_struct_property_is_set() in preperation to add...
[blender.git] / source / blender / editors / space_file / filesel.c
index 29d8242e26de7d0e0e2a5dde570abf0ca33ebfd3..bf31775a349d8e0c864739a644fa8240b1fe2cc8 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -132,7 +130,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
                else
                        params->type = FILE_SPECIAL;
 
-               if (is_filepath && RNA_property_is_set(op->ptr, "filepath")) {
+               if (is_filepath && RNA_struct_property_is_set(op->ptr, "filepath")) {
                        char name[FILE_MAX];
                        RNA_string_get(op->ptr, "filepath", name);
                        if (params->type == FILE_LOADLIB) {
@@ -144,12 +142,12 @@ short ED_fileselect_set_params(SpaceFile *sfile)
                        }
                }
                else {
-                       if (is_directory && RNA_property_is_set(op->ptr, "directory")) {
+                       if (is_directory && RNA_struct_property_is_set(op->ptr, "directory")) {
                                RNA_string_get(op->ptr, "directory", params->dir);
                                sfile->params->file[0]= '\0';
                        }
 
-                       if (is_filename && RNA_property_is_set(op->ptr, "filename")) {
+                       if (is_filename && RNA_struct_property_is_set(op->ptr, "filename")) {
                                RNA_string_get(op->ptr, "filename", params->file);
                        }
                }
@@ -228,7 +226,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
                }
 
                if (is_relative_path) {
-                       if (!RNA_property_is_set(op->ptr, "relative_path")) {
+                       if (!RNA_struct_property_is_set(op->ptr, "relative_path")) {
                                RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
                        }
                }
@@ -669,9 +667,13 @@ void autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v))
 
 void ED_fileselect_clear(struct bContext *C, struct SpaceFile *sfile)
 {
-       thumbnails_stop(sfile->files, C);
-       filelist_freelib(sfile->files);
-       filelist_free(sfile->files);
+       /* only NULL in rare cases - [#29734] */
+       if (sfile->files) {
+               thumbnails_stop(sfile->files, C);
+               filelist_freelib(sfile->files);
+               filelist_free(sfile->files);
+       }
+
        sfile->params->active_file = -1;
        WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL);
 }