Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-05-10 08:46:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-10 11:27:02 +0300
commitb607d1629251dcf1f1964cfddbc9d121863d5ca1 (patch)
tree84bb52547104cf1f594aa3d2481ed3e518e24b95 /source/blender/blenkernel/intern/appdir.c
parent44ecea1ccbc06680cfc12a89799badbf0cc43ac9 (diff)
Cleanup: move preference saving logic into blendfile.c
Diffstat (limited to 'source/blender/blenkernel/intern/appdir.c')
-rw-r--r--source/blender/blenkernel/intern/appdir.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index 2b4123c74e2..c1ea57c5fcc 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -838,6 +838,26 @@ bool BKE_appdir_app_template_id_search(const char *app_template, char *path, siz
return false;
}
+bool BKE_appdir_app_template_has_userpref(const char *app_template)
+{
+ /* Test if app template provides a userpref.blend.
+ * If not, we will share user preferences with the rest of Blender. */
+ if (!app_template && app_template[0]) {
+ return false;
+ }
+
+ char app_template_path[FILE_MAX];
+ if (!BKE_appdir_app_template_id_search(
+ app_template, app_template_path, sizeof(app_template_path))) {
+ return false;
+ }
+
+ char userpref_path[FILE_MAX];
+ BLI_path_join(
+ userpref_path, sizeof(userpref_path), app_template_path, BLENDER_USERPREF_FILE, NULL);
+ return BLI_exists(userpref_path);
+}
+
void BKE_appdir_app_templates(ListBase *templates)
{
BLI_listbase_clear(templates);