[users] In code, consistently [aA]utoLogin as name
There was a mix of autologin and autoLogin, leading to confusion in the code. QML is sensitive to this, so go to one consistent name. (Although the names of the settings in the `.conf` file are different again)
This commit is contained in:
parent
287047fe1a
commit
4ffa79d4cf
@ -59,11 +59,11 @@ updateGSAutoLogin( bool doAutoLogin, const QString& login )
|
|||||||
|
|
||||||
if ( doAutoLogin && !login.isEmpty() )
|
if ( doAutoLogin && !login.isEmpty() )
|
||||||
{
|
{
|
||||||
gs->insert( "autologinUser", login );
|
gs->insert( "autoLoginUser", login );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gs->remove( "autologinUser" );
|
gs->remove( "autoLoginUser" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( login.isEmpty() )
|
if ( login.isEmpty() )
|
||||||
@ -142,13 +142,13 @@ insertInGlobalStorage( const QString& key, const QString& group )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Config::setAutologinGroup( const QString& group )
|
Config::setAutoLoginGroup( const QString& group )
|
||||||
{
|
{
|
||||||
if ( group != m_autologinGroup )
|
if ( group != m_autoLoginGroup )
|
||||||
{
|
{
|
||||||
m_autologinGroup = group;
|
m_autoLoginGroup = group;
|
||||||
insertInGlobalStorage( QStringLiteral( "autologinGroup" ), group );
|
insertInGlobalStorage( QStringLiteral( "autoLoginGroup" ), group );
|
||||||
emit autologinGroupChanged( group );
|
emit autoLoginGroupChanged( group );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,9 +162,9 @@ Config::groupsForThisUser() const
|
|||||||
{
|
{
|
||||||
l << g.name();
|
l << g.name();
|
||||||
}
|
}
|
||||||
if ( doAutoLogin() && !autologinGroup().isEmpty() )
|
if ( doAutoLogin() && !autoLoginGroup().isEmpty() )
|
||||||
{
|
{
|
||||||
l << autologinGroup();
|
l << autoLoginGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
return l;
|
return l;
|
||||||
@ -814,13 +814,13 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
// Now it might be explicitly set to empty, which is ok
|
// Now it might be explicitly set to empty, which is ok
|
||||||
setUserShell( shell );
|
setUserShell( shell );
|
||||||
|
|
||||||
setAutologinGroup( CalamaresUtils::getString( configurationMap, "autologinGroup" ) );
|
setAutoLoginGroup( CalamaresUtils::getString( configurationMap, "autoLoginGroup" ) );
|
||||||
setSudoersGroup( CalamaresUtils::getString( configurationMap, "sudoersGroup" ) );
|
setSudoersGroup( CalamaresUtils::getString( configurationMap, "sudoersGroup" ) );
|
||||||
|
|
||||||
m_hostNameActions = getHostNameActions( configurationMap );
|
m_hostNameActions = getHostNameActions( configurationMap );
|
||||||
|
|
||||||
setConfigurationDefaultGroups( configurationMap, m_defaultGroups );
|
setConfigurationDefaultGroups( configurationMap, m_defaultGroups );
|
||||||
m_doAutoLogin = CalamaresUtils::getBool( configurationMap, "doAutologin", false );
|
m_doAutoLogin = CalamaresUtils::getBool( configurationMap, "doAutoLogin", false );
|
||||||
|
|
||||||
m_writeRootPassword = CalamaresUtils::getBool( configurationMap, "setRootPassword", true );
|
m_writeRootPassword = CalamaresUtils::getBool( configurationMap, "setRootPassword", true );
|
||||||
Calamares::JobQueue::instance()->globalStorage()->insert( "setRootPassword", m_writeRootPassword );
|
Calamares::JobQueue::instance()->globalStorage()->insert( "setRootPassword", m_writeRootPassword );
|
||||||
|
@ -92,7 +92,7 @@ class PLUGINDLLEXPORT Config : public Calamares::ModuleSystem::Config
|
|||||||
|
|
||||||
Q_PROPERTY( QString userShell READ userShell WRITE setUserShell NOTIFY userShellChanged )
|
Q_PROPERTY( QString userShell READ userShell WRITE setUserShell NOTIFY userShellChanged )
|
||||||
|
|
||||||
Q_PROPERTY( QString autologinGroup READ autologinGroup WRITE setAutologinGroup NOTIFY autologinGroupChanged )
|
Q_PROPERTY( QString autoLoginGroup READ autoLoginGroup WRITE setAutoLoginGroup NOTIFY autoLoginGroupChanged )
|
||||||
Q_PROPERTY( QString sudoersGroup READ sudoersGroup WRITE setSudoersGroup NOTIFY sudoersGroupChanged )
|
Q_PROPERTY( QString sudoersGroup READ sudoersGroup WRITE setSudoersGroup NOTIFY sudoersGroupChanged )
|
||||||
|
|
||||||
Q_PROPERTY( bool doAutoLogin READ doAutoLogin WRITE setAutoLogin NOTIFY autoLoginChanged )
|
Q_PROPERTY( bool doAutoLogin READ doAutoLogin WRITE setAutoLogin NOTIFY autoLoginChanged )
|
||||||
@ -185,7 +185,7 @@ public:
|
|||||||
QString userShell() const { return m_userShell; }
|
QString userShell() const { return m_userShell; }
|
||||||
|
|
||||||
/// The group of which auto-login users must be a member
|
/// The group of which auto-login users must be a member
|
||||||
QString autologinGroup() const { return m_autologinGroup; }
|
QString autoLoginGroup() const { return m_autoLoginGroup; }
|
||||||
/// The group of which users who can "sudo" must be a member
|
/// The group of which users who can "sudo" must be a member
|
||||||
QString sudoersGroup() const { return m_sudoersGroup; }
|
QString sudoersGroup() const { return m_sudoersGroup; }
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ public:
|
|||||||
const QList< GroupDescription >& defaultGroups() const { return m_defaultGroups; }
|
const QList< GroupDescription >& defaultGroups() const { return m_defaultGroups; }
|
||||||
/** @brief the names of all the groups for the current user
|
/** @brief the names of all the groups for the current user
|
||||||
*
|
*
|
||||||
* Takes into account defaultGroups and autologin behavior.
|
* Takes into account defaultGroups and autoLogin behavior.
|
||||||
*/
|
*/
|
||||||
QStringList groupsForThisUser() const;
|
QStringList groupsForThisUser() const;
|
||||||
|
|
||||||
@ -253,8 +253,8 @@ public Q_SLOTS:
|
|||||||
*/
|
*/
|
||||||
void setUserShell( const QString& path );
|
void setUserShell( const QString& path );
|
||||||
|
|
||||||
/// Sets the autologin group; empty is ignored
|
/// Sets the autoLogin group; empty is ignored
|
||||||
void setAutologinGroup( const QString& group );
|
void setAutoLoginGroup( const QString& group );
|
||||||
/// Sets the sudoer group; empty is ignored
|
/// Sets the sudoer group; empty is ignored
|
||||||
void setSudoersGroup( const QString& group );
|
void setSudoersGroup( const QString& group );
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ public Q_SLOTS:
|
|||||||
/// Sets the host name (flags it as "custom")
|
/// Sets the host name (flags it as "custom")
|
||||||
void setHostName( const QString& host );
|
void setHostName( const QString& host );
|
||||||
|
|
||||||
/// Sets the autologin flag
|
/// Sets the autoLogin flag
|
||||||
void setAutoLogin( bool b );
|
void setAutoLogin( bool b );
|
||||||
|
|
||||||
/// Set to true to use the user password, unchanged, for root too
|
/// Set to true to use the user password, unchanged, for root too
|
||||||
@ -281,7 +281,7 @@ public Q_SLOTS:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void userShellChanged( const QString& );
|
void userShellChanged( const QString& );
|
||||||
void autologinGroupChanged( const QString& );
|
void autoLoginGroupChanged( const QString& );
|
||||||
void sudoersGroupChanged( const QString& );
|
void sudoersGroupChanged( const QString& );
|
||||||
void fullNameChanged( const QString& );
|
void fullNameChanged( const QString& );
|
||||||
void loginNameChanged( const QString& );
|
void loginNameChanged( const QString& );
|
||||||
@ -305,7 +305,7 @@ private:
|
|||||||
|
|
||||||
QList< GroupDescription > m_defaultGroups;
|
QList< GroupDescription > m_defaultGroups;
|
||||||
QString m_userShell;
|
QString m_userShell;
|
||||||
QString m_autologinGroup;
|
QString m_autoLoginGroup;
|
||||||
QString m_sudoersGroup;
|
QString m_sudoersGroup;
|
||||||
QString m_fullName;
|
QString m_fullName;
|
||||||
QString m_loginName;
|
QString m_loginName;
|
||||||
|
@ -184,11 +184,11 @@ SetupGroupsJob::exec()
|
|||||||
tr( "These groups are missing in the target system: %1" ).arg( missingGroups.join( ',' ) ) );
|
tr( "These groups are missing in the target system: %1" ).arg( missingGroups.join( ',' ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_config->doAutoLogin() && !m_config->autologinGroup().isEmpty() )
|
if ( m_config->doAutoLogin() && !m_config->autoLoginGroup().isEmpty() )
|
||||||
{
|
{
|
||||||
const QString autologinGroup = m_config->autologinGroup();
|
const QString autoLoginGroup = m_config->autoLoginGroup();
|
||||||
(void)ensureGroupsExistInTarget(
|
(void)ensureGroupsExistInTarget(
|
||||||
QList< GroupDescription >() << GroupDescription( autologinGroup ), availableGroups, missingGroups );
|
QList< GroupDescription >() << GroupDescription( autoLoginGroup ), availableGroups, missingGroups );
|
||||||
}
|
}
|
||||||
|
|
||||||
return Calamares::JobResult::ok();
|
return Calamares::JobResult::ok();
|
||||||
|
@ -83,13 +83,13 @@ UserTests::testGetSet()
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
const QString al( "autolg" );
|
const QString al( "autolg" );
|
||||||
QCOMPARE( c.autologinGroup(), QString() );
|
QCOMPARE( c.autoLoginGroup(), QString() );
|
||||||
c.setAutologinGroup( al );
|
c.setAutoLoginGroup( al );
|
||||||
QCOMPARE( c.autologinGroup(), al );
|
QCOMPARE( c.autoLoginGroup(), al );
|
||||||
QVERIFY( !c.doAutoLogin() );
|
QVERIFY( !c.doAutoLogin() );
|
||||||
c.setAutoLogin( true );
|
c.setAutoLogin( true );
|
||||||
QVERIFY( c.doAutoLogin() );
|
QVERIFY( c.doAutoLogin() );
|
||||||
QCOMPARE( c.autologinGroup(), al );
|
QCOMPARE( c.autoLoginGroup(), al );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const QString su( "sudogrp" );
|
const QString su( "sudogrp" );
|
||||||
|
Loading…
Reference in New Issue
Block a user