Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <deathbaba@gmail.com>2012-01-06 23:13:29 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:31:23 +0300
commit3932615f2a7e4539b06b8426028067ca92974776 (patch)
tree9da613dd8811122b84b14ba0f7195b30ca558053 /platform/platform_linux.cpp
parent99a00dda73a793ef506fcf16ef80f3dab20282ff (diff)
Added Platform::TmpPathForFile() and Platform::SettingsPathForFile()
Closed #492 - Save viewport on Android when external memory is ejected
Diffstat (limited to 'platform/platform_linux.cpp')
-rw-r--r--platform/platform_linux.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/platform/platform_linux.cpp b/platform/platform_linux.cpp
index 9cfebaa4b5..634caf3f17 100644
--- a/platform/platform_linux.cpp
+++ b/platform/platform_linux.cpp
@@ -41,9 +41,17 @@ Platform::Platform()
// @TODO implement correct resources and writable directories for public releases
m_resourcesDir = path + "../../data/";
m_writableDir = m_resourcesDir;
+ m_settingsDir = m_writableDir;
+ char * tmpDir = ::getenv("TMPDIR");
+ if (tmpDir)
+ m_tmpDir = tmpDir;
+ else
+ m_tmpDir = P_tmpdir;
LOG(LDEBUG, ("Resources directory:", m_resourcesDir));
LOG(LDEBUG, ("Writable directory:", m_writableDir));
+ LOG(LDEBUG, ("Tmp directory:", m_tmpDir));
+ LOG(LDEBUG, ("Settings directory:", m_settingsDir));
}
Platform::~Platform()
@@ -58,7 +66,7 @@ bool Platform::IsFileExistsByFullPath(string const & filePath)
int Platform::CpuCores() const
{
- long numCPU = sysconf(_SC_NPROCESSORS_ONLN);
+ const long numCPU = sysconf(_SC_NPROCESSORS_ONLN);
if (numCPU >= 1)
return static_cast<int>(numCPU);
return 1;