Close databases when they are locked.

Previously we've only hidden access to them.

Closes #275
This commit is contained in:
Felix Geyer 2015-01-11 16:20:59 +01:00
parent 33650c4a04
commit 9e051e835b
11 changed files with 149 additions and 91 deletions

View file

@ -453,12 +453,7 @@ void EditEntryWidget::saveEntry()
}
m_entry = Q_NULLPTR;
m_database = Q_NULLPTR;
m_entryAttributes->clear();
m_entryAttachments->clear();
m_autoTypeAssoc->clear();
m_historyModel->clear();
clear();
Q_EMIT editFinished(true);
}
@ -466,12 +461,8 @@ void EditEntryWidget::saveEntry()
void EditEntryWidget::cancel()
{
if (m_history) {
m_entry = Q_NULLPTR;
m_database = Q_NULLPTR;
m_entryAttributes->clear();
m_entryAttachments->clear();
clear();
Q_EMIT editFinished(false);
return;
}
if (!m_entry->iconUuid().isNull() &&
@ -479,14 +470,19 @@ void EditEntryWidget::cancel()
m_entry->setIcon(Entry::DefaultIconNumber);
}
m_entry = 0;
m_database = 0;
clear();
Q_EMIT editFinished(false);
}
void EditEntryWidget::clear()
{
m_entry = Q_NULLPTR;
m_database = Q_NULLPTR;
m_entryAttributes->clear();
m_entryAttachments->clear();
m_autoTypeAssoc->clear();
m_historyModel->clear();
Q_EMIT editFinished(false);
}
void EditEntryWidget::togglePasswordGeneratorButton(bool checked)

View file

@ -60,6 +60,7 @@ public:
void createPresetsMenu(QMenu* expirePresetsMenu);
QString entryTitle() const;
void clear();
Q_SIGNALS:
void editFinished(bool accepted);