From a39c77dfaf0acda6746d3f29ab4a2197d9c5b4d7 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 11 Dec 2019 01:11:51 +1000 Subject: [PATCH] [libcalamares] Store region name in each zone as well --- src/libcalamares/locale/TimeZone.cpp | 5 +++-- src/libcalamares/locale/TimeZone.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libcalamares/locale/TimeZone.cpp b/src/libcalamares/locale/TimeZone.cpp index e2e13c828..ea77fc39e 100644 --- a/src/libcalamares/locale/TimeZone.cpp +++ b/src/libcalamares/locale/TimeZone.cpp @@ -196,7 +196,7 @@ TZRegion::fromFile( const char* fileName ) timezoneParts.removeFirst(); 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; }; @@ -213,8 +213,9 @@ TZRegion::fromFile( const char* fileName ) 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 ) + , m_region( region ) , m_country( country ) { int cooSplitPos = position.indexOf( QRegExp( "[-+]" ), 1 ); diff --git a/src/libcalamares/locale/TimeZone.h b/src/libcalamares/locale/TimeZone.h index 86ddd516e..19d0011b2 100644 --- a/src/libcalamares/locale/TimeZone.h +++ b/src/libcalamares/locale/TimeZone.h @@ -118,11 +118,12 @@ public: using CStringPair::CStringPair; 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; protected: + QString m_region; QString m_country; double m_latitude = 0.0, m_longitude = 0.0; };