summaryrefslogtreecommitdiffstats
path: root/src/Common
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-27 01:55:44 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-27 01:55:44 +0200
commite1d8490f0654a3da0b900407d80d91d8d0da68c8 (patch)
treed65b4bd4a596a98061e094120b6a1aed388d1c89 /src/Common
parentd88c486ae403bee8f4b16e4bdf9daf19f8915eed (diff)
downloadmad-e1d8490f0654a3da0b900407d80d91d8d0da68c8.tar
mad-e1d8490f0654a3da0b900407d80d91d8d0da68c8.zip
Use libicu to support unicode properly; migrated ConfigManager to UnicodeString
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/ModuleManager.cpp6
-rw-r--r--src/Common/UserManager.cpp34
2 files changed, 20 insertions, 20 deletions
diff --git a/src/Common/ModuleManager.cpp b/src/Common/ModuleManager.cpp
index 78a6459..053d395 100644
--- a/src/Common/ModuleManager.cpp
+++ b/src/Common/ModuleManager.cpp
@@ -62,9 +62,9 @@ bool ModuleManager::handleConfigEntry(const Core::ConfigEntry &entry, bool handl
if(handled)
return false;
- if(entry[0].getKey().matches("LoadModule") && entry[1].empty()) {
- if(!loadModule(entry[0][0].c_str()))
- application->logf(Core::Logger::LOG_ERROR, "Can't load module '%s'.", entry[0][0].c_str());
+ if(entry[0].getKey().matches("LoadModule") && entry[1].isEmpty()) {
+ if(!loadModule(entry[0][0].extract()))
+ application->logf(Core::Logger::LOG_ERROR, "Can't load module '%s'.", entry[0][0].extract().c_str());
return true;
}
diff --git a/src/Common/UserManager.cpp b/src/Common/UserManager.cpp
index f112894..f14dbcc 100644
--- a/src/Common/UserManager.cpp
+++ b/src/Common/UserManager.cpp
@@ -39,11 +39,11 @@ UserManager::~UserManager() {
bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handled*/) {
if(entry[0].getKey().matches("UserManager")) {
if(entry[1].getKey().matches("MinUid")) {
- if(entry[2].empty()) {
+ if(entry[2].isEmpty()) {
char *endptr;
- unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10);
- if(entry[1][0].empty() || *endptr) {
- application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinUid '%s'", entry[1][0].c_str());
+ unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10);
+ if(entry[1][0].isEmpty() || *endptr) {
+ application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinUid '%s'", entry[1][0].extract().c_str());
}
else {
minUid = val;
@@ -51,11 +51,11 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl
}
}
else if(entry[1].getKey().matches("MaxUid")) {
- if(entry[2].empty()) {
+ if(entry[2].isEmpty()) {
char *endptr;
- unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10);
- if(entry[1][0].empty() || *endptr) {
- application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxUid '%s'", entry[1][0].c_str());
+ unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10);
+ if(entry[1][0].isEmpty() || *endptr) {
+ application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxUid '%s'", entry[1][0].extract().c_str());
}
else {
maxUid = val;
@@ -63,11 +63,11 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl
}
}
else if(entry[1].getKey().matches("MinGid")) {
- if(entry[2].empty()) {
+ if(entry[2].isEmpty()) {
char *endptr;
- unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10);
- if(entry[1][0].empty() || *endptr) {
- application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinGid '%s'", entry[1][0].c_str());
+ unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10);
+ if(entry[1][0].isEmpty() || *endptr) {
+ application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinGid '%s'", entry[1][0].extract().c_str());
}
else {
minGid = val;
@@ -75,18 +75,18 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl
}
}
else if(entry[1].getKey().matches("MaxGid")) {
- if(entry[2].empty()) {
+ if(entry[2].isEmpty()) {
char *endptr;
- unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10);
- if(entry[1][0].empty() || *endptr) {
- application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxGid '%s'", entry[1][0].c_str());
+ unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10);
+ if(entry[1][0].isEmpty() || *endptr) {
+ application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxGid '%s'", entry[1][0].extract().c_str());
}
else {
maxGid = val;
}
}
}
- else if(!entry[1].empty())
+ else if(!entry[1].isEmpty())
return false;
return true;