[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30415] trunk/blender/source/blender: == installation paths ==
Andrea Weikert
elubie at gmx.net
Fri Jul 16 18:02:08 CEST 2010
Revision: 30415
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30415
Author: elubie
Date: 2010-07-16 18:02:07 +0200 (Fri, 16 Jul 2010)
Log Message:
-----------
== 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.
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/BLI_path_util.h
trunk/blender/source/blender/blenlib/intern/path_util.c
trunk/blender/source/blender/editors/space_file/file_ops.c
trunk/blender/source/blender/editors/space_file/fsmenu.c
trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
Modified: trunk/blender/source/blender/blenlib/BLI_path_util.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_path_util.h 2010-07-16 15:46:37 UTC (rev 30414)
+++ trunk/blender/source/blender/blenlib/BLI_path_util.h 2010-07-16 16:02:07 UTC (rev 30415)
@@ -40,14 +40,14 @@
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
Modified: trunk/blender/source/blender/blenlib/intern/path_util.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/path_util.c 2010-07-16 15:46:37 UTC (rev 30414)
+++ trunk/blender/source/blender/blenlib/intern/path_util.c 2010-07-16 16:02:07 UTC (rev 30415)
@@ -732,10 +732,10 @@
}
}
-/* 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");
Modified: trunk/blender/source/blender/editors/space_file/file_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/file_ops.c 2010-07-16 15:46:37 UTC (rev 30414)
+++ trunk/blender/source/blender/editors/space_file/file_ops.c 2010-07-16 16:02:07 UTC (rev 30415)
@@ -945,7 +945,7 @@
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
Modified: trunk/blender/source/blender/editors/space_file/fsmenu.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/fsmenu.c 2010-07-16 15:46:37 UTC (rev 30414)
+++ trunk/blender/source/blender/editors/space_file/fsmenu.c 2010-07-16 16:02:07 UTC (rev 30415)
@@ -338,7 +338,7 @@
/* 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 @@
#else
/* unix */
{
- char *home= BLI_gethome();
+ char *home= getenv("HOME");
if(home) {
BLI_snprintf(line, FILE_MAXDIR, "%s/", home);
Modified: trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c 2010-07-16 15:46:37 UTC (rev 30414)
+++ trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c 2010-07-16 16:02:07 UTC (rev 30415)
@@ -166,7 +166,7 @@
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);
More information about the Bf-blender-cvs
mailing list