Cleanup: assign operator type flags in their initialization

Some operators OR'ed the existing flags in a way that made it seem
the value might already have some values set.
Replace this with assignment as no flags are set and the convention
with almost all operators is to write the value directly.
This commit is contained in:
Campbell Barton 2022-06-05 23:05:38 +10:00
parent 4e3ce04855
commit d450a791c3
8 changed files with 15 additions and 16 deletions

View File

@ -282,7 +282,7 @@ void WM_OT_alembic_export(wmOperatorType *ot)
ot->poll = WM_operator_winactive;
ot->ui = wm_alembic_export_draw;
ot->check = wm_alembic_export_check;
ot->flag |= OPTYPE_PRESET;
ot->flag = OPTYPE_PRESET;
WM_operator_properties_filesel(ot,
FILE_TYPE_FOLDER | FILE_TYPE_ALEMBIC,

View File

@ -468,7 +468,7 @@ void WM_OT_collada_export(wmOperatorType *ot)
ot->poll = WM_operator_winactive;
ot->check = wm_collada_export_check;
ot->flag |= OPTYPE_PRESET;
ot->flag = OPTYPE_PRESET;
ot->ui = wm_collada_export_draw;
@ -786,7 +786,7 @@ void WM_OT_collada_import(wmOperatorType *ot)
ot->exec = wm_collada_import_exec;
ot->poll = WM_operator_winactive;
// ot->flag |= OPTYPE_PRESET;
// ot->flag = OPTYPE_PRESET;
ot->ui = wm_collada_import_draw;

View File

@ -261,7 +261,7 @@ void WM_OT_obj_export(struct wmOperatorType *ot)
ot->ui = wm_obj_export_draw;
ot->check = wm_obj_export_check;
ot->flag |= OPTYPE_PRESET;
ot->flag = OPTYPE_PRESET;
WM_operator_properties_filesel(ot,
FILE_TYPE_FOLDER,

View File

@ -216,8 +216,7 @@ void WM_OT_usd_export(struct wmOperatorType *ot)
ot->ui = wm_usd_export_draw;
ot->check = wm_usd_export_check;
ot->flag = OPTYPE_REGISTER; /* No UNDO possible. */
ot->flag |= OPTYPE_PRESET;
ot->flag = OPTYPE_REGISTER | OPTYPE_PRESET; /* No UNDO possible. */
WM_operator_properties_filesel(ot,
FILE_TYPE_FOLDER | FILE_TYPE_USD,

View File

@ -777,7 +777,7 @@ void CLIP_OT_view_zoom_in(wmOperatorType *ot)
ot->poll = ED_space_clip_view_clip_poll;
/* flags */
ot->flag |= OPTYPE_LOCK_BYPASS;
ot->flag = OPTYPE_LOCK_BYPASS;
/* properties */
prop = RNA_def_float_vector(ot->srna,
@ -834,7 +834,7 @@ void CLIP_OT_view_zoom_out(wmOperatorType *ot)
ot->poll = ED_space_clip_view_clip_poll;
/* flags */
ot->flag |= OPTYPE_LOCK_BYPASS;
ot->flag = OPTYPE_LOCK_BYPASS;
/* properties */
prop = RNA_def_float_vector(ot->srna,
@ -883,7 +883,7 @@ void CLIP_OT_view_zoom_ratio(wmOperatorType *ot)
ot->poll = ED_space_clip_view_clip_poll;
/* flags */
ot->flag |= OPTYPE_LOCK_BYPASS;
ot->flag = OPTYPE_LOCK_BYPASS;
/* properties */
RNA_def_float(ot->srna,

View File

@ -1693,7 +1693,7 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot)
ot->poll = ED_operator_outliner_active;
ot->flag |= OPTYPE_REGISTER | OPTYPE_UNDO;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
PropertyRNA *prop;
prop = RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend selection for activation");
@ -2028,7 +2028,7 @@ void OUTLINER_OT_select_walk(wmOperatorType *ot)
ot->invoke = outliner_walk_select_invoke;
ot->poll = ED_operator_outliner_active;
ot->flag |= OPTYPE_REGISTER | OPTYPE_UNDO;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
PropertyRNA *prop;

View File

@ -1954,7 +1954,7 @@ void OUTLINER_OT_delete(wmOperatorType *ot)
ot->poll = ED_operator_outliner_active;
/* flags */
ot->flag |= OPTYPE_REGISTER | OPTYPE_UNDO;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
PropertyRNA *prop = RNA_def_boolean(

View File

@ -438,7 +438,7 @@ void WM_OT_link(wmOperatorType *ot)
ot->exec = wm_link_append_exec;
ot->poll = wm_link_append_poll;
ot->flag |= OPTYPE_UNDO;
ot->flag = OPTYPE_UNDO;
WM_operator_properties_filesel(ot,
FILE_TYPE_FOLDER | FILE_TYPE_BLENDER | FILE_TYPE_BLENDERLIB,
@ -462,7 +462,7 @@ void WM_OT_append(wmOperatorType *ot)
ot->exec = wm_link_append_exec;
ot->poll = wm_link_append_poll;
ot->flag |= OPTYPE_UNDO;
ot->flag = OPTYPE_UNDO;
WM_operator_properties_filesel(ot,
FILE_TYPE_FOLDER | FILE_TYPE_BLENDER | FILE_TYPE_BLENDERLIB,
@ -803,7 +803,7 @@ void WM_OT_lib_relocate(wmOperatorType *ot)
ot->invoke = wm_lib_relocate_invoke;
ot->exec = wm_lib_relocate_exec;
ot->flag |= OPTYPE_UNDO;
ot->flag = OPTYPE_UNDO;
prop = RNA_def_string(ot->srna, "library", NULL, MAX_NAME, "Library", "Library to relocate");
RNA_def_property_flag(prop, PROP_HIDDEN);
@ -833,7 +833,7 @@ void WM_OT_lib_reload(wmOperatorType *ot)
ot->exec = wm_lib_reload_exec;
ot->flag |= OPTYPE_UNDO;
ot->flag = OPTYPE_UNDO;
prop = RNA_def_string(ot->srna, "library", NULL, MAX_NAME, "Library", "Library to reload");
RNA_def_property_flag(prop, PROP_HIDDEN);