mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-29 09:16:29 -05:00
Fixes crash when deleting in search mode.
This commit is contained in:
parent
37c9ad8e8d
commit
b2fa6fca82
@ -322,8 +322,7 @@ void DatabaseWidget::cloneEntry()
|
||||
|
||||
Entry* entry = currentEntry->clone(Entry::CloneNewUuid | Entry::CloneResetTimeInfo | Entry::CloneRenameTitle);
|
||||
entry->setGroup(currentEntry->group());
|
||||
if (isInSearchMode())
|
||||
search(m_lastSearchText);
|
||||
refreshSearch();
|
||||
m_entryView->setFocus();
|
||||
m_entryView->setCurrentEntry(entry);
|
||||
}
|
||||
@ -366,6 +365,7 @@ void DatabaseWidget::deleteEntries()
|
||||
for (Entry* entry : asConst(selectedEntries)) {
|
||||
delete entry;
|
||||
}
|
||||
refreshSearch();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -875,6 +875,12 @@ void DatabaseWidget::databaseSaved()
|
||||
m_databaseModified = false;
|
||||
}
|
||||
|
||||
void DatabaseWidget::refreshSearch() {
|
||||
if (isInSearchMode()) {
|
||||
search(m_lastSearchText);
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::search(const QString& searchtext)
|
||||
{
|
||||
if (searchtext.isEmpty())
|
||||
@ -908,9 +914,7 @@ void DatabaseWidget::search(const QString& searchtext)
|
||||
void DatabaseWidget::setSearchCaseSensitive(bool state)
|
||||
{
|
||||
m_searchCaseSensitive = state;
|
||||
|
||||
if (isInSearchMode())
|
||||
search(m_lastSearchText);
|
||||
refreshSearch();
|
||||
}
|
||||
|
||||
void DatabaseWidget::onGroupChanged(Group* group)
|
||||
|
@ -147,10 +147,12 @@ public Q_SLOTS:
|
||||
void switchToImportKeepass1(const QString& fileName);
|
||||
void databaseModified();
|
||||
void databaseSaved();
|
||||
|
||||
// Search related slots
|
||||
void search(const QString& searchtext);
|
||||
void setSearchCaseSensitive(bool state);
|
||||
void endSearch();
|
||||
|
||||
void showMessage(const QString& text, MessageWidget::MessageType type);
|
||||
void hideMessage();
|
||||
|
||||
@ -177,6 +179,7 @@ private:
|
||||
void setClipboardTextAndMinimize(const QString& text);
|
||||
void setIconFromParent();
|
||||
void replaceDatabase(Database* db);
|
||||
void refreshSearch();
|
||||
|
||||
Database* m_db;
|
||||
QWidget* m_mainWidget;
|
||||
|
Loading…
Reference in New Issue
Block a user