diff options
author | Andrea Weikert <elubie@gmx.net> | 2010-07-16 20:02:07 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2010-07-16 20:02:07 +0400 |
commit | ca3f3317b2ca16f91972f8176c2fa366f1bf5fb5 (patch) | |
tree | e70c451ff65593de0f69224692cb9e608cf4eff1 /source/blender | |
parent | 3ef41270f96b4ee3592ec5302a5383399c38ff5d (diff) |
== installation paths ==
* rename BLI_gethome to BLI_getDefaultDocumentFolder to better reflect how this function is used
* replaced BLI_gethome with getenv("HOME") on Linux and Mac where it retrieves location of bookmarks that are inserted as system bookmarks. BLI_gethome was a thin wrapper around these and in this case the user's home directory is what is actually wanted.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/BLI_path_util.h | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 60d35c9ecdf..07e0da5e461 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -40,14 +40,14 @@ extern "C" { struct ListBase; struct direntry; -char *BLI_gethome(void); +char *BLI_getDefaultDocumentFolder(void); char *BLI_get_folder(int folder_id, char *subfolder); char *BLI_get_folder_create(int folder_id, char *subfolder); /* folder_id */ -/* general, will find baserd on user/local/system priority */ +/* general, will find based on user/local/system priority */ #define BLENDER_CONFIG 1 #define BLENDER_DATAFILES 2 #define BLENDER_SCRIPTS 3 diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index df1e2c7d590..2f8e4ab44b2 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -732,10 +732,10 @@ void BLI_getlastdir(const char* dir, char *last, int maxlen) } } -/* This is now only used to really get the user's home folder */ +/* This is now only used to really get the user's default document folder */ /* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used as default location to save documents */ -char *BLI_gethome(void) { +char *BLI_getDefaultDocumentFolder(void) { #if !defined(WIN32) return getenv("HOME"); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 55a44b36a52..bd7be303e33 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -945,7 +945,7 @@ int file_directory_exec(bContext *C, wmOperator *unused) if ( sfile->params->dir[0] == '~' ) { char tmpstr[sizeof(sfile->params->dir)-1]; strncpy(tmpstr, sfile->params->dir+1, sizeof(tmpstr)); - BLI_join_dirfile(sfile->params->dir, BLI_gethome(), tmpstr); + BLI_join_dirfile(sfile->params->dir, BLI_getDefaultDocumentFolder(), tmpstr); } #ifdef WIN32 diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 6699c0b8bc7..6603bba5a89 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -338,7 +338,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) /* As 10.4 doesn't provide proper API to retrieve the favorite places, assume they are the standard ones TODO : replace hardcoded paths with proper BLI_get_folder calls */ - home = BLI_gethome(); + home = getenv("HOME"); if(home) { BLI_snprintf(line, 256, "%s/", home); fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); @@ -458,7 +458,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) #else /* unix */ { - char *home= BLI_gethome(); + char *home= getenv("HOME"); if(home) { BLI_snprintf(line, FILE_MAXDIR, "%s/", home); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 5bfaf91aa11..558d20021ce 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -166,7 +166,7 @@ void WM_init(bContext *C, int argc, char **argv) read_history(); if(G.sce[0] == 0) - BLI_make_file_string("/", G.sce, BLI_gethome(), "untitled.blend"); + BLI_make_file_string("/", G.sce, BLI_getDefaultDocumentFolder(), "untitled.blend"); BLI_strncpy(G.lib, G.sce, FILE_MAX); |