Skip to content

Commit

Permalink
Added Support for Denmark and Sweden Regions
Browse files Browse the repository at this point in the history
  • Loading branch information
nglayton committed May 5, 2012
1 parent 954f8c4 commit 6aef3d6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Classes/Country_v1.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ - (ReportRegion) reportRegion
[cntry_code isEqualToString:@"BE"]||
[cntry_code isEqualToString:@"CZ"]||
[cntry_code isEqualToString:@"DE"]||
[cntry_code isEqualToString:@"DK"]||
[cntry_code isEqualToString:@"EE"]||
[cntry_code isEqualToString:@"ES"]||
[cntry_code isEqualToString:@"FI"]||
Expand All @@ -130,7 +129,6 @@ - (ReportRegion) reportRegion
[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;
Expand All @@ -142,6 +140,8 @@ - (ReportRegion) reportRegion
else if ([cntry_code isEqualToString:@"CH"]) region=ReportRegionSwitzerland;
else if ([cntry_code isEqualToString:@"NO"]) region=ReportRegionNorway;
else if ([cntry_code isEqualToString:@"CN"]) region=ReportRegionChina;
else if ([cntry_code isEqualToString:@"DK"]) region=ReportRegionDenmark;
else if ([cntry_code isEqualToString:@"SE"]) region=ReportRegionSweden;

else region=ReportRegionRestOfWorld;

Expand Down
14 changes: 12 additions & 2 deletions Classes/ItunesConnectDownloaderOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ - (ReportRegion)regionFromCode:(NSString *)regionCode
else if ([regionCode isEqualToString:@"NO"]) region = ReportRegionNorway;
else if ([regionCode isEqualToString:@"NZ"]) region = ReportRegionNewZealand;
else if ([regionCode isEqualToString:@"CN"]) region = ReportRegionChina;
else if ([regionCode isEqualToString:@"DK"]) region = ReportRegionDenmark;
else if ([regionCode isEqualToString:@"SE"]) region = ReportRegionSweden;
else region = ReportRegionUnknown;

return region;
Expand Down Expand Up @@ -134,8 +136,16 @@ - (ReportRegion)regionFromString:(NSString *)string
{
return ReportRegionChina;
}


if ([string isEqualToString:@"Denmark"])
{
return ReportRegionDenmark;
}
if ([string isEqualToString:@"Sweden"])
{
return ReportRegionSweden;
}


return ReportRegionUnknown;
}

Expand Down
4 changes: 3 additions & 1 deletion Classes/ReportTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ typedef enum {
ReportRegionSwitzerland = 9,
ReportRegionNorway = 10,
ReportRegionNewZealand = 11,
ReportRegionChina = 12} ReportRegion;
ReportRegionChina = 12,
ReportRegionDenmark = 13,
ReportRegionSweden = 14} ReportRegion;
10 changes: 10 additions & 0 deletions Classes/Report_v1.m
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,10 @@ - (NSString *)shortNameForRegion:(ReportRegion)reportRegion
return @"CH";
case ReportRegionChina:
return @"CN";
case ReportRegionDenmark:
return @"DK";
case ReportRegionSweden:
return @"SE";
default:
return @"??";
}
Expand Down Expand Up @@ -1089,6 +1093,12 @@ - (NSString *)listDescriptionShorter:(BOOL)shorter
case ReportRegionChina:
region_name = @"China";
break;
case ReportRegionDenmark:
region_name = @"Denmark";
break;
case ReportRegionSweden:
region_name = @"Sweden";
break;
default:
region_name = @"Invalid Region";
}
Expand Down

0 comments on commit 6aef3d6

Please sign in to comment.