Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_userdef.c
| Show All 18 Lines | |||||
| * | * | ||||
| * Version patch user preferences. | * Version patch user preferences. | ||||
| */ | */ | ||||
| #define DNA_DEPRECATED_ALLOW | #define DNA_DEPRECATED_ALLOW | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_string.h" | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #ifdef WITH_INTERNATIONAL | #ifdef WITH_INTERNATIONAL | ||||
| # include "BLT_translation.h" | # include "BLT_translation.h" | ||||
| #endif | #endif | ||||
| #include "DNA_anim_types.h" | #include "DNA_anim_types.h" | ||||
| #include "DNA_collection_types.h" | #include "DNA_collection_types.h" | ||||
| ▲ Show 20 Lines • Show All 801 Lines • ▼ Show 20 Lines | #define USER_VERSION_ATLEAST(ver, subver) MAIN_VERSION_ATLEAST(userdef, ver, subver) | ||||
| } | } | ||||
| if (!USER_VERSION_ATLEAST(292, 9)) { | if (!USER_VERSION_ATLEAST(292, 9)) { | ||||
| if (BLI_listbase_is_empty(&userdef->asset_libraries)) { | if (BLI_listbase_is_empty(&userdef->asset_libraries)) { | ||||
| BKE_preferences_asset_library_default_add(userdef); | BKE_preferences_asset_library_default_add(userdef); | ||||
| } | } | ||||
| } | } | ||||
| if (!USER_VERSION_ATLEAST(293, 1)) { | |||||
| /* This rename was made after 2.93.0, harmless to run when it's not needed. */ | |||||
| const char *replace_table[][2] = { | |||||
| {"blender", "Blender"}, | |||||
| {"blender_27x", "Blender_27x"}, | |||||
| {"industry_compatible", "Industry_Compatible"}, | |||||
| }; | |||||
| const int replace_table_len = ARRAY_SIZE(replace_table); | |||||
| BLI_str_replace_table_exact( | |||||
| userdef->keyconfigstr, sizeof(userdef->keyconfigstr), replace_table, replace_table_len); | |||||
| LISTBASE_FOREACH (wmKeyConfigPref *, kpt, &userdef->user_keyconfig_prefs) { | |||||
| BLI_str_replace_table_exact( | |||||
| kpt->idname, sizeof(kpt->idname), replace_table, replace_table_len); | |||||
| } | |||||
| } | |||||
| if (!USER_VERSION_ATLEAST(293, 2)) { | if (!USER_VERSION_ATLEAST(293, 2)) { | ||||
| /* Enable asset browser features by default for alpha testing. | /* Enable asset browser features by default for alpha testing. | ||||
| * BLO_sanitize_experimental_features_userpref_blend() will disable it again for non-alpha | * BLO_sanitize_experimental_features_userpref_blend() will disable it again for non-alpha | ||||
| * builds. */ | * builds. */ | ||||
| userdef->experimental.use_asset_browser = true; | userdef->experimental.use_asset_browser = true; | ||||
| } | } | ||||
| if (!USER_VERSION_ATLEAST(293, 12)) { | if (!USER_VERSION_ATLEAST(293, 12)) { | ||||
| ▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines | |||||