[Bf-blender-cvs] [3de6fe0b3ee] master: Error Messages Creating Thumbnail Folders

Harley Acheson noreply at git.blender.org
Mon Jun 14 18:17:38 CEST 2021


Commit: 3de6fe0b3eebb2af66db8051fbb65a49e49a8578
Author: Harley Acheson
Date:   Mon Jun 14 09:16:35 2021 -0700
Branches: master
https://developer.blender.org/rB3de6fe0b3eebb2af66db8051fbb65a49e49a8578

Error Messages Creating Thumbnail Folders

On the Windows platform there will be some errors printed to the
console if the user's thumbnail cache folder doesn't already exist.
While creating those folders there is an attempt to do so multiple
times and so we get errors when trying to create when exists. This
is caused by paths that have hard-coded forward slashes, which causes
our path processing routines to not work correctly. This patch defines
those paths using platform-varying separator characters.

Differential Revision: https://developer.blender.org/D11505

Reviewed by Brecht Van Lommel

===================================================================

M	source/blender/imbuf/intern/thumbs.c

===================================================================

diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 61bc185eb8d..7b4bf704096 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -112,13 +112,13 @@ static bool get_thumb_dir(char *dir, ThumbSize size)
 #endif
   switch (size) {
     case THB_NORMAL:
-      subdir = "/" THUMBNAILS "/normal/";
+      subdir = SEP_STR THUMBNAILS SEP_STR "normal" SEP_STR;
       break;
     case THB_LARGE:
-      subdir = "/" THUMBNAILS "/large/";
+      subdir = SEP_STR THUMBNAILS SEP_STR "large" SEP_STR;
       break;
     case THB_FAIL:
-      subdir = "/" THUMBNAILS "/fail/blender/";
+      subdir = SEP_STR THUMBNAILS SEP_STR "fail" SEP_STR "blender" SEP_STR;
       break;
     default:
       return 0; /* unknown size */



More information about the Bf-blender-cvs mailing list