== 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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user