diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp index da57db0fc..e8d0192ee 100644 --- a/src/modules/users/Config.cpp +++ b/src/modules/users/Config.cpp @@ -100,11 +100,16 @@ Config::setUserShell( const QString& shell ) cWarning() << "User shell" << shell << "is not an absolute path."; return; } - // The shell is put into GS because the CreateUser job expects it there - auto* gs = Calamares::JobQueue::instance()->globalStorage(); - if ( gs ) + if ( shell != m_userShell ) { - gs->insert( "userShell", shell ); + m_userShell = shell; + emit userShellChanged(shell); + // The shell is put into GS as well. + auto* gs = Calamares::JobQueue::instance()->globalStorage(); + if ( gs ) + { + gs->insert( "userShell", shell ); + } } } diff --git a/src/modules/users/Tests.cpp b/src/modules/users/Tests.cpp index 3d4aa8694..b1ec8ebbc 100644 --- a/src/modules/users/Tests.cpp +++ b/src/modules/users/Tests.cpp @@ -74,9 +74,7 @@ UserTests::testGetSet() QCOMPARE( c.userShell(), sh + sh ); const QString badsh( "bash" ); // Not absolute, that's bad - c.setUserShell( badsh ); - QEXPECT_FAIL( "", "Shell Unchanged", Abort ); - QCOMPARE( c.userShell(), badsh ); + c.setUserShell( badsh ); // .. so unchanged QCOMPARE( c.userShell(), sh + sh ); // what was set previously // Explicit set to empty is ok