[omim] Refactored PreMigrate interface.

This commit is contained in:
Ilya Grechuhin 2016-03-01 14:17:31 +03:00 committed by Sergey Yershov
parent 1131905e4d
commit 0c58707083
2 changed files with 7 additions and 7 deletions

View file

@ -240,24 +240,24 @@ bool Framework::IsEnoughSpaceForMigrate() const
return GetPlatform().GetWritableStorageStatus(kSpaceSize) == Platform::TStorageStatus::STORAGE_OK;
}
bool Framework::PreMigrate(ms::LatLon const & position,
storage::Storage::TChangeCountryFunction const & change,
storage::Storage::TProgressFunction const & progress)
TCountryId Framework::PreMigrate(ms::LatLon const & position,
Storage::TChangeCountryFunction const & change,
Storage::TProgressFunction const & progress)
{
Storage().PrefetchMigrateData();
auto const infoGetter =
storage::CountryInfoReader::CreateCountryInfoReaderOneComponentMwms(GetPlatform());
CountryInfoReader::CreateCountryInfoReaderOneComponentMwms(GetPlatform());
TCountryId currentCountryId =
infoGetter->GetRegionCountryId(MercatorBounds::FromLatLon(position));
if (currentCountryId == kInvalidCountryId)
return false;
return kInvalidCountryId;
Storage().GetPrefetchStorage()->Subscribe(change, progress);
Storage().GetPrefetchStorage()->DownloadNode(currentCountryId);
return true;
return currentCountryId;
}
void Framework::Migrate(bool keepDownloaded)

View file

@ -144,7 +144,7 @@ public:
/// Migrate to new version of very different data.
bool IsEnoughSpaceForMigrate() const;
bool PreMigrate(ms::LatLon const & position, storage::Storage::TChangeCountryFunction const & change,
storage::TCountryId PreMigrate(ms::LatLon const & position, storage::Storage::TChangeCountryFunction const & change,
storage::Storage::TProgressFunction const & progress);
void Migrate(bool keepDownloaded = true);