From 1a7cff91e18008084fb72c5348457578cb550bae Mon Sep 17 00:00:00 2001 From: vng Date: Fri, 29 Jun 2012 20:42:47 -0700 Subject: [PATCH] [iPhone] Process new status EOnDiskOutOfDate in downloader. Need better logic. --- iphone/Maps/Settings/CountriesViewController.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/iphone/Maps/Settings/CountriesViewController.mm b/iphone/Maps/Settings/CountriesViewController.mm index 2916631aae..1248512aa6 100644 --- a/iphone/Maps/Settings/CountriesViewController.mm +++ b/iphone/Maps/Settings/CountriesViewController.mm @@ -144,6 +144,7 @@ static bool IsOurIndex(TIndex const & theirs, TIndex const & ours) switch (s.CountryStatus(countryIndex)) { case EOnDisk: + case EOnDiskOutOfDate: { LocalAndRemoteSizeT::first_type size = s.CountrySizeInBytes(countryIndex).first; // convert size to human readable values @@ -268,10 +269,15 @@ UITableViewCell * g_clickedCell = nil; storage::Storage & s = GetFramework().Storage(); switch (s.CountryStatus(g_clickedIndex)) { + case EOnDiskOutOfDate: + s.DeleteCountry(g_clickedIndex); + // no break here! + case ENotDownloaded: case EDownloadFailed: s.DownloadCountry(g_clickedIndex); break; + default: s.DeleteCountry(g_clickedIndex); // remove "zoom to country" icon @@ -356,6 +362,7 @@ UITableViewCell * g_clickedCell = nil; case ENotDownloaded: case EDownloadFailed: + case EOnDiskOutOfDate: { LocalAndRemoteSizeT const sizePair = s.CountrySizeInBytes(index); LocalAndRemoteSizeT::first_type const size = sizePair.second - sizePair.first;