mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-04 13:07:38 +03:00
Add "Restore Entries" feature
This commit is contained in:
parent
e5822974ac
commit
70e62d90db
10 changed files with 63 additions and 1 deletions
|
@ -475,6 +475,26 @@ void DatabaseWidget::deleteSelectedEntries()
|
|||
deleteEntries(std::move(selectedEntries));
|
||||
}
|
||||
|
||||
void DatabaseWidget::restoreSelectedEntries()
|
||||
{
|
||||
const QModelIndexList selected = m_entryView->selectionModel()->selectedRows();
|
||||
if (selected.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Resolve entries from the selection model
|
||||
QList<Entry*> selectedEntries;
|
||||
for (auto& index : selected) {
|
||||
selectedEntries.append(m_entryView->entryFromIndex(index));
|
||||
}
|
||||
|
||||
for (auto* entry : selectedEntries) {
|
||||
if (entry->previousParentGroup()) {
|
||||
entry->setGroup(entry->previousParentGroup());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::deleteEntries(QList<Entry*> selectedEntries, bool confirm)
|
||||
{
|
||||
if (selectedEntries.isEmpty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue