summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-19 21:25:27 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-19 21:25:27 +0300
commit7225c69c5bf2de13d32d6e9a658779405c8e2707 (patch)
tree5fbd69d62ae8bd65b7b7a2e9986041aee4829888 /src/gui
parentc0af9f41451d782b316feea8cf93fc50d4bd6733 (diff)
downloadplus-7225c69c5bf2de13d32d6e9a658779405c8e2707.tar.gz
plus-7225c69c5bf2de13d32d6e9a658779405c8e2707.tar.bz2
plus-7225c69c5bf2de13d32d6e9a658779405c8e2707.tar.xz
plus-7225c69c5bf2de13d32d6e9a658779405c8e2707.zip
Add strong typed bool enum Append.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/updaterwindow.cpp21
-rw-r--r--src/gui/windows/updaterwindow.h4
2 files changed, 15 insertions, 10 deletions
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 784fd2ad5..9597de849 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -663,7 +663,7 @@ void UpdaterWindow::loadUpdates()
UpdaterWindow::addUpdateFile(mUpdatesDir,
fixPath,
file.name,
- false);
+ Append_false);
}
loadManaPlusUpdates(mUpdatesDir);
loadMods(mUpdatesDir, mUpdateFiles);
@@ -693,7 +693,7 @@ void UpdaterWindow::loadLocalUpdates(const std::string &dir)
UpdaterWindow::addUpdateFile(dir,
fixPath,
file.name,
- false);
+ Append_false);
}
loadManaPlusUpdates(dir);
loadMods(dir, updateFiles);
@@ -740,7 +740,7 @@ void UpdaterWindow::loadManaPlusUpdates(const std::string &dir)
std::string fileName = std::string(fixPath).append(
"/").append(name);
if (!stat(fileName.c_str(), &statbuf))
- resourceManager->addToSearchPath(fileName, false);
+ resourceManager->addToSearchPath(fileName, Append_false);
}
}
}
@@ -769,10 +769,10 @@ void UpdaterWindow::unloadManaPlusUpdates(const std::string &dir)
void UpdaterWindow::addUpdateFile(const std::string &restrict path,
const std::string &restrict fixPath,
const std::string &restrict file,
- const bool append)
+ const Append append)
{
const std::string tmpPath = std::string(path).append("/").append(file);
- if (!append)
+ if (append == Append_false)
resourceManager->addToSearchPath(tmpPath, append);
const std::string fixFile = std::string(fixPath).append("/").append(file);
@@ -780,7 +780,7 @@ void UpdaterWindow::addUpdateFile(const std::string &restrict path,
if (!stat(fixFile.c_str(), &statbuf))
resourceManager->addToSearchPath(fixFile, append);
- if (append)
+ if (append == Append_false)
resourceManager->addToSearchPath(tmpPath, append);
}
@@ -1097,7 +1097,7 @@ void UpdaterWindow::loadMods(const std::string &dir,
UpdaterWindow::addUpdateFile(dir,
fixPath,
file.name,
- false);
+ Append_false);
}
}
@@ -1121,7 +1121,7 @@ void UpdaterWindow::loadMods(const std::string &dir,
std::string fileName = std::string(fixPath).append(
"/").append(name);
if (!stat(fileName.c_str(), &statbuf))
- resourceManager->addToSearchPath(fileName, false);
+ resourceManager->addToSearchPath(fileName, Append_false);
}
}
}
@@ -1148,7 +1148,10 @@ void UpdaterWindow::loadDirMods(const std::string &dir)
{
const std::string &localDir = mod->getLocalDir();
if (!localDir.empty())
- resourceManager->addToSearchPath(dir + "/" + localDir, false);
+ {
+ resourceManager->addToSearchPath(dir + "/" + localDir,
+ Append_false);
+ }
}
}
}
diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h
index 4e6f26136..78da3bad1 100644
--- a/src/gui/windows/updaterwindow.h
+++ b/src/gui/windows/updaterwindow.h
@@ -26,6 +26,8 @@
#include "enums/net/downloadstatus.h"
#include "enums/net/updatetype.h"
+#include "enums/simpletypes/append.h"
+
#include "gui/widgets/linkhandler.h"
#include "gui/widgets/window.h"
@@ -124,7 +126,7 @@ class UpdaterWindow final : public Window,
static void addUpdateFile(const std::string &restrict path,
const std::string &restrict fixPath,
const std::string &restrict file,
- const bool append);
+ const Append append);
static void removeUpdateFile(const std::string &restrict path,
const std::string &restrict fixPath,