Fix #104722: Outliner renaming uses wrong item

The property value should be reset for the next operator execution, not
remembered. Also hide it from auto-generated UIs, this is an internal
property nothing meant for the user to edit.

Also see discussion in #105872.
This commit is contained in:
Julian Eisel
2023-05-01 11:02:05 +02:00
parent 20f54a5698
commit f8d2156dda

View File

@@ -423,6 +423,8 @@ static int outliner_item_rename(bContext *C, wmOperator *op, const wmEvent *even
void OUTLINER_OT_item_rename(wmOperatorType *ot)
{
PropertyRNA *prop;
ot->name = "Rename";
ot->idname = "OUTLINER_OT_item_rename";
ot->description = "Rename the active element";
@@ -434,11 +436,12 @@ void OUTLINER_OT_item_rename(wmOperatorType *ot)
/* Flags. */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna,
"use_active",
false,
"Use Active",
"Rename the active item, rather than the one the mouse is over");
prop = RNA_def_boolean(ot->srna,
"use_active",
false,
"Use Active",
"Rename the active item, rather than the one the mouse is over");
RNA_def_property_flag(prop, PropertyFlag(PROP_SKIP_SAVE | PROP_HIDDEN));
}
/** \} */