[Bf-blender-cvs] [5dc97bdabb8] soc-2020-info-editor: Cleanup: remove RTP_STORE
Mateusz GrzeliÅski
noreply at git.blender.org
Mon Jul 6 09:24:25 CEST 2020
Commit: 5dc97bdabb8e85ca001dc0aa0566f870a84f0e61
Author: Mateusz Grzeliński
Date: Mon Jul 6 00:39:37 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB5dc97bdabb8e85ca001dc0aa0566f870a84f0e61
Cleanup: remove RTP_STORE
After introducing logs it has no use
===================================================================
M source/blender/blenkernel/intern/report.c
M source/blender/blenloader/intern/readfile.c
M source/blender/editors/include/ED_util.h
M source/blender/editors/space_image/image_ops.c
M source/blender/editors/space_info/info_report.c
M source/blender/editors/util/ed_util.c
M source/blender/makesdna/DNA_windowmanager_types.h
M source/blender/modifiers/intern/MOD_datatransfer.c
M source/blender/python/intern/bpy_library_load.c
M source/blender/python/intern/bpy_library_write.c
M source/blender/python/intern/bpy_operator.c
M source/blender/python/intern/bpy_rna.c
M source/blender/python/intern/bpy_rna_anim.c
M source/blender/windowmanager/intern/wm_event_system.c
M source/blender/windowmanager/intern/wm_files.c
M source/blender/windowmanager/intern/wm_init_exit.c
M source/creator/creator_args.c
===================================================================
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index 98d8363aade..3c69c6894d5 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -152,9 +152,14 @@ void BKE_report(ReportList *reports, ReportType type, const char *_message)
int len;
const char *message = TIP_(_message);
- CLOG_INFO(&LOG, report_type_to_verbosity(type), "%s: %s", BKE_report_type_str(type), message);
-
- if (reports && (reports->flag & RPT_STORE)) {
+ CLOG_INFO(&LOG,
+ report_type_to_verbosity(type),
+ "ReportList(%p):%s: %s",
+ reports,
+ BKE_report_type_str(type),
+ message);
+
+ if (reports) {
char *message_alloc;
report = MEM_callocN(sizeof(Report), "Report");
report->type = type;
@@ -189,13 +194,14 @@ void BKE_reportf(ReportList *reports, ReportType type, const char *_format, ...)
char *message_cstring = BLI_dynstr_get_cstring(message);
CLOG_INFO(&LOG,
report_type_to_verbosity(type),
- "%s: %s",
+ "ReportList(%p):%s: %s",
+ reports,
BKE_report_type_str(type),
message_cstring);
MEM_freeN(message_cstring);
}
- if (reports && (reports->flag & RPT_STORE)) {
+ if (reports) {
report = MEM_callocN(sizeof(Report), "Report");
report->message = BLI_dynstr_get_cstring(message);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 05ecd39c340..907a2bbe993 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7675,7 +7675,7 @@ static void direct_link_windowmanager(BlendDataReader *reader, wmWindowManager *
BLI_listbase_clear(&wm->operators);
BLI_listbase_clear(&wm->paintcursors);
BLI_listbase_clear(&wm->queue);
- BKE_reports_init(&wm->reports, RPT_STORE);
+ BKE_reports_init(&wm->reports, 0);
BLI_listbase_clear(&wm->keyconfigs);
wm->defaultconf = NULL;
diff --git a/source/blender/editors/include/ED_util.h b/source/blender/editors/include/ED_util.h
index 1f2706957a7..a5511eb9ce7 100644
--- a/source/blender/editors/include/ED_util.h
+++ b/source/blender/editors/include/ED_util.h
@@ -36,7 +36,7 @@ struct wmOperatorType;
/* ed_util.c */
void ED_editors_init_for_undo(struct Main *bmain);
-void ED_editors_init(struct bContext *C);
+void ED_editors_init(struct bContext *C, struct ReportList *reports);
void ED_editors_exit(struct Main *bmain, bool do_undo_system);
bool ED_editors_flush_edits_for_object_ex(struct Main *bmain,
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 4702b01901d..bc26f5d1095 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -2296,7 +2296,7 @@ static bool image_has_valid_path(Image *ima)
bool ED_image_should_save_modified(const Main *bmain)
{
ReportList reports;
- BKE_reports_init(&reports, RPT_STORE);
+ BKE_reports_init(&reports, 0);
uint modified_images_count = ED_image_save_all_modified_info(bmain, &reports);
bool should_save = modified_images_count || !BLI_listbase_is_empty(&reports.list);
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index 16922931cb8..5e82c22f755 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -503,7 +503,7 @@ void INFO_OT_report_copy(wmOperatorType *ot)
ReportList *clog_to_report_list()
{
ReportList *reports = MEM_mallocN(sizeof(*reports), "ClogConvertedToReportList");
- BKE_reports_init(reports, RPT_STORE);
+ BKE_reports_init(reports, 0);
ListBase *records = (ListBase *)CLG_log_record_get();
if (BLI_listbase_is_empty(records)) {
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index dad0b96c5e2..81c4232df1b 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -98,19 +98,13 @@ void ED_editors_init_for_undo(Main *bmain)
}
}
-void ED_editors_init(bContext *C)
+void ED_editors_init(bContext *C, ReportList *reports)
{
struct Depsgraph *depsgraph = CTX_data_expect_evaluated_depsgraph(C);
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
wmWindowManager *wm = CTX_wm_manager(C);
- /* This is called during initialization, so we don't want to store any reports */
- ReportList *reports = CTX_wm_reports(C);
- int reports_flag_prev = reports->flag & ~RPT_STORE;
-
- SWAP(int, reports->flag, reports_flag_prev);
-
/* Don't do undo pushes when calling an operator. */
wm->op_undo_depth++;
@@ -185,7 +179,6 @@ void ED_editors_init(bContext *C)
ED_space_image_paint_update(bmain, wm, scene);
}
- SWAP(int, reports->flag, reports_flag_prev);
wm->op_undo_depth--;
}
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index bba436a8d34..85be74bc921 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -80,7 +80,7 @@ typedef enum ReportType {
enum ReportListFlags {
// RPT_PRINT = (1 << 0), // unused
- RPT_STORE = (1 << 1),
+// RPT_STORE = (1 << 1), // usused
RPT_FREE = (1 << 2),
RPT_OP_HOLD = (1 << 3), /* don't move them into the operator global list (caller will use) */
};
diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c
index 753efb50734..bb225a3dfb4 100644
--- a/source/blender/modifiers/intern/MOD_datatransfer.c
+++ b/source/blender/modifiers/intern/MOD_datatransfer.c
@@ -201,7 +201,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *
BKE_id_copy_ex(NULL, &me_mod->id, (ID **)&result, LIB_ID_COPY_LOCALIZE);
}
- BKE_reports_init(&reports, RPT_STORE);
+ BKE_reports_init(&reports, 0);
/* Note: no islands precision for now here. */
BKE_object_data_transfer_ex(ctx->depsgraph,
diff --git a/source/blender/python/intern/bpy_library_load.c b/source/blender/python/intern/bpy_library_load.c
index 05cbc9af601..f9090e2b411 100644
--- a/source/blender/python/intern/bpy_library_load.c
+++ b/source/blender/python/intern/bpy_library_load.c
@@ -234,7 +234,7 @@ static PyObject *bpy_lib_enter(BPy_Library *self)
PyObject *from_dict = _PyDict_NewPresized(MAX_LIBARRAY);
ReportList reports;
- BKE_reports_init(&reports, RPT_STORE);
+ BKE_reports_init(&reports, 0);
self->blo_handle = BLO_blendhandle_from_file(self->abspath, &reports);
diff --git a/source/blender/python/intern/bpy_library_write.c b/source/blender/python/intern/bpy_library_write.c
index 8058fef8d86..2bb5608fb84 100644
--- a/source/blender/python/intern/bpy_library_write.c
+++ b/source/blender/python/intern/bpy_library_write.c
@@ -175,7 +175,7 @@ static PyObject *bpy_lib_write(PyObject *UNUSED(self), PyObject *args, PyObject
int retval = 0;
ReportList reports;
- BKE_reports_init(&reports, RPT_STORE);
+ BKE_reports_init(&reports, 0);
retval = BKE_blendfile_write_partial(
bmain_src, filepath_abs, write_flags, path_remap.value_found, &reports);
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 4b2b5f129a7..1b6f677fcb0 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -254,7 +254,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
reports = MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
/* Own so these don't move into global reports. */
- BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD);
+ BKE_reports_init(reports, RPT_OP_HOLD);
#ifdef BPY_RELEASE_GIL
/* release GIL, since a thread could be started from an operator
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index ebbbc8f3140..63cfd46b791 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -2075,7 +2075,7 @@ static int pyrna_py_to_prop(
/* Data == NULL, assign to RNA. */
if (value == Py_None || RNA_struct_is_a(param->ptr.type, ptr_type)) {
ReportList reports;
- BKE_reports_init(&reports, RPT_STORE);
+ BKE_reports_init(&reports, 0);
RNA_property_pointer_set(
ptr, prop, value == Py_None ? PointerRNA_NULL : param->ptr, &reports);
int err = (BPy_reports_to_error(&reports, PyExc_RuntimeError, true));
@@ -6322,7 +6322,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
ReportList reports;
bContext *C = BPy_GetContext();
- BKE_reports_init(&reports, RPT_STORE);
+ BKE_reports_init(&reports, 0);
RNA_function_call(C, &reports, self_ptr, self_func, &parms);
err = (BPy_reports_to_error(&reports, PyExc_RuntimeError, true));
@@ -8815,7 +8815,7 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
C = BPy_GetContext();
/* Call the register callback with reports & identifier. */
- BKE_reports_init(&reports, RPT_STORE);
+ BKE_reports_init(&reports, 0);
identifier = ((PyTypeObject *)py_class)->tp_name;
diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c
index d792b2032b5..1fed17987b9 100644
--- a/source/blender/python/intern/bpy_rna_anim.c
+++ b/source/blender/python/intern/bpy_rna_anim.c
@@ -344,7 +344,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
PropertyRNA *prop = NULL;
const char *prop_name;
- BKE_reports_init(&reports, RPT_STORE);
+ BKE_reports_init(&reports, 0);
/* Retrieve the property identifier from the full path, since we can't get it any other way */
prop_name = strrchr(path_full, '.');
@@ -374,7 +374,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
ReportLis
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list