Read country codes from zone.tab.

This commit is contained in:
Teo Mrnjavac 2016-08-03 18:30:41 +02:00
parent a51061029e
commit 471d94a02e
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
*
* Originally from the Manjaro Installation Framework
* by Roland Singer <roland@manjaro.org>
@ -149,10 +149,15 @@ void LocaleGlobal::initLocations() {
if (timezone.size() < 2)
continue;
QString countryCode = list.at(0).trimmed();
if (countryCode.size() != 2)
continue;
location.region = timezone.takeFirst();
location.zone = timezone.join( '/' );
location.latitude = getRightGeoLocation(list.at(1).mid(0, cooSplitPos));
location.longitude = getRightGeoLocation(list.at(1).mid(cooSplitPos));
location.country = countryCode;
locations[location.region].append(location);
}

View File

@ -1,6 +1,6 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
*
* Originally from the Manjaro Installation Framework
* by Roland Singer <roland@manjaro.org>
@ -43,7 +43,7 @@ public:
};
struct Location {
QString region, zone;
QString region, zone, country;
double latitude, longitude;
static QString pretty( const QString& s );
QString comment() const;