Select new entry after cloning

Also fixes re-selecting entries during a search refresh
This commit is contained in:
Akinori MUSHA authored and Jonathan White committed 2023-02-13 23:22:13 -08:00
1 parent b4be71d967
commit cc35bf2096
7 files changed
+59 -41

No files matched your search

+8
View File
@@ -447,6 +447,11 @@ void DatabaseWidget::cloneEntry()
}
auto cloneDialog = new CloneDialog(this, m_db.data(), currentEntry);
connect(cloneDialog, &CloneDialog::entryCloned, this, [this](auto entry) {
refreshSearch();
m_entryView->setCurrentEntry(entry);
});
cloneDialog->show();
}
@@ -1399,7 +1404,10 @@ void DatabaseWidget::performUnlockDatabase(const QString& password, const QStrin
void DatabaseWidget::refreshSearch()
{
if (isSearchActive()) {
auto selectedEntry = m_entryView->currentEntry();
search(m_lastSearchText);
// Re-select the previous entry if it is still in the search
m_entryView->setCurrentEntry(selectedEntry);
}
}