From 41a7c96968adca4db2692fa935c2d473ec7c35b7 Mon Sep 17 00:00:00 2001 From: Florian Geyer Date: Mon, 20 Jul 2015 22:10:44 +0200 Subject: [PATCH] Close search before locking database and add additional check on current group. Closes #309. --- src/gui/DatabaseWidget.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 55a70b7ab..31ef9c780 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -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(); + } - m_groupBeforeLock = m_groupView->currentGroup()->uuid(); clearAllWidgets(); m_unlockDatabaseWidget->load(m_filename); setCurrentWidget(m_unlockDatabaseWidget);