[plasmalnf] Fix command-line options, run in target user environment

This commit is contained in:
Adriaan de Groot 2017-12-03 12:42:44 -05:00
parent 7e5970324f
commit 388399f256
2 changed files with 9 additions and 13 deletions

View File

@ -72,26 +72,22 @@ PlasmaLnfJob::exec()
{ {
cDebug() << "Plasma Look-and-Feel Job"; cDebug() << "Plasma Look-and-Feel Job";
#if 0
int r = 0;
auto system = CalamaresUtils::System::instance(); auto system = CalamaresUtils::System::instance();
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
if ( system->doChroot() ) QStringList command;
{
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 } ) );
}
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) if (r)
return Calamares::JobResult::error( return Calamares::JobResult::error(
tr( "Could not select KDE Plasma Look-and-Feel package" ), tr( "Could not select KDE Plasma Look-and-Feel package" ),
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(); return Calamares::JobResult::ok();
} }

View File

@ -58,7 +58,7 @@ PlasmaLnfPage::activated(const QString& name)
cDebug() << "Changed to" << name; cDebug() << "Changed to" << name;
QProcess lnftool; 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 ) ) if ( lnftool.waitForStarted(1000) && lnftool.waitForFinished( 1000 ) && (lnftool.exitCode() == 0) && (lnftool.exitStatus() == QProcess::NormalExit ) )
; // OK ; // OK