Close database without asking when unmodified.

Don't ask for confirmation when closing/locking a database and
- it's in edit entry mode
- there haven't been any modifications

Refs #511
This commit is contained in:
Felix Geyer
2016-08-01 00:22:04 +02:00
committed by Jonathan White
parent cf8186312a
commit 8a50ee8b22
5 changed files with 32 additions and 2 deletions

View File

@@ -497,6 +497,22 @@ void EditEntryWidget::clear()
m_iconsWidget->reset();
}
bool EditEntryWidget::hasBeenModified() const
{
// entry has been modified if a history item is to be deleted
if (!m_historyModel->deletedEntries().isEmpty()) {
return true;
}
// check if updating the entry would modify it
QScopedPointer<Entry> entry(new Entry());
entry->copyDataFrom(m_entry);
entry->beginUpdate();
updateEntryData(entry.data());
return entry->endUpdate();
}
void EditEntryWidget::togglePasswordGeneratorButton(bool checked)
{
m_mainUi->passwordGenerator->setVisible(checked);