mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-27 00:35:27 -04:00
Drop DatabaseWidget::groupView() and entryView().
This commit is contained in:
parent
d874f58a39
commit
9ac01c930d
3 changed files with 8 additions and 20 deletions
|
@ -216,16 +216,6 @@ void DatabaseWidget::emitCurrentModeChanged()
|
||||||
Q_EMIT currentModeChanged(currentMode());
|
Q_EMIT currentModeChanged(currentMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupView* DatabaseWidget::groupView()
|
|
||||||
{
|
|
||||||
return m_groupView;
|
|
||||||
}
|
|
||||||
|
|
||||||
EntryView* DatabaseWidget::entryView()
|
|
||||||
{
|
|
||||||
return m_entryView;
|
|
||||||
}
|
|
||||||
|
|
||||||
Database* DatabaseWidget::database()
|
Database* DatabaseWidget::database()
|
||||||
{
|
{
|
||||||
return m_db;
|
return m_db;
|
||||||
|
|
|
@ -60,8 +60,6 @@ public:
|
||||||
|
|
||||||
explicit DatabaseWidget(Database* db, QWidget* parent = Q_NULLPTR);
|
explicit DatabaseWidget(Database* db, QWidget* parent = Q_NULLPTR);
|
||||||
~DatabaseWidget();
|
~DatabaseWidget();
|
||||||
GroupView* groupView();
|
|
||||||
EntryView* entryView();
|
|
||||||
Database* database();
|
Database* database();
|
||||||
bool dbHasKey() const;
|
bool dbHasKey() const;
|
||||||
bool canDeleteCurrentGroup() const;
|
bool canDeleteCurrentGroup() const;
|
||||||
|
|
|
@ -83,7 +83,7 @@ void TestGui::testTabs()
|
||||||
|
|
||||||
void TestGui::testEditEntry()
|
void TestGui::testEditEntry()
|
||||||
{
|
{
|
||||||
EntryView* entryView = m_dbWidget->entryView();
|
EntryView* entryView = m_dbWidget->findChild<EntryView*>("entryView");
|
||||||
QModelIndex item = entryView->model()->index(0, 1);
|
QModelIndex item = entryView->model()->index(0, 1);
|
||||||
QRect itemRect = entryView->visualRect(item);
|
QRect itemRect = entryView->visualRect(item);
|
||||||
QTest::mouseClick(entryView->viewport(), Qt::LeftButton, Qt::NoModifier, itemRect.center());
|
QTest::mouseClick(entryView->viewport(), Qt::LeftButton, Qt::NoModifier, itemRect.center());
|
||||||
|
@ -237,8 +237,8 @@ void TestGui::testSearch()
|
||||||
|
|
||||||
void TestGui::testDeleteEntry()
|
void TestGui::testDeleteEntry()
|
||||||
{
|
{
|
||||||
GroupView* groupView = m_dbWidget->groupView();
|
GroupView* groupView = m_dbWidget->findChild<GroupView*>("groupView");
|
||||||
EntryView* entryView = m_dbWidget->entryView();
|
EntryView* entryView = m_dbWidget->findChild<EntryView*>("entryView");
|
||||||
QToolBar* toolBar = m_mainWindow->findChild<QToolBar*>("toolBar");
|
QToolBar* toolBar = m_mainWindow->findChild<QToolBar*>("toolBar");
|
||||||
QAction* entryDeleteAction = m_mainWindow->findChild<QAction*>("actionEntryDelete");
|
QAction* entryDeleteAction = m_mainWindow->findChild<QAction*>("actionEntryDelete");
|
||||||
QWidget* entryDeleteWidget = toolBar->widgetForAction(entryDeleteAction);
|
QWidget* entryDeleteWidget = toolBar->widgetForAction(entryDeleteAction);
|
||||||
|
@ -274,7 +274,7 @@ void TestGui::testDeleteEntry()
|
||||||
|
|
||||||
void TestGui::testCloneEntry()
|
void TestGui::testCloneEntry()
|
||||||
{
|
{
|
||||||
EntryView* entryView = m_dbWidget->entryView();
|
EntryView* entryView = m_dbWidget->findChild<EntryView*>("entryView");
|
||||||
|
|
||||||
QCOMPARE(entryView->model()->rowCount(), 1);
|
QCOMPARE(entryView->model()->rowCount(), 1);
|
||||||
|
|
||||||
|
@ -292,8 +292,8 @@ void TestGui::testCloneEntry()
|
||||||
|
|
||||||
void TestGui::testDragAndDropEntry()
|
void TestGui::testDragAndDropEntry()
|
||||||
{
|
{
|
||||||
EntryView* entryView = m_dbWidget->entryView();
|
EntryView* entryView = m_dbWidget->findChild<EntryView*>("entryView");
|
||||||
GroupView* groupView = m_dbWidget->groupView();
|
GroupView* groupView = m_dbWidget->findChild<GroupView*>("groupView");
|
||||||
QAbstractItemModel* groupModel = groupView->model();
|
QAbstractItemModel* groupModel = groupView->model();
|
||||||
|
|
||||||
QModelIndex sourceIndex = entryView->model()->index(0, 1);
|
QModelIndex sourceIndex = entryView->model()->index(0, 1);
|
||||||
|
@ -314,7 +314,7 @@ void TestGui::testDragAndDropEntry()
|
||||||
|
|
||||||
void TestGui::testDragAndDropGroup()
|
void TestGui::testDragAndDropGroup()
|
||||||
{
|
{
|
||||||
QAbstractItemModel* groupModel = m_dbWidget->groupView()->model();
|
QAbstractItemModel* groupModel = m_dbWidget->findChild<GroupView*>("groupView")->model();
|
||||||
QModelIndex rootIndex = groupModel->index(0, 0);
|
QModelIndex rootIndex = groupModel->index(0, 0);
|
||||||
|
|
||||||
dragAndDropGroup(groupModel->index(0, 0, rootIndex),
|
dragAndDropGroup(groupModel->index(0, 0, rootIndex),
|
||||||
|
@ -453,7 +453,7 @@ void TestGui::dragAndDropGroup(const QModelIndex& sourceIndex, const QModelIndex
|
||||||
QVERIFY(sourceIndex.isValid());
|
QVERIFY(sourceIndex.isValid());
|
||||||
QVERIFY(targetIndex.isValid());
|
QVERIFY(targetIndex.isValid());
|
||||||
|
|
||||||
GroupModel* groupModel = qobject_cast<GroupModel*>(m_dbWidget->groupView()->model());
|
GroupModel* groupModel = qobject_cast<GroupModel*>(m_dbWidget->findChild<GroupView*>("groupView")->model());
|
||||||
|
|
||||||
QMimeData mimeData;
|
QMimeData mimeData;
|
||||||
QByteArray encoded;
|
QByteArray encoded;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue