Cleanup: follow our API naming conventions
Minor changes to recently added undo API call.
This commit is contained in:
@@ -157,4 +157,4 @@ void ED_undosys_stack_memfile_id_changed_tag(UndoStack *ustack, ID *id);
|
||||
*
|
||||
* \return Total memory usage in bytes, or 0 if no undo stack is available.
|
||||
*/
|
||||
size_t ED_get_total_undo_memory();
|
||||
size_t ED_undosys_total_memory_calc(UndoStack *ustack);
|
||||
|
||||
@@ -913,13 +913,8 @@ Vector<Base *> ED_undo_editmode_bases_from_view_layer(const Scene *scene, ViewLa
|
||||
return bases;
|
||||
}
|
||||
|
||||
size_t ED_get_total_undo_memory()
|
||||
size_t ED_undosys_total_memory_calc(UndoStack *ustack)
|
||||
{
|
||||
UndoStack *ustack = ED_undo_stack_get();
|
||||
if (!ustack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t total_memory = 0;
|
||||
|
||||
for (UndoStep *us = static_cast<UndoStep *>(ustack->steps.first); us != nullptr; us = us->next) {
|
||||
|
||||
@@ -659,9 +659,11 @@ PyDoc_STRVAR(
|
||||
|
||||
static PyObject *bpy_app_undo_memory_info(PyObject * /*self*/, PyObject * /*args*/)
|
||||
{
|
||||
|
||||
size_t total_memory = ED_get_total_undo_memory();
|
||||
|
||||
size_t total_memory = 0;
|
||||
UndoStack *ustack = ED_undo_stack_get();
|
||||
if (ustack) {
|
||||
total_memory = ED_undosys_total_memory_calc(ustack);
|
||||
}
|
||||
return PyLong_FromSize_t(total_memory);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user