[plasmalnf] Move the lookandfeeltool path setting to Config
This commit is contained in:
parent
0f07550006
commit
00293d1111
@ -9,12 +9,21 @@
|
||||
|
||||
#include "Config.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Variant.h"
|
||||
|
||||
Config::Config( QObject* parent )
|
||||
: QObject( parent )
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Config::setConfigurationMap( const QVariantMap& )
|
||||
Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
{
|
||||
m_lnfPath = CalamaresUtils::getString( configurationMap, "lnftool" );
|
||||
|
||||
if ( m_lnfPath.isEmpty() )
|
||||
{
|
||||
cWarning() << "no lnftool given for plasmalnf module.";
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,11 @@ public:
|
||||
virtual ~Config() override = default;
|
||||
|
||||
void setConfigurationMap( const QVariantMap& );
|
||||
|
||||
QString lnfToolPath() const { return m_lnfPath; }
|
||||
|
||||
private:
|
||||
QString m_lnfPath; // Path to the lnf tool
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -113,9 +113,9 @@ PlasmaLnfViewStep::jobs() const
|
||||
cDebug() << "Creating Plasma LNF jobs ..";
|
||||
if ( !m_themeId.isEmpty() )
|
||||
{
|
||||
if ( !m_lnfPath.isEmpty() )
|
||||
if ( !m_config->lnfToolPath().isEmpty() )
|
||||
{
|
||||
l.append( Calamares::job_ptr( new PlasmaLnfJob( m_lnfPath, m_themeId ) ) );
|
||||
l.append( Calamares::job_ptr( new PlasmaLnfJob( m_config->lnfToolPath(), m_themeId ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -130,13 +130,8 @@ void
|
||||
PlasmaLnfViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
{
|
||||
m_config->setConfigurationMap( configurationMap );
|
||||
m_lnfPath = CalamaresUtils::getString( configurationMap, "lnftool" );
|
||||
m_widget->setLnfPath( m_lnfPath );
|
||||
|
||||
if ( m_lnfPath.isEmpty() )
|
||||
{
|
||||
cWarning() << "no lnftool given for plasmalnf module.";
|
||||
}
|
||||
m_widget->setLnfPath( m_config->lnfToolPath() );
|
||||
|
||||
m_liveUser = CalamaresUtils::getString( configurationMap, "liveuser" );
|
||||
|
||||
@ -186,7 +181,7 @@ void
|
||||
PlasmaLnfViewStep::themeSelected( const QString& id )
|
||||
{
|
||||
m_themeId = id;
|
||||
if ( m_lnfPath.isEmpty() )
|
||||
if ( m_config->lnfToolPath().isEmpty() )
|
||||
{
|
||||
cWarning() << "no lnftool given for plasmalnf module.";
|
||||
return;
|
||||
@ -194,18 +189,18 @@ PlasmaLnfViewStep::themeSelected( const QString& id )
|
||||
|
||||
QProcess lnftool;
|
||||
if ( !m_liveUser.isEmpty() )
|
||||
lnftool.start( "sudo", { "-E", "-H", "-u", m_liveUser, m_lnfPath, "--resetLayout", "--apply", id } );
|
||||
lnftool.start( "sudo", { "-E", "-H", "-u", m_liveUser, m_config->lnfToolPath(), "--resetLayout", "--apply", id } );
|
||||
else
|
||||
lnftool.start( m_lnfPath, { "--resetLayout", "--apply", id } );
|
||||
lnftool.start( m_config->lnfToolPath(), { "--resetLayout", "--apply", id } );
|
||||
|
||||
if ( !lnftool.waitForStarted( 1000 ) )
|
||||
{
|
||||
cWarning() << "could not start look-and-feel" << m_lnfPath;
|
||||
cWarning() << "could not start look-and-feel" << m_config->lnfToolPath();
|
||||
return;
|
||||
}
|
||||
if ( !lnftool.waitForFinished() )
|
||||
{
|
||||
cWarning() << m_lnfPath << "timed out.";
|
||||
cWarning() << m_config->lnfToolPath() << "timed out.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,6 @@ public slots:
|
||||
private:
|
||||
Config* m_config;
|
||||
PlasmaLnfPage* m_widget;
|
||||
QString m_lnfPath; // Path to the lnf tool
|
||||
QString m_themeId; // Id of selected theme
|
||||
QString m_liveUser; // Name of the live user (for OEM mode)
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user