permit only wordcount > 0

This commit is contained in:
thez3ro 2017-03-17 00:34:13 +01:00
parent 044feea23a
commit 1d32695f10
No known key found for this signature in database
GPG Key ID: F628F9E41DD7C073
3 changed files with 9 additions and 3 deletions

View File

@ -45,7 +45,13 @@ double PassphraseGenerator::calculateEntropy(QString passphrase)
void PassphraseGenerator::setWordCount(int wordCount)
{
m_wordCount = wordCount;
if (wordCount > 0) {
m_wordCount = wordCount;
} else {
// safe default if something goes wrong
m_wordCount = 7;
}
}
void PassphraseGenerator::setWordlist(QString path)

View File

@ -340,7 +340,7 @@ void PasswordGeneratorWidget::updateGenerator()
m_ui->buttonGenerate->setEnabled(false);
}
} else {
int minWordCount = 0;
int minWordCount = 1;
if (m_ui->spinBoxWordCount->value() < minWordCount) {
m_updatingSpinBox = true;

View File

@ -204,7 +204,7 @@ QProgressBar::chunk {
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="passwordWidget">
<attribute name="title">