diff --git a/src/modules/plasmalnf/CMakeLists.txt b/src/modules/plasmalnf/CMakeLists.txt index 9e89ec555..3a85d9598 100644 --- a/src/modules/plasmalnf/CMakeLists.txt +++ b/src/modules/plasmalnf/CMakeLists.txt @@ -27,13 +27,7 @@ set_package_properties( PURPOSE "For Plasma Look-and-Feel selection" ) -find_package( KF5ItemModels ${lnf_ver} ) -set_package_properties( - KF5ItemModels PROPERTIES - PURPOSE "For Plasma Look-and-Feel display" -) - -if ( KF5Plasma_FOUND AND KF5Package_FOUND AND KF5ItemModels_FOUND ) +if ( KF5Plasma_FOUND AND KF5Package_FOUND ) calamares_add_plugin( plasmalnf TYPE viewmodule EXPORT_MACRO PLUGINDLLEXPORT_PRO @@ -51,7 +45,6 @@ if ( KF5Plasma_FOUND AND KF5Package_FOUND AND KF5ItemModels_FOUND ) page_plasmalnf.ui LINK_PRIVATE_LIBRARIES calamaresui - KF5::ItemModels KF5::Package KF5::Plasma SHARED_LIB diff --git a/src/modules/plasmalnf/PlasmaLnfPage.cpp b/src/modules/plasmalnf/PlasmaLnfPage.cpp index c4ecf94b7..ac73ee42a 100644 --- a/src/modules/plasmalnf/PlasmaLnfPage.cpp +++ b/src/modules/plasmalnf/PlasmaLnfPage.cpp @@ -17,46 +17,10 @@ #include "utils/Logger.h" #include "utils/Retranslator.h" -#include - #include #include #include -class ThemeColumns : public KExtraColumnsProxyModel -{ -public: - ThemeColumns( QObject* parent ); - - QVariant extraColumnData( const QModelIndex& parent, int row, int extraColumn, int role ) const override; -}; - -ThemeColumns::ThemeColumns( QObject* parent ) - : KExtraColumnsProxyModel( parent ) -{ - appendColumn(); - appendColumn(); -} - -QVariant -ThemeColumns::extraColumnData( const QModelIndex&, int row, int extraColumn, int role ) const -{ - if ( role != Qt::DisplayRole ) - { - return QVariant(); - } - switch ( extraColumn ) - { - case 0: - return sourceModel()->data( sourceModel()->index( row, 0 ), ThemesModel::DescriptionRole ); - case 1: - return sourceModel()->data( sourceModel()->index( row, 0 ), ThemesModel::ImageRole ); - default: - return QVariant(); - } - __builtin_unreachable(); -} - PlasmaLnfPage::PlasmaLnfPage( Config* config, QWidget* parent ) : QWidget( parent ) @@ -77,12 +41,9 @@ PlasmaLnfPage::PlasmaLnfPage( Config* config, QWidget* parent ) "once the system is installed. Clicking on a look-and-feel " "selection will give you a live preview of that look-and-feel." ) ); } ) - connect( this, &PlasmaLnfPage::plasmaThemeSelected, config, &Config::setTheme ); QTableView* view = new QTableView( this ); - ThemeColumns* columnsModel = new ThemeColumns( this ); - columnsModel->setSourceModel( m_config->themeModel() ); - view->setModel( columnsModel ); + view->setModel( m_config->themeModel() ); view->verticalHeader()->hide(); view->horizontalHeader()->hide(); ui->verticalLayout->addWidget( view ); @@ -98,7 +59,7 @@ PlasmaLnfPage::PlasmaLnfPage( Config* config, QWidget* parent ) auto id = model->data( model->index( row, 0 ), ThemesModel::KeyRole ).toString(); if ( !id.isEmpty() ) { - emit plasmaThemeSelected( id ); + m_config->setTheme( id ); } } } ); diff --git a/src/modules/plasmalnf/PlasmaLnfPage.h b/src/modules/plasmalnf/PlasmaLnfPage.h index 9afda305c..f04ecde06 100644 --- a/src/modules/plasmalnf/PlasmaLnfPage.h +++ b/src/modules/plasmalnf/PlasmaLnfPage.h @@ -38,9 +38,6 @@ class PlasmaLnfPage : public QWidget public: explicit PlasmaLnfPage( Config* config, QWidget* parent = nullptr ); -signals: - void plasmaThemeSelected( const QString& id ); - private: Ui::PlasmaLnfPage* ui; Config* m_config;