[users] Apply coding style
This commit is contained in:
parent
24d0ca6f8e
commit
d20a621e93
@ -55,7 +55,7 @@ DEFINE_CHECK_FUNC( minLength )
|
|||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "minLength set to" << minLength;
|
cDebug() << Logger::SubEntry << "minLength set to" << minLength;
|
||||||
checks.push_back( PasswordCheck( []() { return QCoreApplication::translate( "PWQ", "Password is too short" ); },
|
checks.push_back( PasswordCheck( []() { return QCoreApplication::translate( "PWQ", "Password is too short" ); },
|
||||||
[minLength]( const QString& s ) { return s.length() >= minLength; },
|
[ minLength ]( const QString& s ) { return s.length() >= minLength; },
|
||||||
PasswordCheck::Weight( 10 ) ) );
|
PasswordCheck::Weight( 10 ) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ DEFINE_CHECK_FUNC( maxLength )
|
|||||||
{
|
{
|
||||||
cDebug() << Logger::SubEntry << "maxLength set to" << maxLength;
|
cDebug() << Logger::SubEntry << "maxLength set to" << maxLength;
|
||||||
checks.push_back( PasswordCheck( []() { return QCoreApplication::translate( "PWQ", "Password is too long" ); },
|
checks.push_back( PasswordCheck( []() { return QCoreApplication::translate( "PWQ", "Password is too long" ); },
|
||||||
[maxLength]( const QString& s ) { return s.length() <= maxLength; },
|
[ maxLength ]( const QString& s ) { return s.length() <= maxLength; },
|
||||||
PasswordCheck::Weight( 10 ) ) );
|
PasswordCheck::Weight( 10 ) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -349,8 +349,8 @@ DEFINE_CHECK_FUNC( libpwquality )
|
|||||||
/* Something actually added? */
|
/* Something actually added? */
|
||||||
if ( requirement_count )
|
if ( requirement_count )
|
||||||
{
|
{
|
||||||
checks.push_back( PasswordCheck( [settings]() { return settings->explanation(); },
|
checks.push_back( PasswordCheck( [ settings ]() { return settings->explanation(); },
|
||||||
[settings]( const QString& s ) {
|
[ settings ]( const QString& s ) {
|
||||||
int r = settings->check( s );
|
int r = settings->check( s );
|
||||||
if ( r < 0 )
|
if ( r < 0 )
|
||||||
{
|
{
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
|
|
||||||
QTEST_GUILESS_MAIN( PasswordTests )
|
QTEST_GUILESS_MAIN( PasswordTests )
|
||||||
|
|
||||||
PasswordTests::PasswordTests() {}
|
PasswordTests::PasswordTests() { }
|
||||||
|
|
||||||
PasswordTests::~PasswordTests() {}
|
PasswordTests::~PasswordTests() { }
|
||||||
|
|
||||||
void
|
void
|
||||||
PasswordTests::initTestCase()
|
PasswordTests::initTestCase()
|
||||||
|
@ -37,7 +37,7 @@ class UsersTests : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
UsersTests();
|
UsersTests();
|
||||||
virtual ~UsersTests() {}
|
virtual ~UsersTests() { }
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
|
@ -99,12 +99,12 @@ UsersPage::UsersPage( QWidget* parent )
|
|||||||
connect( ui->textBoxUserVerifiedPassword, &QLineEdit::textChanged, this, &UsersPage::onPasswordTextChanged );
|
connect( ui->textBoxUserVerifiedPassword, &QLineEdit::textChanged, this, &UsersPage::onPasswordTextChanged );
|
||||||
connect( ui->textBoxRootPassword, &QLineEdit::textChanged, this, &UsersPage::onRootPasswordTextChanged );
|
connect( ui->textBoxRootPassword, &QLineEdit::textChanged, this, &UsersPage::onRootPasswordTextChanged );
|
||||||
connect( ui->textBoxVerifiedRootPassword, &QLineEdit::textChanged, this, &UsersPage::onRootPasswordTextChanged );
|
connect( ui->textBoxVerifiedRootPassword, &QLineEdit::textChanged, this, &UsersPage::onRootPasswordTextChanged );
|
||||||
connect( ui->checkBoxValidatePassword, &QCheckBox::stateChanged, this, [this]( int ) {
|
connect( ui->checkBoxValidatePassword, &QCheckBox::stateChanged, this, [ this ]( int ) {
|
||||||
onPasswordTextChanged( ui->textBoxUserPassword->text() );
|
onPasswordTextChanged( ui->textBoxUserPassword->text() );
|
||||||
onRootPasswordTextChanged( ui->textBoxRootPassword->text() );
|
onRootPasswordTextChanged( ui->textBoxRootPassword->text() );
|
||||||
checkReady( isReady() );
|
checkReady( isReady() );
|
||||||
} );
|
} );
|
||||||
connect( ui->checkBoxReusePassword, &QCheckBox::stateChanged, this, [this]( int checked ) {
|
connect( ui->checkBoxReusePassword, &QCheckBox::stateChanged, this, [ this ]( int checked ) {
|
||||||
/* When "reuse" is checked, hide the fields for explicitly
|
/* When "reuse" is checked, hide the fields for explicitly
|
||||||
* entering the root password. However, if we're going to
|
* entering the root password. However, if we're going to
|
||||||
* disable the root password anyway, hide them all regardless of
|
* disable the root password anyway, hide them all regardless of
|
||||||
|
Loading…
Reference in New Issue
Block a user