[libcalamares] Store region name in each zone as well

This commit is contained in:
Adriaan de Groot 2019-12-11 01:11:51 +10:00
parent 226530cf6f
commit a39c77dfaf
2 changed files with 5 additions and 3 deletions

View File

@ -196,7 +196,7 @@ TZRegion::fromFile( const char* fileName )
timezoneParts.removeFirst(); timezoneParts.removeFirst();
thisRegion->m_zones.append( thisRegion->m_zones.append(
new TZZone( timezoneParts.join( '/' ).toUtf8().constData(), countryCode, list.at( 1 ) ) ); new TZZone( region, timezoneParts.join( '/' ).toUtf8().constData(), countryCode, list.at( 1 ) ) );
} }
auto sorter = []( const CStringPair* l, const CStringPair* r ) { return *l < *r; }; auto sorter = []( const CStringPair* l, const CStringPair* r ) { return *l < *r; };
@ -213,8 +213,9 @@ TZRegion::fromFile( const char* fileName )
return model; return model;
} }
TZZone::TZZone( const char* zoneName, const QString& country, QString position ) TZZone::TZZone( const QString& region, const char* zoneName, const QString& country, QString position )
: CStringPair( zoneName ) : CStringPair( zoneName )
, m_region( region )
, m_country( country ) , m_country( country )
{ {
int cooSplitPos = position.indexOf( QRegExp( "[-+]" ), 1 ); int cooSplitPos = position.indexOf( QRegExp( "[-+]" ), 1 );

View File

@ -118,11 +118,12 @@ public:
using CStringPair::CStringPair; using CStringPair::CStringPair;
QString tr() const override; QString tr() const override;
TZZone( const char* zoneName, const QString& country, QString position ); TZZone( const QString& region, const char* zoneName, const QString& country, QString position );
void print( QDebug& ) const; void print( QDebug& ) const;
protected: protected:
QString m_region;
QString m_country; QString m_country;
double m_latitude = 0.0, m_longitude = 0.0; double m_latitude = 0.0, m_longitude = 0.0;
}; };