This PR includes a number of changes that are needed to fix issues with undo commands in Toolbox.
CacheItem.cascade_readd() now sets _to_remove to False. Unless I missed something, this is the only truly backwards-incompatible change.
Functions that remove items now return the cache items that were actually removed. This makes it possible to fully undo remove actions in Toolbox.
A new function CacheItem.readd() adds items without adding their referrers. This allows redoing additions that have later received referrers. For example, redoing an 'add object class' command should only readd the object class, not its parameter definitions that were added later.
CacheItem.deepcopy() can be used to create independent clones of CacheItems.
Re spine-tools/Spine-Toolbox#2228
@manuelma Just a heads-up: this might interfere with the entity branch.
Checklist before merging
[x] Documentation (also in Toolbox repo) is up-to-date
[x] Release notes in Toolbox repo have been updated
[x] Unit tests have been added/updated accordingly
This PR includes a number of changes that are needed to fix issues with undo commands in Toolbox.
CacheItem.cascade_readd()
now sets_to_remove
toFalse
. Unless I missed something, this is the only truly backwards-incompatible change.CacheItem.readd()
adds items without adding their referrers. This allows redoing additions that have later received referrers. For example, redoing an 'add object class' command should only readd the object class, not its parameter definitions that were added later.CacheItem.deepcopy()
can be used to create independent clones of CacheItems.Re spine-tools/Spine-Toolbox#2228
@manuelma Just a heads-up: this might interfere with the entity branch.
Checklist before merging