mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-10-22 02:15:58 -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
|
@ -875,18 +875,28 @@ void TestGui::testSearch()
|
|||
QTRY_COMPARE(entryView->model()->rowCount(), 2);
|
||||
|
||||
// Test group search
|
||||
searchWidget->setLimitGroup(false);
|
||||
GroupView* groupView = m_dbWidget->findChild<GroupView*>("groupView");
|
||||
QCOMPARE(groupView->currentGroup(), m_db->rootGroup());
|
||||
QModelIndex rootGroupIndex = groupView->model()->index(0, 0);
|
||||
clickIndex(groupView->model()->index(0, 0, rootGroupIndex), groupView, Qt::LeftButton);
|
||||
QCOMPARE(groupView->currentGroup()->name(), QString("General"));
|
||||
|
||||
searchWidget->setLimitGroup(false);
|
||||
// Selecting a group should cancel search
|
||||
QTRY_COMPARE(entryView->model()->rowCount(), 0);
|
||||
// Restore search
|
||||
QTest::keyClick(m_mainWindow.data(), Qt::Key_F, Qt::ControlModifier);
|
||||
QTest::keyClicks(searchTextEdit, "someTHING");
|
||||
QTRY_COMPARE(entryView->model()->rowCount(), 2);
|
||||
// Enable group limiting
|
||||
searchWidget->setLimitGroup(true);
|
||||
QTRY_COMPARE(entryView->model()->rowCount(), 0);
|
||||
// Selecting another group should NOT cancel search
|
||||
clickIndex(rootGroupIndex, groupView, Qt::LeftButton);
|
||||
QCOMPARE(groupView->currentGroup(), m_db->rootGroup());
|
||||
QTRY_COMPARE(entryView->model()->rowCount(), 2);
|
||||
|
||||
// reset
|
||||
searchWidget->setLimitGroup(false);
|
||||
clickIndex(rootGroupIndex, groupView, Qt::LeftButton);
|
||||
QCOMPARE(groupView->currentGroup(), m_db->rootGroup());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue