[users] Emit password status changes

This commit is contained in:
Adriaan de Groot 2020-08-17 14:08:59 +02:00
parent d7b895b45d
commit 1a7b2668dc
2 changed files with 10 additions and 6 deletions

View File

@ -386,7 +386,8 @@ Config::setUserPassword( const QString& s )
if ( s != m_userPassword )
{
m_userPassword = s;
// TODO: check new password status
const auto p = passwordStatus( m_userPassword, m_userPasswordSecondary );
emit userPasswordStatusChanged( p.first, p.second );
emit userPasswordChanged( s );
}
}
@ -397,7 +398,8 @@ Config::setUserPasswordSecondary( const QString& s )
if ( s != m_userPasswordSecondary )
{
m_userPasswordSecondary = s;
// TODO: check new password status
const auto p = passwordStatus( m_userPassword, m_userPasswordSecondary );
emit userPasswordStatusChanged( p.first, p.second );
emit userPasswordSecondaryChanged( s );
}
}
@ -446,7 +448,8 @@ Config::setRootPassword( const QString& s )
if ( writeRootPassword() && s != m_rootPassword )
{
m_rootPassword = s;
// TODO: check new password status
const auto p = passwordStatus( m_rootPassword, m_rootPasswordSecondary );
emit rootPasswordStatusChanged( p.first, p.second );
emit rootPasswordChanged( s );
}
}
@ -457,7 +460,8 @@ Config::setRootPasswordSecondary( const QString& s )
if ( writeRootPassword() && s != m_rootPasswordSecondary )
{
m_rootPasswordSecondary = s;
// TODO: check new password status
const auto p = passwordStatus( m_rootPassword, m_rootPasswordSecondary );
emit rootPasswordStatusChanged( p.first, p.second );
emit rootPasswordSecondaryChanged( s );
}
}

View File

@ -213,10 +213,10 @@ signals:
void requireStrongPasswordsChanged( bool );
void userPasswordChanged( const QString& );
void userPasswordSecondaryChanged( const QString& );
void userPasswordStatusChanged( int, QString& );
void userPasswordStatusChanged( int, const QString& );
void rootPasswordChanged( const QString& );
void rootPasswordSecondaryChanged( const QString& );
void rootPasswordStatusChanged( int, QString& );
void rootPasswordStatusChanged( int, const QString& );
private: