Page MenuHome

Asset Catalogs: undo stack for catalog edits
ClosedPublic

Authored by Sybren A. Stüvel (sybren) on Oct 11 2021, 5:38 PM.

Details

Summary

Add an undo stack for catalog edits. This only implements the backend, no operators or UI yet.

A lot of this->catalogs_ has now been replaced by catalog_collection_->catalogs_. Things are getting a bit long. What would you think @Julian Eisel (Severin) of having a protected function catalogs() that just returns catalog_collection_->catalogs_? And then of course the same for deleted_catalogs_ and catalog_definition_file_.

Also note that T92114: Refactor AssetCatalogservice exists.

Diff Detail

Repository
rB Blender

Event Timeline

Sybren A. Stüvel (sybren) requested review of this revision.Oct 11 2021, 5:38 PM
Sybren A. Stüvel (sybren) created this revision.
Sybren A. Stüvel (sybren) edited the summary of this revision. (Show Details)

What would you think @Julian Eisel (Severin) of having a protected function catalogs() that just returns catalog_collection_->catalogs_? And then of course the same for deleted_catalogs_ and catalog_definition_file_.

I think that's perfectly fine. I like such convenience wrappers that strip away implementation details and let you focus on the bits that matter.

source/blender/blenkernel/BKE_asset_catalog.hh
167–168

Could/should this maybe be moved to a different class, say AssetCatalogUndoHistory? The catalog service turns more and more into a god object :) I'd rather have it delegate tasks some more.

Sybren A. Stüvel (sybren) marked an inline comment as done.Oct 11 2021, 6:02 PM
Sybren A. Stüvel (sybren) added inline comments.
source/blender/blenkernel/BKE_asset_catalog.hh
167–168

Yup, that's why I created T92114.

Sybren A. Stüvel (sybren) marked an inline comment as done.Oct 11 2021, 6:02 PM

What would you think @Julian Eisel (Severin) of having a protected function catalogs() that just returns catalog_collection_->catalogs_? And then of course the same for deleted_catalogs_ and catalog_definition_file_.

I think that's perfectly fine. I like such convenience wrappers that strip away implementation details and let you focus on the bits that matter.

I'll keep that for T92114: Refactor AssetCatalogservice; there are some more high-prio tasks I want to finish soon, and those are more important right now ;-)

This revision is now accepted and ready to land.Oct 12 2021, 12:01 PM