[plasmalnf] Move job creation to config
This commit is contained in:
parent
0af12546ef
commit
cba2733471
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
|
||||||
|
#include "PlasmaLnfJob.h"
|
||||||
|
|
||||||
#include "utils/CalamaresUtilsSystem.h"
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
@ -31,6 +33,27 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
m_liveUser = CalamaresUtils::getString( configurationMap, "liveuser" );
|
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
|
void
|
||||||
Config::setTheme( const QString& id )
|
Config::setTheme( const QString& id )
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
#ifndef PLASMALNF_CONFIG_H
|
#ifndef PLASMALNF_CONFIG_H
|
||||||
#define PLASMALNF_CONFIG_H
|
#define PLASMALNF_CONFIG_H
|
||||||
|
|
||||||
|
#include "Job.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
class Config : public QObject
|
class Config : public QObject
|
||||||
@ -23,6 +25,7 @@ public:
|
|||||||
virtual ~Config() override = default;
|
virtual ~Config() override = default;
|
||||||
|
|
||||||
void setConfigurationMap( const QVariantMap& );
|
void setConfigurationMap( const QVariantMap& );
|
||||||
|
Calamares::JobList createJobs() const;
|
||||||
|
|
||||||
/** @brief Full path to the lookandfeeltool (if it exists)
|
/** @brief Full path to the lookandfeeltool (if it exists)
|
||||||
*
|
*
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "PlasmaLnfViewStep.h"
|
#include "PlasmaLnfViewStep.h"
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "PlasmaLnfJob.h"
|
|
||||||
#include "PlasmaLnfPage.h"
|
#include "PlasmaLnfPage.h"
|
||||||
#include "ThemeInfo.h"
|
#include "ThemeInfo.h"
|
||||||
|
|
||||||
@ -108,21 +107,7 @@ PlasmaLnfViewStep::onLeave()
|
|||||||
Calamares::JobList
|
Calamares::JobList
|
||||||
PlasmaLnfViewStep::jobs() const
|
PlasmaLnfViewStep::jobs() const
|
||||||
{
|
{
|
||||||
Calamares::JobList l;
|
return m_config->createJobs();
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user