[plasmalnf] Introduce (empty) Config object

This commit is contained in:
Adriaan de Groot 2020-11-11 13:08:42 +01:00
parent a8359696ca
commit 0f07550006
5 changed files with 52 additions and 0 deletions

View File

@ -32,6 +32,7 @@ if ( KF5Plasma_FOUND AND KF5Package_FOUND )
COMPILE_DEFINITIONS
${option_defs}
SOURCES
Config.cpp
PlasmaLnfViewStep.cpp
PlasmaLnfPage.cpp
PlasmaLnfJob.cpp

View File

@ -0,0 +1,20 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#include "Config.h"
Config::Config( QObject* parent )
: QObject( parent )
{
}
void
Config::setConfigurationMap( const QVariantMap& )
{
}

View File

@ -0,0 +1,26 @@
/* === This file is part of Calamares - <https://calamares.io> ===
*
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#ifndef PLASMALNF_CONFIG_H
#define PLASMALNF_CONFIG_H
#include <QObject>
class Config : public QObject
{
Q_OBJECT
public:
Config( QObject* parent = nullptr );
virtual ~Config() override = default;
void setConfigurationMap( const QVariantMap& );
};
#endif

View File

@ -8,6 +8,7 @@
*/
#include "PlasmaLnfViewStep.h"
#include "Config.h"
#include "PlasmaLnfJob.h"
#include "PlasmaLnfPage.h"
#include "ThemeInfo.h"
@ -39,6 +40,7 @@ currentPlasmaTheme()
PlasmaLnfViewStep::PlasmaLnfViewStep( QObject* parent )
: Calamares::ViewStep( parent )
, m_config( new Config( this ) )
, m_widget( new PlasmaLnfPage )
{
connect( m_widget, &PlasmaLnfPage::plasmaThemeSelected, this, &PlasmaLnfViewStep::themeSelected );
@ -127,6 +129,7 @@ PlasmaLnfViewStep::jobs() const
void
PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap )
{
m_config->setConfigurationMap( configurationMap );
m_lnfPath = CalamaresUtils::getString( configurationMap, "lnftool" );
m_widget->setLnfPath( m_lnfPath );

View File

@ -14,6 +14,7 @@
#include "utils/PluginFactory.h"
#include "viewpages/ViewStep.h"
class Config;
class PlasmaLnfPage;
class PLUGINDLLEXPORT PlasmaLnfViewStep : public Calamares::ViewStep
@ -44,6 +45,7 @@ public slots:
void themeSelected( const QString& id );
private:
Config* m_config;
PlasmaLnfPage* m_widget;
QString m_lnfPath; // Path to the lnf tool
QString m_themeId; // Id of selected theme