diff --git a/src/libcalamares/locale/LabelModel.cpp b/src/libcalamares/locale/LabelModel.cpp index 87fca9d85..bcb8af057 100644 --- a/src/libcalamares/locale/LabelModel.cpp +++ b/src/libcalamares/locale/LabelModel.cpp @@ -29,6 +29,7 @@ namespace Locale LabelModel::LabelModel( const QStringList& locales, QObject* parent ) : QAbstractListModel( parent ) + , m_localeIds( locales ) { Q_ASSERT( locales.count() > 0 ); m_locales.reserve( locales.count() ); @@ -132,7 +133,7 @@ LabelModel::find( const QString& countryCode ) const LabelModel* availableTranslations() { - static LabelModel* model = new LabelModel( QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' ) ); + static LabelModel* model = new LabelModel( QStringLiteral( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' ) ); return model; } diff --git a/src/libcalamares/locale/LabelModel.h b/src/libcalamares/locale/LabelModel.h index 5082440d3..03daddbf3 100644 --- a/src/libcalamares/locale/LabelModel.h +++ b/src/libcalamares/locale/LabelModel.h @@ -54,6 +54,9 @@ public: */ const Label& locale( int row ) const; + /// @brief Returns all of the locale Ids (e.g. en_US) put into this model. + const QStringList& localeIds() const { return m_localeIds; } + /** @brief Searches for an item that matches @p predicate * * Returns the row number of the first match, or -1 if there isn't one. @@ -67,6 +70,7 @@ public: private: QVector< Label > m_locales; + QStringList m_localeIds; }; /** @brief Returns a model with all available translations.