From 589168685eb3a4fbdecd9ccd1a598e83ed81858e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 18 Apr 2019 23:16:02 +0200 Subject: [PATCH] [welcome] Complete LocaleModel implementation - It's a table with two columns (localized name and english name) --- src/modules/welcome/LocaleModel.cpp | 13 +++++++++++++ src/modules/welcome/LocaleModel.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/modules/welcome/LocaleModel.cpp b/src/modules/welcome/LocaleModel.cpp index 5fd032a52..67e306a3a 100644 --- a/src/modules/welcome/LocaleModel.cpp +++ b/src/modules/welcome/LocaleModel.cpp @@ -18,6 +18,19 @@ #include "LocaleModel.h" +LocaleModel::LocaleModel(const QStringList& locales, QObject* parent) + : QAbstractTableModel( parent ) +{ + m_locales.reserve( locales.count() ); + + for ( const auto& l : locales ) + m_locales.emplace_back( l ); +} + +LocaleModel::~LocaleModel() +{ +} + int LocaleModel::columnCount( const QModelIndex& ) const { diff --git a/src/modules/welcome/LocaleModel.h b/src/modules/welcome/LocaleModel.h index 06a6a74c2..9e622a43f 100644 --- a/src/modules/welcome/LocaleModel.h +++ b/src/modules/welcome/LocaleModel.h @@ -25,7 +25,7 @@ #include "utils/CalamaresUtilsGui.h" -class LocaleModel : public QAbstractItemModel +class LocaleModel : public QAbstractTableModel { public: LocaleModel( const QStringList& locales, QObject* parent = nullptr );