[plasmalnf] Move job creation to config

main
Adriaan de Groot 4 years ago
parent 0af12546ef
commit cba2733471

@ -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 )
{

@ -10,6 +10,8 @@
#ifndef PLASMALNF_CONFIG_H
#define PLASMALNF_CONFIG_H
#include "Job.h"
#include <QObject>
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)
*

@ -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();
}

Loading…
Cancel
Save