[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19180] branches/blender2.5/blender/source /blender: 2.5 filebrowser

Andrea Weikert elubie at gmx.net
Tue Mar 3 11:24:06 CET 2009


Revision: 19180
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19180
Author:   elubie
Date:     2009-03-03 11:24:06 +0100 (Tue, 03 Mar 2009)

Log Message:
-----------
2.5 filebrowser
bugfix: create directories to store thumbnails if they don't exist.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/space_file/space_file.c
    branches/blender2.5/blender/source/blender/imbuf/IMB_thumbs.h
    branches/blender2.5/blender/source/blender/imbuf/intern/thumbs.c

Modified: branches/blender2.5/blender/source/blender/editors/space_file/space_file.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_file/space_file.c	2009-03-03 10:22:00 UTC (rev 19179)
+++ branches/blender2.5/blender/source/blender/editors/space_file/space_file.c	2009-03-03 10:24:06 UTC (rev 19180)
@@ -36,6 +36,8 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BIF_gl.h"
+
 #include "BLO_readfile.h"
 
 #include "BLI_blenlib.h"
@@ -50,7 +52,8 @@
 #include "ED_screen.h"
 #include "ED_fileselect.h"
 
-#include "BIF_gl.h"
+#include "IMB_imbuf_types.h"
+#include "IMB_thumbs.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -414,6 +417,7 @@
 	BLI_make_file_string("/", name, BLI_gethome(), ".Bfs");
 	fsmenu_read_file(name);
 	filelist_init_icons();
+	IMB_thumb_makedirs();
 }
 
 void ED_file_exit(void)

Modified: branches/blender2.5/blender/source/blender/imbuf/IMB_thumbs.h
===================================================================
--- branches/blender2.5/blender/source/blender/imbuf/IMB_thumbs.h	2009-03-03 10:22:00 UTC (rev 19179)
+++ branches/blender2.5/blender/source/blender/imbuf/IMB_thumbs.h	2009-03-03 10:24:06 UTC (rev 19180)
@@ -67,8 +67,9 @@
 /* return the state of the thumb, needed to determine how to manage the thumb */
 ImBuf* IMB_thumb_manage(const char* dir, const char* file, ThumbSize size, ThumbSource source);
 
+/* create the necessary dirs to store the thumbnails */
+void IMB_thumb_makedirs();
 
 
-
 #endif /* _IMB_THUMBS_H */
 

Modified: branches/blender2.5/blender/source/blender/imbuf/intern/thumbs.c
===================================================================
--- branches/blender2.5/blender/source/blender/imbuf/intern/thumbs.c	2009-03-03 10:22:00 UTC (rev 19179)
+++ branches/blender2.5/blender/source/blender/imbuf/intern/thumbs.c	2009-03-03 10:24:06 UTC (rev 19180)
@@ -232,6 +232,16 @@
 	return rv;
 }
 
+void IMB_thumb_makedirs()
+{
+	char tpath[FILE_MAX];
+	if (get_thumb_dir(tpath, THB_NORMAL)) {
+		BLI_recurdir_fileops(tpath);
+	}
+	if (get_thumb_dir(tpath, THB_FAIL)) {
+		BLI_recurdir_fileops(tpath);
+	}
+}
 
 /* create thumbnail for file and returns new imbuf for thumbnail */
 ImBuf* IMB_thumb_create(const char* dir, const char* file, ThumbSize size, ThumbSource source)





More information about the Bf-blender-cvs mailing list