diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp index dc2ae5b5c..e97c75f62 100644 --- a/src/modules/users/Config.cpp +++ b/src/modules/users/Config.cpp @@ -647,3 +647,15 @@ Config::setConfigurationMap( const QVariantMap& configurationMap ) } std::sort( m_passwordChecks.begin(), m_passwordChecks.end() ); } + +void +Config::finalizeGlobalStorage() const +{ + Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); + + if ( writeRootPassword() ) + { + gs->insert( "reuseRootPassword", reuseUserPasswordForRoot() ); + } + gs->insert( "password", CalamaresUtils::obscure( userPassword() ) ); +} diff --git a/src/modules/users/Config.h b/src/modules/users/Config.h index 0581778d4..ae09f76cc 100644 --- a/src/modules/users/Config.h +++ b/src/modules/users/Config.h @@ -116,6 +116,13 @@ public: void setConfigurationMap( const QVariantMap& ); + /** @brief Fill Global Storage with some settings + * + * This should be called when moving on from the view step, + * and copies some things to GS that otherwise would not. + */ + void finalizeGlobalStorage() const; + /** @brief Full path to the user's shell executable * * Typically this will be /bin/bash, but it can be set from diff --git a/src/modules/users/UsersPage.cpp b/src/modules/users/UsersPage.cpp index 65d6b1e1e..732943bbb 100644 --- a/src/modules/users/UsersPage.cpp +++ b/src/modules/users/UsersPage.cpp @@ -209,23 +209,6 @@ UsersPage::isReady() const return readyFields; } -void -UsersPage::fillGlobalStorage() const -{ - if ( !isReady() ) - { - return; - } - - Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); - - if ( m_config->writeRootPassword() ) - { - gs->insert( "reuseRootPassword", ui->checkBoxReusePassword->isChecked() ); - } - gs->insert( "password", CalamaresUtils::obscure( ui->textBoxUserPassword->text() ) ); -} - void UsersPage::onActivate() diff --git a/src/modules/users/UsersPage.h b/src/modules/users/UsersPage.h index 9c1d56f2e..b82ca9e55 100644 --- a/src/modules/users/UsersPage.h +++ b/src/modules/users/UsersPage.h @@ -44,8 +44,6 @@ public: bool isReady() const; - void fillGlobalStorage() const; - void onActivate(); protected slots: diff --git a/src/modules/users/UsersViewStep.cpp b/src/modules/users/UsersViewStep.cpp index c9041abfe..e2271e759 100644 --- a/src/modules/users/UsersViewStep.cpp +++ b/src/modules/users/UsersViewStep.cpp @@ -143,7 +143,7 @@ UsersViewStep::onLeave() j = new SetHostNameJob( m_config->hostName(), m_config->hostNameActions() ); m_jobs.append( Calamares::job_ptr( j ) ); - m_widget->fillGlobalStorage(); + m_config->finalizeGlobalStorage(); }