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:
authorArsentiy Milchakov <milcars@mapswithme.com>2017-11-10 18:23:53 +0300
committerVlad Mihaylenko <vxmihaylenko@gmail.com>2017-11-13 10:39:46 +0300
commit74bb9316ef751d3312ee7085b4648356bf6b2fac (patch)
tree716eb05f1e5435a0e8dac489576cb5b7074fb254
parent27802b5395d8bbc1d423569ab763d6cb594b92fb (diff)
[ugc] fix pathsbeta-1108
-rw-r--r--ugc/storage.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/ugc/storage.cpp b/ugc/storage.cpp
index 756678be54..02f35eabd5 100644
--- a/ugc/storage.cpp
+++ b/ugc/storage.cpp
@@ -32,13 +32,23 @@ string const kTmpFileExtension = ".tmp";
using Sink = MemWriter<string>;
-string GetUGCFilePath() { return my::JoinPath(GetPlatform().WritableDir(), kUGCUpdateFileName); }
+string GetUGCFilePath() { return my::JoinPath(GetPlatform().SettingsDir(), kUGCUpdateFileName); }
-string GetIndexFilePath() { return my::JoinPath(GetPlatform().WritableDir(), kIndexFileName); }
+string GetIndexFilePath() { return my::JoinPath(GetPlatform().SettingsDir(), kIndexFileName); }
bool GetUGCFileSize(uint64_t & size)
{
- return GetPlatform().GetFileSizeByName(kUGCUpdateFileName, size);
+ try
+ {
+ FileReader reader(GetUGCFilePath(), true /* with exceptions */);
+ size = reader.Size();
+ }
+ catch (RootException const &)
+ {
+ return false;
+ }
+
+ return true;
}
void DeserializeUGCIndex(string const & jsonData, vector<Storage::UGCIndex> & res)