Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2010-07-04 19:35:23 +0400
committerAndrea Weikert <elubie@gmx.net>2010-07-04 19:35:23 +0400
commitca81aa704e958a73a55e79654f70eaa9a0fad85a (patch)
tree8b40e3a7613df4e707fcc8efb3a099f9445ac350 /source/blender/editors/interface/interface_icons.c
parent3ca7b160a664e74c6815056a4a8596bb4c2b70be (diff)
Patch [#22339] File/installation paths changes
Patch Tracker: http://projects.blender.org/tracker/?func=detail&aid=22339&group_id=9&atid=127 This patch implements the proposal outlined here: http://wiki.blender.org/index.php/Dev:2.5/Source/Installation/Proposal Original patch by Matt Ebb. Contributions by Nathan Letwory, Damien Plisson and Andrea Weikert NOTE: This is a work in progress commit, some work still needs to be done on the SCons and CMake files for this to work properly, but at least should compile and the files should be created in the right directory. Commit discussed on IRC with Ton and Campbell.
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r--source/blender/editors/interface/interface_icons.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 622b9ddbfdf..499fe3b9767 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -457,25 +457,20 @@ static void init_internal_icons()
ImBuf *bbuf= NULL;
int x, y, icontype;
char iconfilestr[FILE_MAXDIR+FILE_MAXFILE];
- char filenamestr[FILE_MAXFILE+16]; // 16 == strlen(".blender/icons/")+1
if ((btheme!=NULL) && (strlen(btheme->tui.iconfile) > 0)) {
-
-#ifdef WIN32
- sprintf(filenamestr, "icons/%s", btheme->tui.iconfile);
-#else
- sprintf(filenamestr, ".blender/icons/%s", btheme->tui.iconfile);
-#endif
-
- BLI_make_file_string("/", iconfilestr, BLI_gethome(), filenamestr);
-
- if (BLI_exists(iconfilestr)) {
- bbuf = IMB_loadiffname(iconfilestr, IB_rect);
- if(bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H) {
- if (G.f & G_DEBUG)
- printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr);
- IMB_freeImBuf(bbuf);
- bbuf= NULL;
+ char *datadir= BLI_get_folder(BLENDER_DATAFILES, NULL);
+ if (datadir) {
+ BLI_make_file_string("/", iconfilestr, datadir, btheme->tui.iconfile);
+
+ if (BLI_exists(iconfilestr)) {
+ bbuf = IMB_loadiffname(iconfilestr, IB_rect);
+ if(bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H) {
+ if (G.f & G_DEBUG)
+ printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr);
+ IMB_freeImBuf(bbuf);
+ bbuf= NULL;
+ }
}
}
}
@@ -555,14 +550,14 @@ static void init_iconfile_list(struct ListBase *list)
char icondirstr[FILE_MAX];
char iconfilestr[FILE_MAX+16]; /* allow 256 chars for file+dir */
char olddir[FILE_MAX];
-
+ char *datadir= NULL;
+
list->first = list->last = NULL;
+ datadir = BLI_get_folder(BLENDER_DATAFILES, NULL);
-#ifdef WIN32
- BLI_make_file_string("/", icondirstr, BLI_gethome(), "icons");
-#else
- BLI_make_file_string("/", icondirstr, BLI_gethome(), ".blender/icons");
-#endif
+ if (!datadir) return;
+
+ BLI_make_file_string("/", icondirstr, datadir, "");
if(BLI_exists(icondirstr)==0)
return;