Blender Git Loki

Git Commits -> Revision 273aca9

Revision 273aca9 by Julian Eisel (master)
December 11, 2020, 15:20 (GMT)
Refactor/extend BKE API to get special user directories

The previous `BKE_appdir_folder_default()` was confusing, it would return the
home directory on Linux and macOS, but the Documents directory on Windows.
Plus, for the Asset Browser, we want to use the Documents directory for the
default asset library on all platforms.
This attempts to clean up the API to avoid confusion, while adding the newly
needed functionality.

* `BKE_appdir_folder_default()` should behave as before, but the implementation
changed:
** Removes apparently incorrect usage of `XDG_DOCUMENTS_DIR` on Unix systems -
this seems to be a config file variable, not an environment variable. Always
use `$HOME` instead, which this ended up using anyway.
** On Windows it doesn't attempt to use `%HOME%` anymore and gets the Documents
directory directly.
* Add `BKE_appdir_folder_home()` to gives the top-level user directory on all
platforms.
* Add `BKE_appdir_folder_documents()` to always get the user documents
directory on all platforms.

There should be no user noticable behavior change.

Differential Revision: https://developer.blender.org/D9800

Reviewed by: Brecht Van Lommel

Commit Details:

Full Hash: 273aca964e895b5a5075c3fbd02589b9a908fc22
Parent Commit: 6de85a0
Lines Changed: +57, -26

2 Modified Paths:

/source/blender/blenkernel/BKE_appdir.h (+2, -0) (Diff)
/source/blender/blenkernel/intern/appdir.c (+55, -26) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021