forked from bartvdbraak/blender
quiet clang static checker warning by returning an error for invalid situation getting an IDProp mapping from a PyObject.
also print the path installed to when installing an addon.
This commit is contained in:
parent
40186a8c11
commit
f97dfdf227
@ -1822,8 +1822,11 @@ class WM_OT_addon_install(Operator):
|
|||||||
# in case a new module path was created to install this addon.
|
# in case a new module path was created to install this addon.
|
||||||
bpy.utils.refresh_script_paths()
|
bpy.utils.refresh_script_paths()
|
||||||
|
|
||||||
# TODO, should not be a warning.
|
# print message
|
||||||
#~ self.report({'WARNING'}, "File installed to '%s'\n" % path_dest)
|
msg = "File %r installed into %r\n" % (pyfile, path_dest)
|
||||||
|
self.report({'INFO'}, msg)
|
||||||
|
print(msg)
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
|
@ -427,6 +427,8 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
return "internal error with idp array.type";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (PyMapping_Check(ob)) {
|
else if (PyMapping_Check(ob)) {
|
||||||
@ -471,7 +473,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
|
|||||||
|
|
||||||
if (group->type == IDP_IDPARRAY) {
|
if (group->type == IDP_IDPARRAY) {
|
||||||
IDP_AppendArray(group, prop);
|
IDP_AppendArray(group, prop);
|
||||||
// IDP_FreeProperty(item); // IDP_AppendArray does a shallow copy (memcpy), only free memory
|
// IDP_FreeProperty(item); /* IDP_AppendArray does a shallow copy (memcpy), only free memory */
|
||||||
MEM_freeN(prop);
|
MEM_freeN(prop);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user