summaryrefslogtreecommitdiffstats
path: root/api/logic/BaseInstaller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/BaseInstaller.cpp')
-rw-r--r--api/logic/BaseInstaller.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/api/logic/BaseInstaller.cpp b/api/logic/BaseInstaller.cpp
index 51f66293..3819a4e4 100644
--- a/api/logic/BaseInstaller.cpp
+++ b/api/logic/BaseInstaller.cpp
@@ -1,4 +1,4 @@
-/* Copyright 2013-2018 MultiMC Contributors
+/* Copyright 2013-2019 MultiMC Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,37 +25,37 @@ BaseInstaller::BaseInstaller()
bool BaseInstaller::isApplied(MinecraftInstance *on)
{
- return QFile::exists(filename(on->instanceRoot()));
+ return QFile::exists(filename(on->instanceRoot()));
}
bool BaseInstaller::add(MinecraftInstance *to)
{
- if (!patchesDir(to->instanceRoot()).exists())
- {
- QDir(to->instanceRoot()).mkdir("patches");
- }
-
- if (isApplied(to))
- {
- if (!remove(to))
- {
- return false;
- }
- }
-
- return true;
+ if (!patchesDir(to->instanceRoot()).exists())
+ {
+ QDir(to->instanceRoot()).mkdir("patches");
+ }
+
+ if (isApplied(to))
+ {
+ if (!remove(to))
+ {
+ return false;
+ }
+ }
+
+ return true;
}
bool BaseInstaller::remove(MinecraftInstance *from)
{
- return QFile::remove(filename(from->instanceRoot()));
+ return QFile::remove(filename(from->instanceRoot()));
}
QString BaseInstaller::filename(const QString &root) const
{
- return patchesDir(root).absoluteFilePath(id() + ".json");
+ return patchesDir(root).absoluteFilePath(id() + ".json");
}
QDir BaseInstaller::patchesDir(const QString &root) const
{
- return QDir(root + "/patches/");
+ return QDir(root + "/patches/");
}