Merge commit 'a8359696caf07b81b85db8acad2d3f44720d07fa' into calamares

This is the bugfix part (rather than the "clean up this widgets mess")
of issue-1573, ensuring that the LookAndFeelPackage setting is
saved to the target system config file.
This commit is contained in:
Adriaan de Groot 2020-11-12 15:59:56 +01:00
commit dda2e1f29f
3 changed files with 19 additions and 18 deletions

View File

@ -14,36 +14,30 @@
#include "utils/CalamaresUtilsSystem.h" #include "utils/CalamaresUtilsSystem.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#ifdef WITH_KCONFIG
#include <KConfigGroup>
#include <KSharedConfig>
#endif
PlasmaLnfJob::PlasmaLnfJob( const QString& lnfPath, const QString& id ) PlasmaLnfJob::PlasmaLnfJob( const QString& lnfPath, const QString& id )
: m_lnfPath( lnfPath ) : m_lnfPath( lnfPath )
, m_id( id ) , m_id( id )
{ {
} }
PlasmaLnfJob::~PlasmaLnfJob() {} PlasmaLnfJob::~PlasmaLnfJob() {}
QString QString
PlasmaLnfJob::prettyName() const PlasmaLnfJob::prettyName() const
{ {
return tr( "Plasma Look-and-Feel Job" ); return tr( "Plasma Look-and-Feel Job" );
} }
QString
PlasmaLnfJob::prettyStatusMessage() const
{
return prettyName();
}
Calamares::JobResult Calamares::JobResult
PlasmaLnfJob::exec() PlasmaLnfJob::exec()
{ {
cDebug() << "Plasma Look-and-Feel Job"; auto* system = CalamaresUtils::System::instance();
auto* gs = Calamares::JobQueue::instance()->globalStorage();
auto system = CalamaresUtils::System::instance();
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
QStringList command( { "sudo", QStringList command( { "sudo",
"-E", "-E",
@ -59,8 +53,20 @@ PlasmaLnfJob::exec()
int r = system->targetEnvCall( command ); int r = system->targetEnvCall( command );
if ( r ) if ( r )
{
return Calamares::JobResult::error( tr( "Could not select KDE Plasma Look-and-Feel package" ), 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" ) );
}
#ifdef WITH_KCONFIG
// This is a workaround for lookandfeeltool **not** writing
// the LookAndFeelPackage key in kdeglobals; this happens
// with the lnftool and Plasma 5.20 (possibly other combinations
// as well).
QString targetConfig = system->targetPath( "/home/" + gs->value( "username" ).toString() + "/.config/kdeglobals" );
KConfigGroup cg( KSharedConfig::openConfig( targetConfig ), "KDE" );
cg.writeEntry( "LookAndFeelPackage", m_id );
#endif
return Calamares::JobResult::ok(); return Calamares::JobResult::ok();
} }

View File

@ -24,7 +24,6 @@ public:
~PlasmaLnfJob() override; ~PlasmaLnfJob() override;
QString prettyName() const override; QString prettyName() const override;
QString prettyStatusMessage() const override;
Calamares::JobResult exec() override; Calamares::JobResult exec() override;

View File

@ -14,10 +14,6 @@
#include "utils/PluginFactory.h" #include "utils/PluginFactory.h"
#include "viewpages/ViewStep.h" #include "viewpages/ViewStep.h"
#include <QObject>
#include <QUrl>
#include <QVariantMap>
class PlasmaLnfPage; class PlasmaLnfPage;
class PLUGINDLLEXPORT PlasmaLnfViewStep : public Calamares::ViewStep class PLUGINDLLEXPORT PlasmaLnfViewStep : public Calamares::ViewStep