Skip to content

Commit

Permalink
Updated for the 4 new Regions
Browse files Browse the repository at this point in the history
  • Loading branch information
nglayton committed Aug 22, 2011
1 parent da38048 commit e98d03f
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 9 deletions.
15 changes: 8 additions & 7 deletions Classes/Country_v1.m
Expand Up @@ -103,17 +103,14 @@ - (ReportRegion) reportRegion
[cntry_code isEqualToString:@"EC"]||
[cntry_code isEqualToString:@"GT"]||
[cntry_code isEqualToString:@"JM"]||
[cntry_code isEqualToString:@"MX"]||
[cntry_code isEqualToString:@"PE"]||
[cntry_code isEqualToString:@"SV"]||
[cntry_code isEqualToString:@"US"]||
[cntry_code isEqualToString:@"UY"]||
[cntry_code isEqualToString:@"VR"] ||
[cntry_code isEqualToString:@"VE"]
) region=ReportRegionUSA;
[cntry_code isEqualToString:@"VE"]) region=ReportRegionUSA;
else if ([cntry_code isEqualToString:@"AT"]||
[cntry_code isEqualToString:@"BE"]||
[cntry_code isEqualToString:@"CH"]||
[cntry_code isEqualToString:@"CZ"]||
[cntry_code isEqualToString:@"DE"]||
[cntry_code isEqualToString:@"DK"]||
Expand All @@ -130,20 +127,24 @@ - (ReportRegion) reportRegion
[cntry_code isEqualToString:@"LV"]||
[cntry_code isEqualToString:@"MT"]||
[cntry_code isEqualToString:@"NL"]||
[cntry_code isEqualToString:@"NO"]||
[cntry_code isEqualToString:@"PL"]||
[cntry_code isEqualToString:@"PT"]||
[cntry_code isEqualToString:@"RO"]||
[cntry_code isEqualToString:@"SE"]||
[cntry_code isEqualToString:@"SI"]||
[cntry_code isEqualToString:@"SK"]) region=ReportRegionEurope;
else if ([cntry_code isEqualToString:@"CA"]) region=ReportRegionCanada;
else if ([cntry_code isEqualToString:@"AU"]||
[cntry_code isEqualToString:@"NZ"]) region=ReportRegionAustralia;
else if ([cntry_code isEqualToString:@"AU"]) region=ReportRegionAustralia;
else if ([cntry_code isEqualToString:@"NZ"]) region=ReportRegionNewZealand;
else if ([cntry_code isEqualToString:@"JP"]) region=ReportRegionJapan;
else if ([cntry_code isEqualToString:@"GB"]) region=ReportRegionUK;
else if ([cntry_code isEqualToString:@"MX"]) region=ReportRegionMexico;
else if ([cntry_code isEqualToString:@"CH"]) region=ReportRegionSwitzerland;
else if ([cntry_code isEqualToString:@"NO"]) region=ReportRegionNorway;

else region=ReportRegionRestOfWorld;


return region;
}

Expand Down
22 changes: 22 additions & 0 deletions Classes/ItunesConnectDownloaderOperation.m
Expand Up @@ -67,6 +67,10 @@ - (ReportRegion)regionFromCode:(NSString *)regionCode
else if ([regionCode isEqualToString:@"CA"]) region = ReportRegionCanada;
else if ([regionCode isEqualToString:@"EU"]) region = ReportRegionEurope;
else if ([regionCode isEqualToString:@"WW"]) region = ReportRegionRestOfWorld;
else if ([regionCode isEqualToString:@"MX"]) region = ReportRegionMexico;
else if ([regionCode isEqualToString:@"CH"]) region = ReportRegionSwitzerland;
else if ([regionCode isEqualToString:@"NO"]) region = ReportRegionNorway;
else if ([regionCode isEqualToString:@"NZ"]) region = ReportRegionNewZealand;
else region = ReportRegionUnknown;

return region;
Expand Down Expand Up @@ -109,6 +113,24 @@ - (ReportRegion)regionFromString:(NSString *)string
return ReportRegionUK;
}

if ([string isEqualToString:@"Mexico"])
{
return ReportRegionMexico;
}
if ([string isEqualToString:@"Norway"])
{
return ReportRegionNorway;
}
if ([string isEqualToString:@"New Zealand"])
{
return ReportRegionNewZealand;
}
if ([string isEqualToString:@"Switzerland"])
{
return ReportRegionSwitzerland;
}


return ReportRegionUnknown;
}

Expand Down
6 changes: 5 additions & 1 deletion Classes/ReportTypes.h
Expand Up @@ -13,4 +13,8 @@ typedef enum {
ReportRegionAustralia = 4,
ReportRegionUK = 5,
ReportRegionJapan = 6,
ReportRegionRestOfWorld = 7} ReportRegion;
ReportRegionRestOfWorld = 7,
ReportRegionMexico = 8,
ReportRegionSwitzerland = 9,
ReportRegionNorway = 10,
ReportRegionNewZealand = 11} ReportRegion;
20 changes: 20 additions & 0 deletions Classes/Report_v1.m
Expand Up @@ -990,6 +990,14 @@ - (NSString *)shortNameForRegion:(ReportRegion)reportRegion
return @"AU";
case ReportRegionRestOfWorld:
return @"WW";
case ReportRegionMexico:
return @"MX";
case ReportRegionNewZealand:
return @"NZ";
case ReportRegionNorway:
return @"NO";
case ReportRegionSwitzerland:
return @"CH";
default:
return @"??";
}
Expand Down Expand Up @@ -1064,6 +1072,18 @@ - (NSString *)listDescriptionShorter:(BOOL)shorter
case ReportRegionRestOfWorld:
region_name = @"Rest";
break;
case ReportRegionMexico:
region_name = @"Mexico";
break;
case ReportRegionNewZealand:
region_name = @"New Zealand";
break;
case ReportRegionNorway:
region_name = @"Norway";
break;
case ReportRegionSwitzerland:
region_name = @"Switzerland";
break;
default:
region_name = @"Invalid Region";
}
Expand Down
2 changes: 1 addition & 1 deletion Info.plist
Expand Up @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.0.19beta</string>
<string>1.0.19b nl</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
Expand Down

0 comments on commit e98d03f

Please sign in to comment.