diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2017-08-30 18:00:57 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2017-09-13 16:25:48 +0300 |
commit | 4265c34d5bc24ff5879d7770a0390681efe84e1b (patch) | |
tree | c6224c0f335f4c7a28bd64f3aad02eff7d472ab1 | |
parent | 3af5ad4c4bc06711c395dd8233257de77c6b74f4 (diff) |
Fixed canceling of diff download.
-rw-r--r-- | platform/country_defines.cpp | 5 | ||||
-rw-r--r-- | platform/country_defines.hpp | 2 | ||||
-rw-r--r-- | storage/queued_country.cpp | 2 | ||||
-rw-r--r-- | storage/storage.cpp | 8 | ||||
-rw-r--r-- | storage/storage.hpp | 2 |
5 files changed, 6 insertions, 13 deletions
diff --git a/platform/country_defines.cpp b/platform/country_defines.cpp index 4f1072a466..d6ab946822 100644 --- a/platform/country_defines.cpp +++ b/platform/country_defines.cpp @@ -8,11 +8,6 @@ bool HasOptions(MapOptions mask, MapOptions options) static_cast<uint8_t>(options); } -MapOptions IntersectOptions(MapOptions lhs, MapOptions rhs) -{ - return static_cast<MapOptions>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs)); -} - MapOptions SetOptions(MapOptions mask, MapOptions options) { return static_cast<MapOptions>(static_cast<uint8_t>(mask) | static_cast<uint8_t>(options)); diff --git a/platform/country_defines.hpp b/platform/country_defines.hpp index e9a123bc8a..e5b9a08804 100644 --- a/platform/country_defines.hpp +++ b/platform/country_defines.hpp @@ -18,8 +18,6 @@ using TLocalAndRemoteSize = pair<TMwmSize, TMwmSize>; bool HasOptions(MapOptions mask, MapOptions options); -MapOptions IntersectOptions(MapOptions lhs, MapOptions rhs); - MapOptions SetOptions(MapOptions mask, MapOptions options); MapOptions UnsetOptions(MapOptions mask, MapOptions options); diff --git a/storage/queued_country.cpp b/storage/queued_country.cpp index 22a3aa0fb3..eeae6ea0cd 100644 --- a/storage/queued_country.cpp +++ b/storage/queued_country.cpp @@ -27,7 +27,7 @@ void QueuedCountry::AddOptions(MapOptions opt) void QueuedCountry::RemoveOptions(MapOptions opt) { - for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting}) + for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting, MapOptions::Diff}) { if (HasOptions(opt, file) && HasOptions(m_init, file)) { diff --git a/storage/storage.cpp b/storage/storage.cpp index 7263d30dc0..ea2f8ab55b 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -511,7 +511,7 @@ void Storage::DeleteCountry(TCountryId const & countryId, MapOptions opt) opt = NormalizeDeleteFileSet(opt); bool const deferredDelete = m_willDelete(countryId, localFile); DeleteCountryFiles(countryId, opt, deferredDelete); - DeleteCountryFilesFromDownloader(countryId, opt); + DeleteCountryFilesFromDownloader(countryId); NotifyStatusChangedForHierarchy(countryId); } @@ -632,7 +632,7 @@ void Storage::DeleteFromDownloader(TCountryId const & countryId) { ASSERT_THREAD_CHECKER(m_threadChecker, ()); - DeleteCountryFilesFromDownloader(countryId, MapOptions::MapWithCarRouting); + DeleteCountryFilesFromDownloader(countryId); NotifyStatusChangedForHierarchy(countryId); } @@ -1134,7 +1134,7 @@ void Storage::DeleteCountryFiles(TCountryId const & countryId, MapOptions opt, b m_localFiles.erase(countryId); } -bool Storage::DeleteCountryFilesFromDownloader(TCountryId const & countryId, MapOptions opt) +bool Storage::DeleteCountryFilesFromDownloader(TCountryId const & countryId) { ASSERT_THREAD_CHECKER(m_threadChecker, ()); @@ -1142,7 +1142,7 @@ bool Storage::DeleteCountryFilesFromDownloader(TCountryId const & countryId, Map if (!queuedCountry) return false; - opt = IntersectOptions(opt, queuedCountry->GetInitOptions()); + MapOptions const opt = queuedCountry->GetInitOptions(); if (IsCountryFirstInQueue(countryId)) { diff --git a/storage/storage.hpp b/storage/storage.hpp index 3e95c538ba..c1beaa2eee 100644 --- a/storage/storage.hpp +++ b/storage/storage.hpp @@ -606,7 +606,7 @@ private: void DeleteCountryFiles(TCountryId const & countryId, MapOptions opt, bool deferredDelete); // Removes country files from downloader. - bool DeleteCountryFilesFromDownloader(TCountryId const & countryId, MapOptions opt); + bool DeleteCountryFilesFromDownloader(TCountryId const & countryId); // Returns download size of the currently downloading file for the // queued country. |