diff --git a/iphone/Maps/Core/Storage/MWMStorage.mm b/iphone/Maps/Core/Storage/MWMStorage.mm index fb3d2374dc..5d7a4da171 100644 --- a/iphone/Maps/Core/Storage/MWMStorage.mm +++ b/iphone/Maps/Core/Storage/MWMStorage.mm @@ -86,9 +86,9 @@ using namespace storage; { NodeAttrs nodeAttrs; GetFramework().GetStorage().GetNodeAttrs(countryId, nodeAttrs); - return size + nodeAttrs.m_mwmSize - nodeAttrs.m_localMwmSize; + return size + nodeAttrs.m_mwmSize; }); - if (GetPlatform().GetWritableStorageStatus(requiredSize) == Platform::TStorageStatus::STORAGE_OK) + if (storage::IsEnoughSpaceForDownload(requiredSize)) { [self checkConnectionAndPerformAction:[countryIds, onSuccess] { auto & s = GetFramework().GetStorage(); diff --git a/iphone/Maps/UI/Downloader/Cells/MWMMapDownloaderTableViewCell.mm b/iphone/Maps/UI/Downloader/Cells/MWMMapDownloaderTableViewCell.mm index 4178aab7d3..9987513b36 100644 --- a/iphone/Maps/UI/Downloader/Cells/MWMMapDownloaderTableViewCell.mm +++ b/iphone/Maps/UI/Downloader/Cells/MWMMapDownloaderTableViewCell.mm @@ -80,7 +80,7 @@ case storage::NodeStatus::InQueue: case storage::NodeStatus::Partly: size = isModeDownloaded ? nodeAttrs.m_localMwmSize - : nodeAttrs.m_mwmSize - nodeAttrs.m_localMwmSize; + : nodeAttrs.m_mwmSize; break; case storage::NodeStatus::OnDisk: size = isModeDownloaded ? nodeAttrs.m_mwmSize : 0; break; } diff --git a/iphone/Maps/UI/Downloader/MWMBaseMapDownloaderViewController.mm b/iphone/Maps/UI/Downloader/MWMBaseMapDownloaderViewController.mm index a1a3ccb5c9..0033a6859c 100644 --- a/iphone/Maps/UI/Downloader/MWMBaseMapDownloaderViewController.mm +++ b/iphone/Maps/UI/Downloader/MWMBaseMapDownloaderViewController.mm @@ -292,8 +292,7 @@ using namespace mwm; self.allMapsButton.hidden = NO; [self.allMapsButton setTitle:[NSString stringWithFormat:kAllMapsLabelFormat, kDownloadAllActionTitle, - formattedSize(nodeAttrs.m_mwmSize - - nodeAttrs.m_localMwmSize)] + formattedSize(nodeAttrs.m_mwmSize)] forState:UIControlStateNormal]; self.allMapsCancelButton.hidden = YES; } @@ -570,7 +569,7 @@ using namespace mwm; s.GetNodeAttrs(m_actionSheetId, nodeAttrs); NSString * prefix = nodeAttrs.m_mwmCounter == 1 ? kDownloadActionTitle : kDownloadAllActionTitle; NSString * title = [NSString stringWithFormat:kAllMapsLabelFormat, prefix, - formattedSize(nodeAttrs.m_mwmSize - nodeAttrs.m_localMwmSize)]; + formattedSize(nodeAttrs.m_mwmSize)]; UIAlertAction * action = [UIAlertAction actionWithTitle:title style:UIAlertActionStyleDefault handler:^(UIAlertAction * action)