diff --git a/src/modules/tracking/Config.cpp b/src/modules/tracking/Config.cpp index 51e51e7c8..6d9dbb10b 100644 --- a/src/modules/tracking/Config.cpp +++ b/src/modules/tracking/Config.cpp @@ -165,6 +165,8 @@ UserTrackingConfig::setConfigurationMap( const QVariantMap& configurationMap ) m_userTrackingStyle = CalamaresUtils::getString( configurationMap, "style" ); validate( m_userTrackingStyle, isValidUserTrackingStyle ); + + m_userTrackingAreas = CalamaresUtils::getStringList( configurationMap, "areas" ); } diff --git a/src/modules/tracking/Config.h b/src/modules/tracking/Config.h index 0bdff260a..fb279ea93 100644 --- a/src/modules/tracking/Config.h +++ b/src/modules/tracking/Config.h @@ -149,9 +149,11 @@ public: void setConfigurationMap( const QVariantMap& configurationMap ); QString userTrackingStyle() { return m_userTrackingStyle; } + QStringList userTrackingAreas() const { return m_userTrackingAreas; } private: QString m_userTrackingStyle; + QStringList m_userTrackingAreas; // fine-grained areas }; class Config : public QObject diff --git a/src/modules/tracking/TrackingJobs.cpp b/src/modules/tracking/TrackingJobs.cpp index cd885194c..35d51ce64 100644 --- a/src/modules/tracking/TrackingJobs.cpp +++ b/src/modules/tracking/TrackingJobs.cpp @@ -169,7 +169,8 @@ TrackingUserJob::addJob( Calamares::JobList& list, UserTrackingConfig* config ) const auto style = config->userTrackingStyle(); if ( style == "kuserfeedback" ) { - list.append( Calamares::job_ptr( new TrackingKUserFeedbackJob() ) ); + list.append( + Calamares::job_ptr( new TrackingKUserFeedbackJob( QString( "root" ), config->userTrackingAreas() ) ) ); } else { @@ -178,6 +179,12 @@ TrackingUserJob::addJob( Calamares::JobList& list, UserTrackingConfig* config ) } } +TrackingKUserFeedbackJob::TrackingKUserFeedbackJob( const QString& username, const QStringList& areas ) + : m_username( username ) + , m_areas( areas ) +{ +} + QString TrackingKUserFeedbackJob::prettyName() const { @@ -206,10 +213,9 @@ TrackingKUserFeedbackJob::exec() FeedbackLevel=16 )x"; - for ( const QString& area : QStringList { "PlasmaUserFeedback" } ) + for ( const QString& area : m_areas ) { - // TODO: get the configured user name - QString path = QStringLiteral( "/home/%1/.config/%2" ).arg( QString(), area ); + QString path = QStringLiteral( "/home/%1/.config/%2" ).arg( m_username, area ); cDebug() << "Configuring KUserFeedback" << path; int r = CalamaresUtils::System::instance()->createTargetFile( path, config ); diff --git a/src/modules/tracking/TrackingJobs.h b/src/modules/tracking/TrackingJobs.h index dd5ca6b92..c65c8f621 100644 --- a/src/modules/tracking/TrackingJobs.h +++ b/src/modules/tracking/TrackingJobs.h @@ -114,10 +114,16 @@ public: class TrackingKUserFeedbackJob : public Calamares::Job { public: + TrackingKUserFeedbackJob( const QString& username, const QStringList& areas ); + QString prettyName() const override; QString prettyDescription() const override; QString prettyStatusMessage() const override; Calamares::JobResult exec() override; + +private: + QString m_username; + QStringList m_areas; }; #endif