summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/files.cpp2
-rw-r--r--src/utils/gettexthelper.cpp24
-rw-r--r--src/utils/gettexthelper.h10
-rw-r--r--src/utils/translation/translationmanager.cpp2
-rw-r--r--src/utils/xml.cpp2
-rw-r--r--src/utils/xmlutils_unittest.cc3
6 files changed, 27 insertions, 16 deletions
diff --git a/src/utils/files.cpp b/src/utils/files.cpp
index 28921a0e5..d3a04d69f 100644
--- a/src/utils/files.cpp
+++ b/src/utils/files.cpp
@@ -88,7 +88,7 @@ void Files::copyPhysFsFile(const std::string &restrict inFile,
const std::string &restrict outFile)
{
int size = 0;
- void *const buf = ResourceManager::loadFile(inFile, size);
+ void *const buf = PhysFs::loadFile(inFile, size);
FILE *const file = fopen(outFile.c_str(), "w");
fwrite(buf, 1, size, file);
fclose(file);
diff --git a/src/utils/gettexthelper.cpp b/src/utils/gettexthelper.cpp
index 59f4933ad..3d10c6848 100644
--- a/src/utils/gettexthelper.cpp
+++ b/src/utils/gettexthelper.cpp
@@ -20,13 +20,22 @@
#include "utils/gettexthelper.h"
+#include "client.h"
+#include "configuration.h"
+
#include "debug.h"
+#ifdef ENABLE_NLS
+#include "logger.h"
+
+#include <libintl.h>
+#endif
+
#ifdef WIN32
+#include <string>
extern "C" char const *_nl_locale_name_default(void);
#endif
-
void GettextHelper::initLang()
{
#ifdef ENABLE_NLS
@@ -44,8 +53,8 @@ void GettextHelper::initLang()
if (!lang.empty())
{
- setEnv("LANG", lang.c_str());
- setEnv("LANGUAGE", lang.c_str());
+ Client::setEnv("LANG", lang.c_str());
+ Client::setEnv("LANGUAGE", lang.c_str());
}
#ifdef ANDROID
#ifdef USE_SDL2
@@ -87,16 +96,19 @@ void GettextHelper::initLang()
bind_textdomain_codeset("manaplus", "UTF-8");
textdomain("manaplus");
#endif // ENABLE_NLS
-
}
+#ifdef ENABLE_NLS
void GettextHelper::bindTextDomain(const char *const path)
{
-#ifdef ENABLE_NLS
const char *const dir = bindtextdomain("manaplus", path);
if (dir)
logger->log("bindtextdomain: %s", dir);
else
logger->log("bindtextdomain failed");
-#endif
}
+#else
+void GettextHelper::bindTextDomain(const char *const path A_UNUSED)
+{
+}
+#endif
diff --git a/src/utils/gettexthelper.h b/src/utils/gettexthelper.h
index 534086820..3916edc03 100644
--- a/src/utils/gettexthelper.h
+++ b/src/utils/gettexthelper.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef GETTEXTHELPER_H
-#define GETTEXTHELPER_H
+#ifndef UTILS_GETTEXTHELPER_H
+#define UTILS_GETTEXTHELPER_H
#include "localconsts.h"
@@ -29,7 +29,11 @@ class GettextHelper final
static void initLang();
private:
+#ifdef ENABLE_NLS
static void bindTextDomain(const char *const path);
+#else
+ static void bindTextDomain(const char *const path A_UNUSED);
+#endif
};
-#endif // GETTEXTHELPER_H
+#endif // UTILS_GETTEXTHELPER_H
diff --git a/src/utils/translation/translationmanager.cpp b/src/utils/translation/translationmanager.cpp
index 5fddee639..70b84c5ad 100644
--- a/src/utils/translation/translationmanager.cpp
+++ b/src/utils/translation/translationmanager.cpp
@@ -27,8 +27,6 @@
#include "utils/translation/podict.h"
#include "utils/translation/poparser.h"
-#include "resources/resourcemanager.h"
-
#include "logger.h"
#include "debug.h"
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index 3144a03b6..3ef99758e 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -24,8 +24,6 @@
#include "logger.h"
-#include "resources/resourcemanager.h"
-
#include "utils/fuzzer.h"
#include "utils/physfstools.h"
#include "utils/stringutils.h"
diff --git a/src/utils/xmlutils_unittest.cc b/src/utils/xmlutils_unittest.cc
index 5b3469805..22d1b8ebc 100644
--- a/src/utils/xmlutils_unittest.cc
+++ b/src/utils/xmlutils_unittest.cc
@@ -48,8 +48,7 @@ static void init()
TEST(xmlutils, readXmlIntVector1)
{
- Client::Options options;
- client = new Client(options);
+ client = new Client;
init();
std::vector<int> arr;