Close search before locking database and add additional check on current group.

Closes #309.
This commit is contained in:
Florian Geyer 2015-07-20 22:10:44 +02:00
parent 98d9dae087
commit 41a7c96968

View File

@ -889,8 +889,17 @@ void DatabaseWidget::clearLastGroup(Group* group)
void DatabaseWidget::lock()
{
Q_ASSERT(currentMode() != DatabaseWidget::LockedMode);
if (isInSearchMode()) {
closeSearch();
}
if (m_groupView->currentGroup()) {
m_groupBeforeLock = m_groupView->currentGroup()->uuid();
}
else {
m_groupBeforeLock = m_db->rootGroup()->uuid();
}
clearAllWidgets();
m_unlockDatabaseWidget->load(m_filename);
setCurrentWidget(m_unlockDatabaseWidget);