From b0e9a74bb4725cc78e0b41d21149d5a130abc14c Mon Sep 17 00:00:00 2001 From: codereader Date: Sat, 28 Aug 2021 06:36:06 +0200 Subject: [PATCH] #5729: AutoSave algorithm part moved to core module --- radiant/CMakeLists.txt | 1 - radiant/map/AutoSaveTimer.h | 3 ++- radiantcore/CMakeLists.txt | 1 + .../map/autosaver}/AutoSaver.cpp | 1 + .../map => radiantcore/map/autosaver}/AutoSaver.h | 15 +++++---------- tools/msvc/DarkRadiant.vcxproj | 2 -- tools/msvc/DarkRadiant.vcxproj.filters | 6 ------ tools/msvc/DarkRadiantCore.vcxproj | 2 ++ tools/msvc/DarkRadiantCore.vcxproj.filters | 9 +++++++++ 9 files changed, 20 insertions(+), 20 deletions(-) rename {radiant/map => radiantcore/map/autosaver}/AutoSaver.cpp (99%) rename {radiant/map => radiantcore/map/autosaver}/AutoSaver.h (89%) diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt index 90dede42a3..6b049c3b5f 100644 --- a/radiant/CMakeLists.txt +++ b/radiant/CMakeLists.txt @@ -14,7 +14,6 @@ add_executable(darkradiant eventmanager/WidgetToggle.cpp log/Console.cpp main.cpp - map/AutoSaver.cpp map/AutoSaveTimer.cpp map/StartupMapLoader.cpp RadiantApp.cpp diff --git a/radiant/map/AutoSaveTimer.h b/radiant/map/AutoSaveTimer.h index d8cb9cd69a..b645cc678c 100644 --- a/radiant/map/AutoSaveTimer.h +++ b/radiant/map/AutoSaveTimer.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include +#include namespace map { diff --git a/radiantcore/CMakeLists.txt b/radiantcore/CMakeLists.txt index 5c01f563b1..c668bf048d 100644 --- a/radiantcore/CMakeLists.txt +++ b/radiantcore/CMakeLists.txt @@ -95,6 +95,7 @@ add_library(radiantcore MODULE map/algorithm/MapImporter.cpp map/algorithm/Models.cpp map/algorithm/Skins.cpp + map/autosaver/AutoSaver.cpp map/ArchivedMapResource.cpp map/CounterManager.cpp map/EditingStopwatch.cpp diff --git a/radiant/map/AutoSaver.cpp b/radiantcore/map/autosaver/AutoSaver.cpp similarity index 99% rename from radiant/map/AutoSaver.cpp rename to radiantcore/map/autosaver/AutoSaver.cpp index 689c5436d6..401a889266 100644 --- a/radiant/map/AutoSaver.cpp +++ b/radiantcore/map/autosaver/AutoSaver.cpp @@ -7,6 +7,7 @@ #include "itextstream.h" #include "iscenegraph.h" #include "iradiant.h" +#include "iregistry.h" #include "igame.h" #include "ipreferencesystem.h" #include "icommandsystem.h" diff --git a/radiant/map/AutoSaver.h b/radiantcore/map/autosaver/AutoSaver.h similarity index 89% rename from radiant/map/AutoSaver.h rename to radiantcore/map/autosaver/AutoSaver.h index 88ae89959a..204285d254 100644 --- a/radiant/map/AutoSaver.h +++ b/radiantcore/map/autosaver/AutoSaver.h @@ -2,24 +2,20 @@ #include -#include "iregistry.h" -#include "imodule.h" #include "imap.h" #include "iautosaver.h" #include #include #include "os/fs.h" -#include -#include - -/* greebo: The AutoMapSaver class lets itself being called in distinct intervals - * and saves the map files either to snapshots or to a single yyyy.autosave.map file. - */ namespace map { +/** + * greebo: The AutoMapSaver class lets itself being called in distinct intervals + * and saves the map files either to snapshots or to a single yyyy.autosave.map file. + */ class AutoMapSaver final : public IAutomaticMapSaver { @@ -65,7 +61,6 @@ class AutoMapSaver final : void handleSnapshotSizeLimit(const std::map& existingSnapshots, const fs::path& snapshotPath, const std::string& mapName); - -}; // class AutoMapSaver +}; } // namespace map diff --git a/tools/msvc/DarkRadiant.vcxproj b/tools/msvc/DarkRadiant.vcxproj index 88c010a075..a942ca3c37 100644 --- a/tools/msvc/DarkRadiant.vcxproj +++ b/tools/msvc/DarkRadiant.vcxproj @@ -205,7 +205,6 @@ - @@ -407,7 +406,6 @@ - diff --git a/tools/msvc/DarkRadiant.vcxproj.filters b/tools/msvc/DarkRadiant.vcxproj.filters index a6ff114cfe..1375ccc79c 100644 --- a/tools/msvc/DarkRadiant.vcxproj.filters +++ b/tools/msvc/DarkRadiant.vcxproj.filters @@ -616,9 +616,6 @@ src\ui\common - - src\map - src\ui\mapselector @@ -1272,9 +1269,6 @@ src\ui\common - - src\map - src\ui\mapselector diff --git a/tools/msvc/DarkRadiantCore.vcxproj b/tools/msvc/DarkRadiantCore.vcxproj index de88258137..05ebfefddd 100644 --- a/tools/msvc/DarkRadiantCore.vcxproj +++ b/tools/msvc/DarkRadiantCore.vcxproj @@ -105,6 +105,7 @@ + @@ -826,6 +827,7 @@ + diff --git a/tools/msvc/DarkRadiantCore.vcxproj.filters b/tools/msvc/DarkRadiantCore.vcxproj.filters index 08968dfd00..abee6b8f40 100644 --- a/tools/msvc/DarkRadiantCore.vcxproj.filters +++ b/tools/msvc/DarkRadiantCore.vcxproj.filters @@ -206,6 +206,9 @@ {fe243505-dda8-4a93-9a9e-eb98a4c535e8} + + {e3d5bb4e-6b61-4537-ab0f-30c7be429c65} + @@ -1069,6 +1072,9 @@ src\model\picomodel\lib + + src\map\autosaver + @@ -2175,5 +2181,8 @@ src\model\import + + src\map\autosaver + \ No newline at end of file