File Browser
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 16 Sep 2009 18:07:49 +0000 (18:07 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 16 Sep 2009 18:07:49 +0000 (18:07 +0000)
* Fix warning for non-existing "relative_paths" property.
* Fix problem where the image browser would keep trying to
  load images it failed opening.

source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filelist.c

index 0e0ad88906eaaaccf9eace11d461e3e1ba168136..faca6db75bf34554f41f905a464909039dab8e84 100644 (file)
@@ -531,9 +531,10 @@ int file_exec(bContext *C, wmOperator *unused)
                RNA_string_set(op->ptr, "directory", name);
                strcat(name, sfile->params->file);
 
-               if ( RNA_boolean_get(op->ptr, "relative_paths") ) {
-                       BLI_makestringcode(G.sce, name);
-               }
+               if(RNA_struct_find_property(op->ptr, "relative_paths"))
+                       if(RNA_boolean_get(op->ptr, "relative_paths"))
+                               BLI_makestringcode(G.sce, name);
+
                RNA_string_set(op->ptr, "path", name);
                
                /* some ops have multiple files to select */
index c0b16e639c07aed33a9320b3c3f4b313eba62713..582a5997ef5016ff1e8103f31404587fef909cc3 100644 (file)
@@ -592,10 +592,12 @@ void filelist_loadimage_timer(struct FileList* filelist)
                }
                if (limg->done) {
                        FileImage *oimg = limg;
-                       BLI_remlink(&filelist->loadimages, oimg);
                        BLI_remove_thread(&filelist->threads, oimg);
+                       /* brecht: keep failed images in the list, otherwise
+                          it keeps trying to load them over and over?
+                       BLI_remlink(&filelist->loadimages, oimg);
+                       MEM_freeN(oimg);*/
                        limg = oimg->next;
-                       MEM_freeN(oimg);
                        refresh = 1;
                } else {
                        limg= limg->next;