diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-09-01 10:06:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-09-01 10:06:14 +0300 |
commit | 94b7bf3ec21b02952e994bb10c6e596bdae4720e (patch) | |
tree | ca64ae86d6eea25cbd173a68d09a0c1557621162 /source/blender | |
parent | 18b7f05480e60f079fd7eaa290d318deaad29d59 (diff) |
RNA: demote non-strict class naming to warning
This stops a lot of add-ons from registering,
while this must be resolved but there no need to force error just now.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 09d2d91a51c..bfa1e7cef93 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -855,9 +855,17 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifi const int len_sep = strlen(sep); const int len_id = strlen(identifier); const char *p = strstr(identifier, sep); + /* TODO: make error, for now warning until add-ons update. */ +#if 1 + const int report_level = RPT_WARNING; + const bool failure = true; +#else + const int report_level = RPT_ERROR; + const bool failure = false; +#endif if (p == NULL || p == identifier || p + len_sep >= identifier + len_id) { - BKE_reportf(reports, RPT_ERROR, "'%s' doesn't contain '%s' with prefix & suffix", identifier, sep); - return false; + BKE_reportf(reports, report_level, "'%s' doesn't contain '%s' with prefix & suffix", identifier, sep); + return failure; } const char *c, *start, *end, *last; @@ -869,8 +877,8 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifi ((c != start) && (*c >= '0' && *c <= '9')) || ((c != start) && (c != last) && (*c == '_'))) == 0) { - BKE_reportf(reports, RPT_ERROR, "'%s' doesn't have upper case alpha-numeric prefix", identifier); - return false; + BKE_reportf(reports, report_level, "'%s' doesn't have upper case alpha-numeric prefix", identifier); + return failure; } } @@ -883,8 +891,8 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifi (*c >= '0' && *c <= '9') || ((c != start) && (c != last) && (*c == '_'))) == 0) { - BKE_reportf(reports, RPT_ERROR, "'%s' doesn't have an alpha-numeric suffix", identifier); - return false; + BKE_reportf(reports, report_level, "'%s' doesn't have an alpha-numeric suffix", identifier); + return failure; } } return true; |