From 64a6dbcfdb89a5f57d93d47a2be0c741dda4662d Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 15 Aug 2021 09:17:02 -0700 Subject: Fix issues and cleanup - Fix compile error on MSVC where is not included properly - Fix creating a workflow actually saves to the templates/ directory - Fix renaming assets are not saved to disk - TODO ser/deser still not working - Cleanup AssetList::* pure virtual setup (fewer splits) --- core/src/Model/Workflow/Workflow.hpp | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'core/src/Model/Workflow/Workflow.hpp') diff --git a/core/src/Model/Workflow/Workflow.hpp b/core/src/Model/Workflow/Workflow.hpp index cba0d72..c156582 100644 --- a/core/src/Model/Workflow/Workflow.hpp +++ b/core/src/Model/Workflow/Workflow.hpp @@ -7,13 +7,13 @@ #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -41,7 +41,7 @@ public: void DrawDebugInfo() const; void ReadFrom(std::istream& stream); - void WriteTo(std::ostream& stream); + void WriteTo(std::ostream& stream) const; }; class WorkflowNode @@ -285,7 +285,7 @@ public: RR_InvalidVersion, }; ReadResult ReadFrom(std::istream& stream); - void WriteTo(std::ostream& stream); + void WriteTo(std::ostream& stream) const; private: std::pair AllocWorkflowConnection(); @@ -303,21 +303,18 @@ public: // Inherit constructors using AssetListTyped::AssetListTyped; -public: - virtual void DiscoverFiles(const std::function& callback) const override; - - virtual std::string RetrieveNameFromFile(const std::filesystem::path& file) const override; - virtual uuids::uuid RetrieveUuidFromFile(const std::filesystem::path& file) const override; - virtual std::filesystem::path RetrievePathFromAsset(const SavedAsset& asset) const override; - - virtual void SaveEmptyInstance(const SavedAsset& asset) const override; - virtual Workflow* CreateEmptyInstance(const SavedAsset& diskForm) const override; +protected: + void DiscoverFiles(const std::function& callback) const override; - virtual Workflow* LoadImpl(const SavedAsset& diskForm) const override; + std::string RetrieveNameFromFile(const std::filesystem::path& file) const override; + uuids::uuid RetrieveUuidFromFile(const std::filesystem::path& file) const override; + std::filesystem::path RetrievePathFromAsset(const SavedAsset& asset) const override; - virtual void DisplayAssetCreator(ListState& state) override; + bool SaveInstance(const SavedAsset& assetInfo, const Asset* asset) const override; + Workflow* LoadInstance(const SavedAsset& assetInfo) const override; + Workflow* CreateInstance(const SavedAsset& assetInfo) const override; + bool RenameInstanceOnDisk(const SavedAsset& assetInfo, std::string_view oldName) const override; - virtual void SetupDetailsTable(const char* tableId) const override; - virtual void DrawBigIcon(ListState& state, const SavedAsset& asset) const override; - virtual void DrawDetailsTableRow(ListState& state, const SavedAsset& asset) const override; + void DisplayAssetCreator(ListState& state) override; + void DisplayDetailsTable(ListState& state) const override; }; -- cgit v1.2.3-70-g09d2