Asset: Merge asset library/list refresh operators

In rBdcdbaf89bd11, I introduced a new operator
(`file.asset_library_refresh()`) to handle Asset Browser refreshing more
separate from File Browser refreshing. However, there already was
`asset.asset_list_refresh()`, which at this point only works for asset
view templates, but was intended to cover the Asset Browser case in
future too. This would happen once the Asset Browser uses the asset list
design of the asset view template.

So rather than having two operators for refreshing asset library data,
have one that just handles both cases, until they converge into one.
This avoids changes to the Python API in future (deprecating/changing
operators).

Differential Revision: https://developer.blender.org/D13239
This commit is contained in:
2021-11-23 18:40:31 +01:00
parent 60befc8f02
commit ea93e5df6c
10 changed files with 43 additions and 56 deletions

View File

@@ -1955,35 +1955,6 @@ void FILE_OT_refresh(struct wmOperatorType *ot)
/** \} */
/* -------------------------------------------------------------------- */
/** \name Refresh Asset Library Operator
* \{ */
static int file_asset_library_refresh_exec(bContext *C, wmOperator *UNUSED(unused))
{
wmWindowManager *wm = CTX_wm_manager(C);
SpaceFile *sfile = CTX_wm_space_file(C);
ED_fileselect_clear(wm, sfile);
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_LIST, NULL);
return OPERATOR_FINISHED;
}
void FILE_OT_asset_library_refresh(struct wmOperatorType *ot)
{
/* identifiers */
ot->name = "Refresh Asset Library";
ot->description = "Reread assets and asset catalogs from the asset library on disk";
ot->idname = "FILE_OT_asset_library_refresh";
/* api callbacks */
ot->exec = file_asset_library_refresh_exec;
ot->poll = ED_operator_asset_browsing_active;
}
/** \} */
/* -------------------------------------------------------------------- */
/** \name Navigate Parent Operator
* \{ */