diff options
author | Julian Eisel <julian@blender.org> | 2021-10-26 21:58:12 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-10-26 22:01:44 +0300 |
commit | 0cf9794c7ef0c8c7dfdad4a2e2006b3708e42a93 (patch) | |
tree | ef8ced850d9f2d3bc5c68f0fb86a8f224709d1e9 /source/blender/blenloader/intern/versioning_userdef.c | |
parent | 319de793d79865603b3cdccec5933d2152e43bb3 (diff) |
Assets: Rename "Default" asset library to "User Library"
Feedback was that "Default" is a bit of a weird name, so switching it to "User
Library". Added versioning code which won't be entirely bullet proof (e.g. will
also rename libraries named "Default" by the user), but it doesn't have to be.
Addresses T90298.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_userdef.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index 9b81d8b19aa..df59cd3afa9 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -27,9 +27,7 @@ #include "BLI_string.h" #include "BLI_utildefines.h" -#ifdef WITH_INTERNATIONAL -# include "BLT_translation.h" -#endif +#include "BLT_translation.h" #include "DNA_anim_types.h" #include "DNA_collection_types.h" @@ -928,6 +926,16 @@ void blo_do_versions_userdef(UserDef *userdef) userdef->dupflag |= USER_DUP_SPEAKER; } + if (!USER_VERSION_ATLEAST(300, 40)) { + /* Rename the default asset library from "Default" to "User Library" */ + LISTBASE_FOREACH (bUserAssetLibrary *, asset_library, &userdef->asset_libraries) { + if (STREQ(asset_library->name, DATA_("Default"))) { + BKE_preferences_asset_library_name_set( + userdef, asset_library, BKE_PREFS_ASSET_LIBRARY_DEFAULT_NAME); + } + } + } + /** * Versioning code until next subversion bump goes here. * |