mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Patch from James Radley to allow override of the dotfile location.
Read environment variable GNC_DOT_DIR and, if available, use this instead of `g_get_home_dir`/.gnucash. This allows one develop without impacting an existing stable installation, excepting shared GConf keys. Setting HOME does not help, because g_get_home_dir prefers passwd entries. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15746 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -382,14 +382,17 @@ gnc_dotgnucash_dir (void)
|
||||
if (dotgnucash)
|
||||
return dotgnucash;
|
||||
|
||||
home = g_get_home_dir();
|
||||
if (!home) {
|
||||
g_warning("Cannot find home directory. Using tmp directory instead.");
|
||||
home = g_get_tmp_dir();
|
||||
}
|
||||
g_assert(home);
|
||||
dotgnucash = g_strdup(g_getenv("GNC_DOT_DIR"));
|
||||
if (!dotgnucash) {
|
||||
home = g_get_home_dir();
|
||||
if (!home) {
|
||||
g_warning("Cannot find home directory. Using tmp directory instead.");
|
||||
home = g_get_tmp_dir();
|
||||
}
|
||||
g_assert(home);
|
||||
|
||||
dotgnucash = g_build_filename(home, ".gnucash", (gchar *)NULL);
|
||||
dotgnucash = g_build_filename(home, ".gnucash", (gchar *)NULL);
|
||||
}
|
||||
gnc_validate_directory(dotgnucash);
|
||||
|
||||
/* Since we're in code that is only executed once.... */
|
||||
|
||||
Reference in New Issue
Block a user