File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -79,10 +79,9 @@ CipherSettings CipherDialog::getCipherSettings() const
7979
8080void CipherDialog::checkInputFields ()
8181{
82+ CipherSettings::KeyFormats keyFormat = CipherSettings::getKeyFormat (ui->comboKeyFormat ->currentIndex ());
8283 if (sender () == ui->comboKeyFormat )
8384 {
84- CipherSettings::KeyFormats keyFormat = CipherSettings::getKeyFormat (ui->comboKeyFormat ->currentIndex ());
85-
8685 if (keyFormat == CipherSettings::KeyFormats::Passphrase)
8786 {
8887 ui->editPassword ->setValidator (nullptr );
@@ -99,8 +98,14 @@ void CipherDialog::checkInputFields()
9998 }
10099
101100 bool valid = true ;
102- if (encryptMode)
103- valid = ui->editPassword ->text () == ui->editPassword2 ->text ();
101+ if (encryptMode) {
102+ const QString password1 = ui->editPassword ->text ();
103+ valid = password1 == ui->editPassword2 ->text ();
104+
105+ if (keyFormat == CipherSettings::KeyFormats::RawKey) {
106+ valid &= password1.isEmpty () || password1.length () > 2 ;
107+ }
108+ }
104109
105110 ui->buttonBox ->button (QDialogButtonBox::Ok)->setEnabled (valid);
106111}
You can’t perform that action at this time.
0 commit comments