From 7fe47a9d5b1727a61dc724523b530762f6d6ba19 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 30 Jun 2022 21:38:53 -0700 Subject: Restructure project --- core/src/Model/GlobalStates.hpp | 55 ----------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 core/src/Model/GlobalStates.hpp (limited to 'core/src/Model/GlobalStates.hpp') diff --git a/core/src/Model/GlobalStates.hpp b/core/src/Model/GlobalStates.hpp deleted file mode 100644 index cc41bd5..0000000 --- a/core/src/Model/GlobalStates.hpp +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include "Utils/Sigslot.hpp" -#include "cplt_fwd.hpp" - -#include -#include -#include - -class GlobalStates -{ -public: - static void Init(); - static void Init(std::filesystem::path userDataDir); - static void Shutdown(); - - static GlobalStates& GetInstance(); - static const std::filesystem::path& GetUserDataPath(); - - struct RecentProject - { - std::filesystem::path Path; - std::string CachedUtf8String; - }; - -public: - Signal<> OnModified; - -private: - std::vector mRecentProjects; - std::unique_ptr mCurrentProject; - mutable bool mDirty = false; - -public: - const std::vector& GetRecentProjects() const; - void ClearRecentProjects(); - void AddRecentProject(const Project& project); - /// Move or add the project to end of the recent projects list. - /// If the project is not in the list of recently used projects, it will be appended, otherwise - /// it will be moved to the end. - void MoveProjectToTop(const Project& project); - void RemoveRecentProject(int idx); - - bool HasCurrentProject() const; - Project* GetCurrentProject() const; - void SetCurrentProject(std::unique_ptr project); - - // TODO async autosaving to prevent data loss on crash - void WriteToDisk() const; - - bool IsDirty() const; - -private: - void MarkDirty(); -}; -- cgit v1.2.3-70-g09d2