From 388399f256b158634c7b7aed24955d4053a531f4 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 3 Dec 2017 12:42:44 -0500 Subject: [PATCH] [plasmalnf] Fix command-line options, run in target user environment --- src/modules/plasmalnf/PlasmaLnfJob.cpp | 20 ++++++++------------ src/modules/plasmalnf/PlasmaLnfPage.cpp | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/modules/plasmalnf/PlasmaLnfJob.cpp b/src/modules/plasmalnf/PlasmaLnfJob.cpp index 9bc586719..e6a4fbe10 100644 --- a/src/modules/plasmalnf/PlasmaLnfJob.cpp +++ b/src/modules/plasmalnf/PlasmaLnfJob.cpp @@ -72,26 +72,22 @@ PlasmaLnfJob::exec() { cDebug() << "Plasma Look-and-Feel Job"; -#if 0 - int r = 0; auto system = CalamaresUtils::System::instance(); Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); - if ( system->doChroot() ) - { - r = system->targetEnvCall( QStringList( { m_lnfPath, "--resetlayout", "--apply", m_id } ) ); - } - else - { - r = system->targetEnvCall( QStringList( - { "sudo", "-E", "-u", gs->value("username").toString(), m_lnfPath, "-a", m_id } ) ); - } + QStringList command; + if ( !system->doChroot() ) + command << "sudo" << "-E" << "-H" << "-u" << gs->value("username").toString(); + + command << m_lnfPath << "-platform" << "minimal" << "--resetLayout" << "--apply" << m_id; + + int r = system->targetEnvCall( command ); if (r) return Calamares::JobResult::error( tr( "Could not select KDE Plasma Look-and-Feel package" ), tr( "Could not select KDE Plasma Look-and-Feel package" ) ); -#endif + return Calamares::JobResult::ok(); } diff --git a/src/modules/plasmalnf/PlasmaLnfPage.cpp b/src/modules/plasmalnf/PlasmaLnfPage.cpp index cff182e99..632b9f13a 100644 --- a/src/modules/plasmalnf/PlasmaLnfPage.cpp +++ b/src/modules/plasmalnf/PlasmaLnfPage.cpp @@ -58,7 +58,7 @@ PlasmaLnfPage::activated(const QString& name) cDebug() << "Changed to" << name; QProcess lnftool; - lnftool.start( Calamares::lnftool(), {"--resetlayout", "--apply", name} ); + lnftool.start( Calamares::lnftool(), {"--resetLayout", "--apply", name} ); if ( lnftool.waitForStarted(1000) && lnftool.waitForFinished( 1000 ) && (lnftool.exitCode() == 0) && (lnftool.exitStatus() == QProcess::NormalExit ) ) ; // OK