diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_preferences.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/preferences.c | 3 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 14 |
3 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_preferences.h b/source/blender/blenkernel/BKE_preferences.h index bd887c1ea0d..fce2d3178aa 100644 --- a/source/blender/blenkernel/BKE_preferences.h +++ b/source/blender/blenkernel/BKE_preferences.h @@ -29,6 +29,9 @@ extern "C" { struct UserDef; struct bUserAssetLibrary; +/** Name of the asset library added by default. */ +#define BKE_PREFS_ASSET_LIBRARY_DEFAULT_NAME DATA_("User Library") + struct bUserAssetLibrary *BKE_preferences_asset_library_add(struct UserDef *userdef, const char *name, const char *path) ATTR_NONNULL(1); diff --git a/source/blender/blenkernel/intern/preferences.c b/source/blender/blenkernel/intern/preferences.c index 0b8e8d7c311..79a8b591f72 100644 --- a/source/blender/blenkernel/intern/preferences.c +++ b/source/blender/blenkernel/intern/preferences.c @@ -120,7 +120,8 @@ void BKE_preferences_asset_library_default_add(UserDef *userdef) return; } - bUserAssetLibrary *library = BKE_preferences_asset_library_add(userdef, DATA_("Default"), NULL); + bUserAssetLibrary *library = BKE_preferences_asset_library_add( + userdef, BKE_PREFS_ASSET_LIBRARY_DEFAULT_NAME, NULL); /* Add new "Default" library under '[doc_path]/Blender/Assets'. */ BLI_path_join( 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. * |