diff --git a/src/modules/plasmalnf/Config.cpp b/src/modules/plasmalnf/Config.cpp index c813959e3..c7aea240f 100644 --- a/src/modules/plasmalnf/Config.cpp +++ b/src/modules/plasmalnf/Config.cpp @@ -9,6 +9,8 @@ #include "Config.h" +#include "PlasmaLnfJob.h" + #include "utils/CalamaresUtilsSystem.h" #include "utils/Logger.h" #include "utils/Variant.h" @@ -31,6 +33,27 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) m_liveUser = CalamaresUtils::getString( configurationMap, "liveuser" ); } +Calamares::JobList +Config::createJobs() const +{ + Calamares::JobList l; + + cDebug() << "Creating Plasma LNF jobs .."; + if ( !theme().isEmpty() ) + { + if ( !lnfToolPath().isEmpty() ) + { + l.append( Calamares::job_ptr( new PlasmaLnfJob( lnfToolPath(), theme() ) ) ); + } + else + { + cWarning() << "no lnftool given for plasmalnf module."; + } + } + return l; +} + + void Config::setTheme( const QString& id ) { diff --git a/src/modules/plasmalnf/Config.h b/src/modules/plasmalnf/Config.h index 16980abc0..ef32df2d9 100644 --- a/src/modules/plasmalnf/Config.h +++ b/src/modules/plasmalnf/Config.h @@ -10,6 +10,8 @@ #ifndef PLASMALNF_CONFIG_H #define PLASMALNF_CONFIG_H +#include "Job.h" + #include class Config : public QObject @@ -23,6 +25,7 @@ public: virtual ~Config() override = default; void setConfigurationMap( const QVariantMap& ); + Calamares::JobList createJobs() const; /** @brief Full path to the lookandfeeltool (if it exists) * diff --git a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp index 7f8e19681..52435d5a6 100644 --- a/src/modules/plasmalnf/PlasmaLnfViewStep.cpp +++ b/src/modules/plasmalnf/PlasmaLnfViewStep.cpp @@ -9,7 +9,6 @@ #include "PlasmaLnfViewStep.h" #include "Config.h" -#include "PlasmaLnfJob.h" #include "PlasmaLnfPage.h" #include "ThemeInfo.h" @@ -108,21 +107,7 @@ PlasmaLnfViewStep::onLeave() Calamares::JobList PlasmaLnfViewStep::jobs() const { - Calamares::JobList l; - - cDebug() << "Creating Plasma LNF jobs .."; - if ( !m_config->theme().isEmpty() ) - { - if ( !m_config->lnfToolPath().isEmpty() ) - { - l.append( Calamares::job_ptr( new PlasmaLnfJob( m_config->lnfToolPath(), m_config->theme() ) ) ); - } - else - { - cWarning() << "no lnftool given for plasmalnf module."; - } - } - return l; + return m_config->createJobs(); }