Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorPatrick Klein <42714034+libklein@users.noreply.github.com>2021-12-08 07:40:09 +0300
committerGitHub <noreply@github.com>2021-12-08 07:40:09 +0300
commita0a063b57f6f577bed505ccd652763eeadd1b876 (patch)
tree23adb424daf8e154d2a3c1943ea941780e971c6b /src/gui
parentb3896f260048551d1d08245f85038182cb5e303b (diff)
Add -i/--include option to "generate" CLI command. (#7112)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/PasswordGeneratorWidget.cpp48
1 files changed, 6 insertions, 42 deletions
diff --git a/src/gui/PasswordGeneratorWidget.cpp b/src/gui/PasswordGeneratorWidget.cpp
index faa6777af..32e559418 100644
--- a/src/gui/PasswordGeneratorWidget.cpp
+++ b/src/gui/PasswordGeneratorWidget.cpp
@@ -576,51 +576,15 @@ void PasswordGeneratorWidget::updateGenerator()
auto classes = charClasses();
auto flags = generatorFlags();
- int length = 0;
- if (flags.testFlag(PasswordGenerator::CharFromEveryGroup)) {
- if (classes.testFlag(PasswordGenerator::LowerLetters)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::UpperLetters)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::Numbers)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::Braces)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::Punctuation)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::Quotes)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::Dashes)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::Math)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::Logograms)) {
- ++length;
- }
- if (classes.testFlag(PasswordGenerator::EASCII)) {
- ++length;
- }
- }
-
- length = qMax(length, m_ui->spinBoxLength->value());
- m_passwordGenerator->setLength(length);
- m_passwordGenerator->setCharClasses(classes);
- m_passwordGenerator->setFlags(flags);
+ m_passwordGenerator->setLength(m_ui->spinBoxLength->value());
if (m_ui->buttonAdvancedMode->isChecked()) {
- m_passwordGenerator->setAdditionalChars(m_ui->editAdditionalChars->text());
- m_passwordGenerator->setExcludedChars(m_ui->editExcludedChars->text());
+ m_passwordGenerator->setCharClasses(classes);
+ m_passwordGenerator->setCustomCharacterSet(m_ui->editAdditionalChars->text());
+ m_passwordGenerator->setCustomCharacterSet(m_ui->editExcludedChars->text());
} else {
- m_passwordGenerator->setAdditionalChars("");
- m_passwordGenerator->setExcludedChars("");
+ m_passwordGenerator->setCharClasses(classes);
}
+ m_passwordGenerator->setFlags(flags);
if (m_passwordGenerator->isValid()) {
m_ui->buttonGenerate->setEnabled(true);