diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-02 16:36:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-03 00:25:36 +0300 |
commit | b13459f9e585bcb0e4ba61e391e59a888f5042f2 (patch) | |
tree | 449609947a88ad92ab4d99d4a31a48c4a0f66d7e | |
parent | e255040c7797a282cb0ea614e3f95c6a59cd0298 (diff) |
Cleanup: rename main preferences versioning function
BLO_version_defaults_userpref_blend -> blo_do_versions_userdef
The name was misleading as it was declared along with
BLO_update_defaults_startup_blend making it seem these functions were
related.
In fact preference defaults don't need to be updated as is done for
startup.blend since an in-memory blend file isn't used.
Rename the function to match other versioning functions
called from readfile.c. Also add/update comments on these differences.
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 8 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.h | 3 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 7 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 8 | ||||
-rw-r--r-- | source/blender/makesdna/intern/dna_defaults.c | 2 |
8 files changed, 25 insertions, 13 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 88d89d9d6da..0ab9a5e9e14 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -223,13 +223,13 @@ typedef void (*BLOExpandDoitCallback)(void *fdhandle, struct Main *mainvar, void void BLO_main_expander(BLOExpandDoitCallback expand_doit_func); void BLO_expand_main(void *fdhandle, struct Main *mainvar); -/* Update defaults in startup.blend & userprefs.blend, without having to save and embed it */ +/** + * Update defaults in startup.blend, without having to save and embed it. + * \note defaults for preferences are stored in `userdef_default.c` and can be updated there. + */ void BLO_update_defaults_startup_blend(struct Main *bmain, const char *app_template); void BLO_update_defaults_workspace(struct WorkSpace *workspace, const char *app_template); -/* Version patch user preferences. */ -void BLO_version_defaults_userpref_blend(struct UserDef *userdef); - /* Disable unwanted experimental feature settings on startup. */ void BLO_sanitize_experimental_features_userpref_blend(struct UserDef *userdef); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2ea4206bab3..cf2181c8a27 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6891,7 +6891,7 @@ static void do_versions_userdef(FileData *UNUSED(fd), BlendFileData *bfd) return; } - BLO_version_defaults_userpref_blend(user); + blo_do_versions_userdef(user); } static void do_versions(FileData *fd, Library *lib, Main *main) diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index d3372a646a9..4fa41731454 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -42,6 +42,7 @@ struct Object; struct OldNewMap; struct PartEff; struct ReportList; +struct UserDef; struct View3D; typedef struct IDNameLib_Map IDNameLib_Map; @@ -189,6 +190,8 @@ void blo_do_version_old_trackto_to_constraints(struct Object *ob); void blo_do_versions_view3d_split_250(struct View3D *v3d, struct ListBase *regions); void blo_do_versions_key_uidgen(struct Key *key); +void blo_do_versions_userdef(struct UserDef *userdef); + void blo_do_versions_pre250(struct FileData *fd, struct Library *lib, struct Main *bmain); void blo_do_versions_250(struct FileData *fd, struct Library *lib, struct Main *bmain); void blo_do_versions_260(struct FileData *fd, struct Library *lib, struct Main *bmain); diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index b7c48234590..ad6066647d6 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1747,7 +1747,7 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports)) * * \note Be sure to check when bumping the version: * - #blo_do_versions_280 in this file. - * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend + * - "versioning_userdef.c", #blo_do_versions_userdef * - "versioning_userdef.c", #do_versions_theme * * \note Keep this message at the bottom of the function. @@ -5092,7 +5092,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) * * \note Be sure to check when bumping the version: * - #do_versions_after_linking_280 in this file. - * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend + * - "versioning_userdef.c", #blo_do_versions_userdef * - "versioning_userdef.c", #do_versions_theme * * \note Keep this message at the bottom of the function. diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 48ae5963da8..b9153307d70 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -234,7 +234,7 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports)) * * \note Be sure to check when bumping the version: * - #blo_do_versions_290 in this file. - * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend + * - "versioning_userdef.c", #blo_do_versions_userdef * - "versioning_userdef.c", #do_versions_theme * * \note Keep this message at the bottom of the function. @@ -773,7 +773,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) * Versioning code until next subversion bump goes here. * * \note Be sure to check when bumping the version: - * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend + * - "versioning_userdef.c", #blo_do_versions_userdef * - "versioning_userdef.c", #do_versions_theme * * \note Keep this message at the bottom of the function. diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index b4bee9a3c7e..9ae02a41759 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -16,6 +16,13 @@ /** \file * \ingroup blenloader + * + * This file handles updating the `startup.blend`, this is used when reading old files. + * + * Unlike regular versioning this makes changes that ensure the startup file + * has brushes and other presets setup to take advantage of newer features. + * + * To update preference defaults see `userdef_default.c`. */ #include "MEM_guardedalloc.h" diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index da0dd486646..04302935deb 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -44,7 +44,9 @@ #include "BKE_keyconfig.h" #include "BKE_main.h" -#include "BLO_readfile.h" /* Own include. */ +#include "BLO_readfile.h" + +#include "readfile.h" /* Own include. */ #include "wm_event_types.h" @@ -244,7 +246,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme) * Versioning code until next subversion bump goes here. * * \note Be sure to check when bumping the version: - * - #BLO_version_defaults_userpref_blend in this file. + * - #blo_do_versions_userdef in this file. * - "versioning_{BLENDER_VERSION}.c" * * \note Keep this message at the bottom of the function. @@ -303,7 +305,7 @@ static bool keymap_item_has_invalid_wm_context_data_path(wmKeyMapItem *kmi, } /* patching UserDef struct and Themes */ -void BLO_version_defaults_userpref_blend(UserDef *userdef) +void blo_do_versions_userdef(UserDef *userdef) { /* #UserDef & #Main happen to have the same struct member. */ #define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST(userdef, ver, subver) diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c index 6fff2d33ac8..273f52a1d74 100644 --- a/source/blender/makesdna/intern/dna_defaults.c +++ b/source/blender/makesdna/intern/dna_defaults.c @@ -65,7 +65,7 @@ * - When loading old files that don't contain newly added struct members (these will be zeroed) * to set their values use `versioning_{BLENDER_VERSION}.c` source files. * - For startup file data, to update these defaults use - * #BLO_update_defaults_startup_blend & #BLO_version_defaults_userpref_blend. + * #BLO_update_defaults_startup_blend & #blo_do_versions_userdef. */ #include <limits.h> |