mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-24 15:25:31 -04:00
Correct refactor issues with entry selection and search (#2518)
* Align entryview selection change signals with groupview * Eliminate redundent and confusing signals/slots * Correct group selection canceling search
This commit is contained in:
parent
fff0f11b33
commit
d84ba23c81
7 changed files with 48 additions and 59 deletions
|
@ -50,7 +50,7 @@ EntryView::EntryView(QWidget* parent)
|
|||
setDefaultDropAction(Qt::MoveAction);
|
||||
|
||||
connect(this, SIGNAL(doubleClicked(QModelIndex)), SLOT(emitEntryActivated(QModelIndex)));
|
||||
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SIGNAL(entrySelectionChanged()));
|
||||
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(emitEntrySelectionChanged()));
|
||||
connect(m_model, SIGNAL(usernamesHiddenChanged()), SIGNAL(viewStateChanged()));
|
||||
connect(m_model, SIGNAL(passwordsHiddenChanged()), SIGNAL(viewStateChanged()));
|
||||
|
||||
|
@ -144,13 +144,13 @@ void EntryView::keyPressEvent(QKeyEvent* event)
|
|||
|
||||
void EntryView::focusInEvent(QFocusEvent* event)
|
||||
{
|
||||
emit entrySelectionChanged();
|
||||
emit entrySelectionChanged(currentEntry());
|
||||
QTreeView::focusInEvent(event);
|
||||
}
|
||||
|
||||
void EntryView::focusOutEvent(QFocusEvent* event)
|
||||
{
|
||||
emit entrySelectionChanged();
|
||||
emit entrySelectionChanged(nullptr);
|
||||
QTreeView::focusOutEvent(event);
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ void EntryView::setFirstEntryActive()
|
|||
QModelIndex index = m_sortModel->mapToSource(m_sortModel->index(0, 0));
|
||||
setCurrentEntry(m_model->entryFromIndex(index));
|
||||
} else {
|
||||
emit entrySelectionChanged();
|
||||
emit entrySelectionChanged(currentEntry());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,6 +196,11 @@ void EntryView::emitEntryActivated(const QModelIndex& index)
|
|||
emit entryActivated(entry, static_cast<EntryModel::ModelColumn>(m_sortModel->mapToSource(index).column()));
|
||||
}
|
||||
|
||||
void EntryView::emitEntrySelectionChanged()
|
||||
{
|
||||
emit entrySelectionChanged(currentEntry());
|
||||
}
|
||||
|
||||
void EntryView::setModel(QAbstractItemModel* model)
|
||||
{
|
||||
Q_UNUSED(model);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue