Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2021-10-12 15:42:27 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-10-12 15:42:36 +0300
commitf1d97a308d4a588694cdd41db57197576f1432c0 (patch)
tree15e89d91bf02cba3763606b52c29b521a9d54f73 /source
parent3a03d6c8519e3b12d5f3a359e3b8eccfe01ec6af (diff)
Cleanup: asset catalogs, rename store_undo_snapshot to undo_push
Rename `bke::AssetCatalogService::store_undo_snapshot` to `undo_push`. This makes the function named the same way as the global Blender "undo push" function. No functional changes.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_asset_catalog.hh2
-rw-r--r--source/blender/blenkernel/intern/asset_catalog.cc2
-rw-r--r--source/blender/blenkernel/intern/asset_catalog_test.cc8
3 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_asset_catalog.hh b/source/blender/blenkernel/BKE_asset_catalog.hh
index b677adefb46..d5c8acff960 100644
--- a/source/blender/blenkernel/BKE_asset_catalog.hh
+++ b/source/blender/blenkernel/BKE_asset_catalog.hh
@@ -146,7 +146,7 @@ class AssetCatalogService {
/**
* Store the current catalogs in the undo stack.
* This snapshots everything in the #AssetCatalogCollection. */
- void store_undo_snapshot();
+ void undo_push();
/**
* Restore the last-saved undo snapshot, pushing the current state onto the redo stack.
* The caller is responsible for first checking that undoing is possible.
diff --git a/source/blender/blenkernel/intern/asset_catalog.cc b/source/blender/blenkernel/intern/asset_catalog.cc
index 1b8ab6f7196..2d4956e7e25 100644
--- a/source/blender/blenkernel/intern/asset_catalog.cc
+++ b/source/blender/blenkernel/intern/asset_catalog.cc
@@ -495,7 +495,7 @@ void AssetCatalogService::redo()
catalog_collection_ = std::move(redo_snapshots_.pop_last());
}
-void AssetCatalogService::store_undo_snapshot()
+void AssetCatalogService::undo_push()
{
std::unique_ptr<AssetCatalogCollection> snapshot = catalog_collection_->deep_copy();
undo_snapshots_.append(std::move(snapshot));
diff --git a/source/blender/blenkernel/intern/asset_catalog_test.cc b/source/blender/blenkernel/intern/asset_catalog_test.cc
index 3522ad80bdd..d1413d521a1 100644
--- a/source/blender/blenkernel/intern/asset_catalog_test.cc
+++ b/source/blender/blenkernel/intern/asset_catalog_test.cc
@@ -1178,7 +1178,7 @@ TEST_F(AssetCatalogTest, undo_redo_one_step)
EXPECT_FALSE(service.is_undo_possbile())
<< "Undo steps should be created explicitly, and not after creating any catalog.";
- service.store_undo_snapshot();
+ service.undo_push();
const bUUID other_catalog_id = service.create_catalog("other/catalog/path")->catalog_id;
EXPECT_TRUE(service.is_undo_possbile())
<< "Undo should be possible after creating an undo snapshot.";
@@ -1214,16 +1214,16 @@ TEST_F(AssetCatalogTest, undo_redo_more_complex)
TestableAssetCatalogService service(asset_library_root_);
service.load_from_disk();
- service.store_undo_snapshot();
+ service.undo_push();
service.find_catalog(UUID_POSES_ELLIE_WHITESPACE)->simple_name = "Edited simple name";
- service.store_undo_snapshot();
+ service.undo_push();
service.find_catalog(UUID_POSES_ELLIE)->path = "poselib/EllieWithEditedPath";
service.undo();
service.undo();
- service.store_undo_snapshot();
+ service.undo_push();
service.find_catalog(UUID_POSES_ELLIE)->simple_name = "Ellie Simple";
EXPECT_FALSE(service.is_redo_possbile())