From 0b833b1e756398b0a9a65ef81123768a5aea80d8 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Apr 2019 11:38:43 +0200 Subject: [PATCH] [welcome] Switch model to a list model - There doesn't seem to be a real benefit to providing the name and label as separate columns. --- src/modules/welcome/LocaleModel.cpp | 8 +------- src/modules/welcome/LocaleModel.h | 5 ++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/modules/welcome/LocaleModel.cpp b/src/modules/welcome/LocaleModel.cpp index 43d13ea6c..b735983c1 100644 --- a/src/modules/welcome/LocaleModel.cpp +++ b/src/modules/welcome/LocaleModel.cpp @@ -19,7 +19,7 @@ #include "LocaleModel.h" LocaleModel::LocaleModel( const QStringList& locales, QObject* parent ) - : QAbstractTableModel( parent ) + : QAbstractListModel( parent ) { Q_ASSERT( locales.count() > 0 ); m_locales.reserve( locales.count() ); @@ -32,12 +32,6 @@ LocaleModel::~LocaleModel() { } -int -LocaleModel::columnCount( const QModelIndex& ) const -{ - return 2; -} - int LocaleModel::rowCount( const QModelIndex& ) const { diff --git a/src/modules/welcome/LocaleModel.h b/src/modules/welcome/LocaleModel.h index 805a1df65..c8125c0d8 100644 --- a/src/modules/welcome/LocaleModel.h +++ b/src/modules/welcome/LocaleModel.h @@ -19,13 +19,13 @@ #ifndef WELCOME_LOCALEMODEL_H #define WELCOME_LOCALEMODEL_H -#include +#include #include #include "utils/LocaleLabel.h" -class LocaleModel : public QAbstractTableModel +class LocaleModel : public QAbstractListModel { public: using LocaleLabel = CalamaresUtils::LocaleLabel; @@ -34,7 +34,6 @@ public: virtual ~LocaleModel() override; int rowCount( const QModelIndex& parent ) const override; - int columnCount( const QModelIndex& parent ) const override; QVariant data( const QModelIndex& index, int role ) const override;