diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2017-08-18 18:39:53 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2017-09-13 16:25:26 +0300 |
commit | e8205c0a8280476788af6d0bd15aeaf4a3316685 (patch) | |
tree | 55c0fdf396463c85fabb8e9bd3f36a13944c8b4a /storage | |
parent | 9afae62a6f0835eef469bff862098a6aa02e2edb (diff) |
Fixed Android build
Diffstat (limited to 'storage')
-rw-r--r-- | storage/storage.cpp | 13 | ||||
-rw-r--r-- | storage/storage.hpp | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/storage/storage.cpp b/storage/storage.cpp index 7badee1d5f..b49c606a72 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -938,17 +938,22 @@ void Storage::OnMapDownloadFinished(TCountryId const & countryId, bool success, string Storage::GetFileDownloadUrl(string const & baseUrl, QueuedCountry const & queuedCountry) const { - auto const & countryId = queuedCountry.GetCountryId(); + return GetFileDownloadUrl(baseUrl, queuedCountry.GetCountryId(), + queuedCountry.GetCurrentFileOptions()); +} + +string Storage::GetFileDownloadUrl(string const & baseUrl, TCountryId const & countryId, + MapOptions options) const +{ CountryFile const & countryFile = GetCountryFile(countryId); - auto const currentFileOpt = queuedCountry.GetCurrentFileOptions(); string const fileName = - GetFileName(countryFile.GetName(), currentFileOpt, GetCurrentDataVersion()); + GetFileName(countryFile.GetName(), options, GetCurrentDataVersion()); ostringstream url; url << baseUrl; string const currentVersion = strings::to_string(GetCurrentDataVersion()); - if (currentFileOpt == MapOptions::Diff) + if (options == MapOptions::Diff) url << "diffs/" << currentVersion << "/" << strings::to_string(m_diffManager.InfoFor(countryId).m_version); else url << OMIM_OS_NAME "/" << currentVersion; diff --git a/storage/storage.hpp b/storage/storage.hpp index 54d5539e7e..e16b0e8571 100644 --- a/storage/storage.hpp +++ b/storage/storage.hpp @@ -536,6 +536,8 @@ public: void EnableKeepDownloadingQueue(bool enable) {m_keepDownloadingQueue = enable;} /// get download url by base url & queued country string GetFileDownloadUrl(string const & baseUrl, QueuedCountry const & queuedCountry) const; + string GetFileDownloadUrl(string const & baseUrl, TCountryId const & countryId, + MapOptions options) const; /// @param[out] res Populated with oudated countries. void GetOutdatedCountries(vector<Country const *> & countries) const; |