Asset Browser: add notifiers on catalog edits

Send out notifications on catalog edits. This way all asset browsers will
refresh when catalogs are edited.
This commit is contained in:
Sybren A. Stüvel 2021-10-22 16:35:18 +02:00
parent 85312f2236
commit cd6fc651ce
1 changed files with 3 additions and 0 deletions

View File

@ -77,6 +77,7 @@ AssetCatalog *ED_asset_catalog_add(::AssetLibrary *library,
}
catalog_service->tag_has_unsaved_changes(new_catalog);
WM_main_add_notifier(NC_SPACE | ND_SPACE_ASSET_PARAMS, nullptr);
return new_catalog;
}
@ -91,6 +92,7 @@ void ED_asset_catalog_remove(::AssetLibrary *library, const CatalogID &catalog_i
catalog_service->undo_push();
catalog_service->tag_has_unsaved_changes(nullptr);
catalog_service->prune_catalogs_by_id(catalog_id);
WM_main_add_notifier(NC_SPACE | ND_SPACE_ASSET_PARAMS, nullptr);
}
void ED_asset_catalog_rename(::AssetLibrary *library,
@ -116,6 +118,7 @@ void ED_asset_catalog_rename(::AssetLibrary *library,
catalog_service->undo_push();
catalog_service->tag_has_unsaved_changes(catalog);
catalog_service->update_catalog_path(catalog_id, new_path);
WM_main_add_notifier(NC_SPACE | ND_SPACE_ASSET_PARAMS, nullptr);
}
void ED_asset_catalogs_save_from_main_path(::AssetLibrary *library, const Main *bmain)