operators called from python were not getting their reports back into python errors.

eg:
- console calls operator
- operator calls report
- report went into header rather them back into the console as an error.
This commit is contained in:
Campbell Barton 2011-03-22 02:38:39 +00:00
parent a503713d6c
commit 2299d674f4
3 changed files with 5 additions and 3 deletions

@ -85,7 +85,8 @@ typedef enum ReportType {
enum ReportListFlags {
RPT_PRINT = 1,
RPT_STORE = 2,
RPT_FREE = 4
RPT_FREE = 4,
RPT_OP_HOLD = 8 /* dont move them into the operator global list (caller will use) */
};
#
#

@ -195,7 +195,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
ReportList *reports;
reports= MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
BKE_reports_init(reports, RPT_STORE);
BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD); /* own so these dont move into global reports */
operator_ret= WM_operator_call_py(C, ot, context, &ptr, reports);

@ -453,7 +453,8 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int pop
}
}
if (op->reports->list.first) {
/* if the caller owns them them handle this */
if (op->reports->list.first && (op->reports->flag & RPT_OP_HOLD) == 0) {
wmWindowManager *wm = CTX_wm_manager(C);
ReportList *wm_reports= CTX_wm_reports(C);