summaryrefslogtreecommitdiffstats
path: root/logic/OneSixInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'logic/OneSixInstance.cpp')
-rw-r--r--logic/OneSixInstance.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp
index 7b038c46..8124b4a0 100644
--- a/logic/OneSixInstance.cpp
+++ b/logic/OneSixInstance.cpp
@@ -226,6 +226,30 @@ QString OneSixInstance::currentVersionId() const
return intendedVersionId();
}
+bool OneSixInstance::customizeVersion()
+{
+ if(!versionIsCustom())
+ {
+ auto pathCustom = PathCombine(instanceRoot(), "custom.json");
+ auto pathOrig = PathCombine(instanceRoot(), "version.json");
+ QFile::copy(pathOrig, pathCustom);
+ return reloadFullVersion();
+ }
+ else return true;
+}
+
+bool OneSixInstance::revertCustomVersion()
+{
+ if(versionIsCustom())
+ {
+ auto path = PathCombine(instanceRoot(), "custom.json");
+ QFile::remove(path);
+ return reloadFullVersion();
+ }
+ else return true;
+}
+
+
bool OneSixInstance::reloadFullVersion()
{
I_D(OneSixInstance);