[ios] Added flags to search results when radar mode is not enabled

This commit is contained in:
Alex Zolotarev 2012-02-08 17:27:26 +03:00 committed by Alex Zolotarev
parent 8cd568ddf6
commit a63b5b9443
2 changed files with 14 additions and 1 deletions

View file

@ -433,6 +433,19 @@ static void OnSearchResultCallback(search::Results const & res, int queryId)
cell.featureCountry.text = [NSString stringWithUTF8String:r.GetRegionString()];
cell.featureType.text = [NSString stringWithUTF8String:r.GetFeatureType()];
cell.featureDistance.text = [SearchVC formatDistance:r.GetDistanceFromCenter()];
if (m_radarButton.isSelected)
cell.accessoryView = nil;
else
{ // Show flags only when radar mode is disabled
char const * flagCode = r.GetRegionFlag();
if (flagCode)
{
UIImage * flagImage = [UIImage imageNamed:[NSString stringWithFormat:@"%s.png", flagCode]];
UIImageView * imgView = [[UIImageView alloc] initWithImage:flagImage];
cell.accessoryView = imgView;
[imgView release];
}
}
return cell;
}
break;

View file

@ -25,7 +25,7 @@ public:
// String that is displayed in the GUI.
char const * GetString() const { return m_str.c_str(); }
char const * GetRegionString() const { return m_region.c_str(); }
char const * GetRegionFlag() const { return m_flag.c_str(); }
char const * GetRegionFlag() const { return m_flag.empty() ? 0 : m_flag.c_str(); }
char const * GetFeatureType() const { return m_type.c_str(); }
// Type of the result.