From 5b104fb3fa02d977e6d029cda2787c272f2357d0 Mon Sep 17 00:00:00 2001 From: Guillermo Venegas Date: Sat, 6 Jan 2024 06:53:42 +0100 Subject: [PATCH] Cleanup: Silence warnings from 1254fee589 Introduced in 1254fee5898ba2a8e21bb6b64ee5f235248ff386 Also remove translation from CLOG statements. Pull Request: https://projects.blender.org/blender/blender/pulls/116836 --- doc/python_api/examples/bpy.types.FileHandler.1.py | 5 +++-- doc/python_api/examples/bpy.types.FileHandler.2.py | 5 +++-- source/blender/editors/io/io_drop_import_file.cc | 4 ++-- source/blender/makesrna/intern/rna_access.cc | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/python_api/examples/bpy.types.FileHandler.1.py b/doc/python_api/examples/bpy.types.FileHandler.1.py index ebb498cd215..1c9620715e4 100644 --- a/doc/python_api/examples/bpy.types.FileHandler.1.py +++ b/doc/python_api/examples/bpy.types.FileHandler.1.py @@ -1,6 +1,6 @@ """ Basic FileHandler for Operator that imports just one file ------------------ +--------------------------------------------------------- When creating a ``Operator`` that imports files, you may want to add them 'drag-and-drop' support, File Handlers helps to define @@ -14,6 +14,7 @@ required a set of properties, when the ``Operator`` can import just one file per execution it needs to define the following property: .. code-block:: python + filepath: bpy.props.StringProperty(subtype='FILE_PATH') This ``filepath`` property now will be used by the ``FileHandler`` to @@ -55,7 +56,7 @@ class CurveTextImport(bpy.types.Operator): By default the file handler invokes the operator with the filepath property set. In this example if this property is set the operator is executed, if not the file select window is invoked. - This depends on setting 'options={'SKIP_SAVE'}' to the property options to avoid + This depends on setting ``options={'SKIP_SAVE'}`` to the property options to avoid to reuse filepath data between operator calls. """ diff --git a/doc/python_api/examples/bpy.types.FileHandler.2.py b/doc/python_api/examples/bpy.types.FileHandler.2.py index 7507a944ec6..d510bb88c37 100644 --- a/doc/python_api/examples/bpy.types.FileHandler.2.py +++ b/doc/python_api/examples/bpy.types.FileHandler.2.py @@ -1,11 +1,12 @@ """ Basic FileHandler for Operator that imports multiple files ------------------ +---------------------------------------------------------- Also operators can be invoked with multiple files from 'drag-and-drop', but for this it is require to define the following properties: .. code-block:: python + directory: StringProperty(subtype='FILE_PATH') files: CollectionProperty(type=bpy.types.OperatorFileListElement) @@ -64,7 +65,7 @@ class ShaderScriptImport(bpy.types.Operator): By default the file handler invokes the operator with the directory and files properties set. In this example if this properties are set the operator is executed, if not the file select window is invoked. - This depends on setting 'options={'SKIP_SAVE'}' to the properties options to avoid + This depends on setting ``options={'SKIP_SAVE'}`` to the properties options to avoid to reuse filepath data between operator calls. """ diff --git a/source/blender/editors/io/io_drop_import_file.cc b/source/blender/editors/io/io_drop_import_file.cc index fc92b68e557..f49bc96a5a5 100644 --- a/source/blender/editors/io/io_drop_import_file.cc +++ b/source/blender/editors/io/io_drop_import_file.cc @@ -114,7 +114,7 @@ static PointerRNA file_handler_import_operator_create_ptr( const char *message = "Expected operator properties filepath or files and directory not found. Refer to " "FileHandler documentation for details."; - CLOG_WARN(&LOG, TIP_(message)); + CLOG_WARN(&LOG, "%s", message); } return props; } @@ -195,7 +195,7 @@ void WM_OT_drop_import_file(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } -void drop_import_file_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop) +static void drop_import_file_copy(bContext * /*C*/, wmDrag *drag, wmDropBox *drop) { const auto paths = WM_drag_get_paths(drag); diff --git a/source/blender/makesrna/intern/rna_access.cc b/source/blender/makesrna/intern/rna_access.cc index bc7c9ddc0c9..f8b9ca0f514 100644 --- a/source/blender/makesrna/intern/rna_access.cc +++ b/source/blender/makesrna/intern/rna_access.cc @@ -819,7 +819,7 @@ PropertyRNA *RNA_struct_find_property_check(PointerRNA &props, return prop; } CLOG_WARN(&LOG, - TIP_("'%s : %s()' expected, got '%s : %s()'"), + "'%s : %s()' expected, got '%s : %s()'", name, rna_property_type_identifier(property_type_check), name, @@ -844,7 +844,7 @@ PropertyRNA *RNA_struct_find_collection_property_check(PointerRNA &props, if (prop_type != PROP_COLLECTION) { CLOG_WARN(&LOG, - TIP_("'%s : %s(type = %s)' expected, got '%s : %s()'"), + "'%s : %s(type = %s)' expected, got '%s : %s()'", name, rna_property_type_identifier(PROP_COLLECTION), RNA_struct_identifier(struct_type_check), @@ -854,7 +854,7 @@ PropertyRNA *RNA_struct_find_collection_property_check(PointerRNA &props, } CLOG_WARN(&LOG, - TIP_("'%s : %s(type = %s)' expected, got '%s : %s(type = %s)'."), + "'%s : %s(type = %s)' expected, got '%s : %s(type = %s)'.", name, rna_property_type_identifier(PROP_COLLECTION), RNA_struct_identifier(struct_type_check),