[Bf-blender-cvs] [1fd35126c42] blender-v3.3-release: Fix File Browser Move Bookmark malfunction if no item is selected
Philipp Oeser
noreply at git.blender.org
Mon Nov 28 14:21:54 CET 2022
Commit: 1fd35126c42656e1792080534107679476c3d106
Author: Philipp Oeser
Date: Fri Nov 4 10:28:20 2022 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rB1fd35126c42656e1792080534107679476c3d106
Fix File Browser Move Bookmark malfunction if no item is selected
The operator was acting on non selected items (wasnt checking SpaceFile
bookmarknr for being -1) which could end up removing items even.
Now sanatize this by introducing proper poll (which returns false if
nothing is selected).
Fixes T102014.
Maniphest Tasks: T102014
Differential Revision: https://developer.blender.org/D16385
===================================================================
M source/blender/editors/space_file/file_ops.c
===================================================================
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 59d9a15fbab..54cd281da5b 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -1316,6 +1316,18 @@ static int bookmark_move_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
+static bool file_bookmark_move_poll(bContext *C)
+{
+ SpaceFile *sfile = CTX_wm_space_file(C);
+
+ /* Bookmarks are for file browsing only (not asset browsing). */
+ if (!ED_operator_file_browsing_active(C)) {
+ return false;
+ }
+
+ return sfile->bookmarknr != -1;
+}
+
void FILE_OT_bookmark_move(wmOperatorType *ot)
{
static const EnumPropertyItem slot_move[] = {
@@ -1332,8 +1344,7 @@ void FILE_OT_bookmark_move(wmOperatorType *ot)
/* api callbacks */
ot->exec = bookmark_move_exec;
- /* Bookmarks are for file browsing only (not asset browsing). */
- ot->poll = ED_operator_file_browsing_active;
+ ot->poll = file_bookmark_move_poll;
/* flags */
ot->flag = OPTYPE_REGISTER; /* No undo! */
More information about the Bf-blender-cvs
mailing list