Always clearing ChangeMasterKeyWidget.m_key

This commit is contained in:
Amir Pakdel 2015-05-12 16:31:14 -04:00
parent 58061af959
commit c9d007fcdf

View file

@ -96,7 +96,7 @@ QLabel* ChangeMasterKeyWidget::headlineLabel()
void ChangeMasterKeyWidget::generateKey() void ChangeMasterKeyWidget::generateKey()
{ {
bool cleared = false; m_key.clear();
if (m_ui->passwordGroup->isChecked()) { if (m_ui->passwordGroup->isChecked()) {
if (m_ui->enterPasswordEdit->text() == m_ui->repeatPasswordEdit->text()) { if (m_ui->enterPasswordEdit->text() == m_ui->repeatPasswordEdit->text()) {
@ -107,8 +107,6 @@ void ChangeMasterKeyWidget::generateKey()
return; return;
} }
} }
m_key.clear();
cleared = true;
m_key.addKey(PasswordKey(m_ui->enterPasswordEdit->text())); m_key.addKey(PasswordKey(m_ui->enterPasswordEdit->text()));
} }
else { else {
@ -127,7 +125,6 @@ void ChangeMasterKeyWidget::generateKey()
.arg(m_ui->keyFileCombo->currentText(), errorMsg)); .arg(m_ui->keyFileCombo->currentText(), errorMsg));
return; return;
} }
if (!cleared) m_key.clear();
m_key.addKey(fileKey); m_key.addKey(fileKey);
} }