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:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2018-04-09 20:21:41 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2018-04-09 23:16:10 +0300
commit1d1094a26812b753380577ec965a59bf9b737c2a (patch)
tree6ed019bfe4dd273cca013ff1a0775ae7fb0d54b1 /map/bookmark_manager.cpp
parent82051a7928c076057be6f16d6fdb36b21bdd4331 (diff)
Find a kml file in the kmz archive after downloading.
Diffstat (limited to 'map/bookmark_manager.cpp')
-rw-r--r--map/bookmark_manager.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp
index 0503433c17..1dc6f94358 100644
--- a/map/bookmark_manager.cpp
+++ b/map/bookmark_manager.cpp
@@ -122,8 +122,7 @@ BookmarkManager::SharingResult GetFileForSharing(kml::MarkGroupId categoryId, st
"Bookmarks file does not exist.");
}
- auto ext = my::GetFileExtension(filePath);
- strings::AsciiToLower(ext);
+ auto const ext = GetFileExt(filePath);
std::string fileName = my::GetNameFromFullPathWithoutExt(filePath);
auto const tmpFilePath = my::JoinPath(GetPlatform().TmpDir(), fileName + kKmzExtension);
if (ext == kKmzExtension)
@@ -167,9 +166,18 @@ bool ConvertAfterDownloading(std::string const & filePath, std::string const & c
if (files.empty())
return false;
+ auto fileName = files.front().first;
+ for (auto const & file : files)
+ {
+ if (GetFileExt(file.first) == kKmlExtension)
+ {
+ fileName = file.first;
+ break;
+ }
+ }
std::string const unarchievedPath = filePath + ".raw";
MY_SCOPE_GUARD(fileGuard, bind(&FileWriter::DeleteFileX, unarchievedPath));
- ZipFileReader::UnzipFile(filePath, files.front().first, unarchievedPath);
+ ZipFileReader::UnzipFile(filePath, fileName, unarchievedPath);
if (!GetPlatform().IsFileExistsByFullPath(unarchievedPath))
return false;