Catch and handle all errors from libgcrypt.

This commit is contained in:
Felix Geyer 2015-05-09 19:47:53 +02:00
parent a7f4e2d0cd
commit a762cef0a9
29 changed files with 622 additions and 194 deletions

View file

@ -599,8 +599,13 @@ void DatabaseWidget::updateMasterKey(bool accepted)
{
if (accepted) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
m_db->setKey(m_changeMasterKeyWidget->newMasterKey());
bool result = m_db->setKey(m_changeMasterKeyWidget->newMasterKey());
QApplication::restoreOverrideCursor();
if (!result) {
MessageBox::critical(this, tr("Error"), tr("Unable to calculate master key"));
return;
}
}
else if (!m_db->hasKey()) {
Q_EMIT closeRequest();