summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-15 01:16:34 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-15 01:16:34 +0300
commitc3b87f283a5a99ed8bac513c516bc5a184406391 (patch)
tree78cce6c60cb82b8e191e633ec2c4fce1e1672708 /src/client.cpp
parent1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33 (diff)
downloadmanaplus-c3b87f283a5a99ed8bac513c516bc5a184406391.tar.gz
manaplus-c3b87f283a5a99ed8bac513c516bc5a184406391.tar.bz2
manaplus-c3b87f283a5a99ed8bac513c516bc5a184406391.tar.xz
manaplus-c3b87f283a5a99ed8bac513c516bc5a184406391.zip
add option for edit screenshot dir.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/client.cpp b/src/client.cpp
index daa2d83a2..133be841f 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -107,6 +107,7 @@
#include "resources/db/palettedb.h"
#include "resources/db/petdb.h"
+#include "utils/base64.h"
#include "utils/cpu.h"
#include "utils/files.h"
#include "utils/fuzzer.h"
@@ -2299,40 +2300,39 @@ void Client::initScreenshotDir()
}
else if (mScreenshotDir.empty())
{
+ mScreenshotDir = decodeBase64String(
+ config.getStringValue("screenshotDirectory2"));
+ if (mScreenshotDir.empty())
+ {
#ifdef __ANDROID__
- mScreenshotDir = getSdStoragePath() + std::string("/images");
+ mScreenshotDir = getSdStoragePath() + std::string("/images");
- if (mkdir_r(mScreenshotDir.c_str()))
- {
- // TRANSLATORS: directory creation error
- logger->log(strprintf(
- _("Error: %s doesn't exist and can't be created! "
- "Exiting."), mScreenshotDir.c_str()));
- }
+ if (mkdir_r(mScreenshotDir.c_str()))
+ {
+ // TRANSLATORS: directory creation error
+ logger->log(strprintf(
+ _("Error: %s doesn't exist and can't be created! "
+ "Exiting."), mScreenshotDir.c_str()));
+ }
#else
- const std::string configScreenshotDir =
- config.getStringValue("screenshotDirectory");
- if (!configScreenshotDir.empty())
- mScreenshotDir = configScreenshotDir;
- else
mScreenshotDir = getPicturesDir();
#endif
-
-// config.setValue("screenshotDirectory", mScreenshotDir);
- logger->log("screenshotDirectory: " + mScreenshotDir);
-
- if (config.getBoolValue("useScreenshotDirectorySuffix"))
- {
- const std::string configScreenshotSuffix =
- branding.getValue("screenshots", "ManaPlus");
-
- if (!configScreenshotSuffix.empty())
+ if (config.getBoolValue("useScreenshotDirectorySuffix"))
{
- mScreenshotDir.append(dirSeparator).append(
- configScreenshotSuffix);
+ const std::string configScreenshotSuffix =
+ branding.getValue("screenshots", "ManaPlus");
+
+ if (!configScreenshotSuffix.empty())
+ {
+ mScreenshotDir.append(dirSeparator).append(
+ configScreenshotSuffix);
+ }
}
+ config.setValue("screenshotDirectory2",
+ encodeBase64String(mScreenshotDir));
}
}
+ logger->log("screenshotDirectory: " + mScreenshotDir);
}
void Client::accountLogin(LoginData *const data) const