forked from organicmaps/organicmaps
Fixed handling of mwm deleting.
This commit is contained in:
parent
3586f9bc86
commit
330391094c
4 changed files with 6 additions and 9 deletions
|
@ -605,10 +605,13 @@ bool Framework::OnCountryFileDelete(storage::TCountryId const & countryId, stora
|
|||
bool deferredDelete = false;
|
||||
if (localFile)
|
||||
{
|
||||
m_localAdsManager.OnDeleteCountry(countryId);
|
||||
rect = m_infoGetter->GetLimitRectForLeaf(countryId);
|
||||
auto const mwmId = m_model.GetDataSource().GetMwmIdByCountryFile(localFile->GetCountryFile());
|
||||
m_model.DeregisterMap(platform::CountryFile(countryId));
|
||||
deferredDelete = true;
|
||||
m_localAdsManager.OnMwmDeregistered(mwmId);
|
||||
m_transitManager.OnMwmDeregistered(mwmId);
|
||||
m_trafficManager.OnMwmDeregistered(mwmId);
|
||||
}
|
||||
InvalidateRect(rect);
|
||||
|
||||
|
@ -629,10 +632,6 @@ void Framework::OnMapDeregistered(platform::LocalCountryFile const & localFile)
|
|||
action();
|
||||
else
|
||||
GetPlatform().RunTask(Platform::Thread::Gui, action);
|
||||
|
||||
auto const mwmId = m_model.GetDataSource().GetMwmIdByCountryFile(localFile.GetCountryFile());
|
||||
m_trafficManager.OnMwmDeregistered(mwmId);
|
||||
m_transitManager.OnMwmDeregistered(mwmId);
|
||||
}
|
||||
|
||||
bool Framework::HasUnsavedEdits(storage::TCountryId const & countryId)
|
||||
|
|
|
@ -505,9 +505,8 @@ void LocalAdsManager::OnDownloadCountry(std::string const & countryName)
|
|||
});
|
||||
}
|
||||
|
||||
void LocalAdsManager::OnDeleteCountry(std::string const & countryName)
|
||||
void LocalAdsManager::OnMwmDeregistered(MwmSet::MwmId const & mwmId)
|
||||
{
|
||||
auto const mwmId = m_getMwmIdByNameFn(countryName);
|
||||
GetPlatform().RunTask(Platform::Thread::File, [this, mwmId]
|
||||
{
|
||||
ProcessRequests({std::make_pair(mwmId, RequestType::Delete)});
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
void UpdateViewport(ScreenBase const & screen);
|
||||
|
||||
void OnDownloadCountry(std::string const & countryName);
|
||||
void OnDeleteCountry(std::string const & countryName);
|
||||
void OnMwmDeregistered(MwmSet::MwmId const & mwmId);
|
||||
|
||||
void Invalidate();
|
||||
|
||||
|
|
|
@ -311,7 +311,6 @@ void TransitReadManager::ClearCache(MwmSet::MwmId const & mwmId)
|
|||
void TransitReadManager::OnMwmDeregistered(MwmSet::MwmId const & mwmId)
|
||||
{
|
||||
ClearCache(mwmId);
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
void TransitReadManager::Invalidate()
|
||||
|
|
Loading…
Add table
Reference in a new issue