forked from organicmaps/organicmaps
[Old map downloader] Fix bug with fast migrate
This commit is contained in:
parent
12b2911271
commit
fc55aef503
3 changed files with 13 additions and 9 deletions
|
@ -529,8 +529,17 @@ void Framework::RegisterAllMaps()
|
|||
|
||||
m_storage.RegisterAllLocalMaps();
|
||||
|
||||
// Fast migrate if possible.
|
||||
if(platform::migrate::NeedMigrate())
|
||||
m_storage.FastMigrateIfPossible();
|
||||
{
|
||||
bool disableFastMigrate = false;
|
||||
Settings::Get("DisableFastMigrate", disableFastMigrate);
|
||||
if(!disableFastMigrate && m_storage.HaveDownloadedCountries())
|
||||
{
|
||||
Migrate();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int minFormat = numeric_limits<int>::max();
|
||||
|
||||
|
|
|
@ -106,14 +106,9 @@ void Storage::Clear()
|
|||
m_localFilesForFakeCountries.clear();
|
||||
}
|
||||
|
||||
void Storage::FastMigrateIfPossible()
|
||||
bool Storage::HaveDownloadedCountries()
|
||||
{
|
||||
bool disableFastMigrate = false;
|
||||
Settings::Get("DisableFastMigrate", disableFastMigrate);
|
||||
if(!disableFastMigrate && platform::migrate::NeedMigrate() && m_localFiles.empty())
|
||||
{
|
||||
Migrate();
|
||||
}
|
||||
return !m_localFiles.empty();
|
||||
}
|
||||
|
||||
void Storage::Migrate()
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
/// Switch on new storage version, remove old mwm
|
||||
/// and add required mwm's into download queue.
|
||||
void Migrate();
|
||||
void FastMigrateIfPossible();
|
||||
bool HaveDownloadedCountries();
|
||||
void DeleteAllLocalMaps(vector<TIndex> * existedCountries = nullptr);
|
||||
|
||||
// Clears local files registry and downloader's queue.
|
||||
|
|
Loading…
Add table
Reference in a new issue