| 1234 | } |
| 1235 | |
| 1236 | void Storage::RegisterLocalFile(platform::LocalCountryFile const & localFile) |
| 1237 | { |
| 1238 | LocalFilePtr ptr; |
| 1239 | |
| 1240 | CountryId const & countryId = FindCountryId(localFile); |
| 1241 | if (IsLeaf(countryId)) |
| 1242 | { |
| 1243 | ptr = GetLocalFile(countryId, localFile.GetVersion()); |
| 1244 | if (!ptr) |
| 1245 | { |
| 1246 | ptr = make_shared<LocalCountryFile>(localFile); |
| 1247 | RegisterCountryFiles(ptr); |
| 1248 | } |
| 1249 | } |
| 1250 | else |
| 1251 | { |
| 1252 | ptr = make_shared<LocalCountryFile>(localFile); |
| 1253 | ptr->SyncWithDisk(); |
| 1254 | m_localFilesForFakeCountries[ptr->GetCountryFile()] = ptr; |
| 1255 | } |
| 1256 | |
| 1257 | uint64_t const size = ptr->GetSize(MapFileType::Map); |
| 1258 | LOG(LINFO, ("Found file:", countryId, "in directory:", ptr->GetDirectory(), "with size:", size)); |
| 1259 | |
| 1260 | /// Funny, but ptr->GetCountryFile() has valid name only. Size and sha1 are not initialized. |
| 1261 | /// @todo Store only name (CountryId) in LocalCountryFile instead of CountryFile? |
| 1262 | if (m_currentVersion == ptr->GetVersion() && size != GetCountryFile(countryId).GetRemoteSize()) |
| 1263 | LOG(LWARNING, ("Inconsistent MWM and version for", *ptr)); |
| 1264 | } |
| 1265 | |
| 1266 | void Storage::DeleteCountryFiles(CountryId const & countryId, MapFileType type, bool deferredDelete) |
| 1267 | { |