forked from organicmaps/organicmaps
Fixed canceling of diff download.
This commit is contained in:
parent
3af5ad4c4b
commit
4265c34d5b
5 changed files with 6 additions and 13 deletions
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue