Motivated by a recent issue in gnucash-users, where a MacOSX user had trouble 
because .gnucash is invisible to TextEdit (which normal users would use to edit 
a file), and because it's actually necessary to edit .gnucash/saved-reports-2.0 
to clean old reports from the menu, I decided that for OSX the Gnucash prefs 
should live in the more Macish ~/Library/Application Support/Gnucash. So far, 
so good.

Src/engine/gnc-filepath-utils.c has two ways to find the preferences directory: 
A public one, gnc_dot_gnucash_dir(), and a private one hard coded in 
xaccResolveFilePath() and some static functions which it uses. The former uses 
glib tools and provides an undocumented (at least as far as I can find) 
environment variable $GNC_DOT_DIR to easily override the directory (my goal). 
The latter has ~/.gnucash hardcoded along with some other inappropriate 
hard-coded paths and a rather bizarre indirection scheme for resolving 
filenames.

The attached patch replaces the private static functions in 
xaccResolveFilePath() with calls to gnc_dot_gnucash_dir() and (I think) 
rationalizes the filename resolution using functions graciously provided in 
gnc-path.h. 

Before I commit it, I'd like some of the devs more experienced with GC to look 
it over and make sure I haven't done something overly stupid. It would probably 
be a good idea for one of the MSWin maintainers to make sure that it doesn't 
break anything there.

Regards,
John Ralls

Attachment: dot_gnucash.patch
Description: Binary data

_______________________________________________
gnucash-devel mailing list
[email protected]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to