1
1

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.
This commit is contained in:
2021-10-26 20:58:12 +02:00
parent 319de793d7
commit 0cf9794c7e
3 changed files with 16 additions and 4 deletions

View File

@@ -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);

View File

@@ -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(

View File

@@ -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.
*