Commit d4a00d22 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to search plugins

parent 3c36a6d0
Pipeline #87739 passed with stage
in 10 minutes and 33 seconds
......@@ -143,6 +143,7 @@ target_link_libraries(KF5PimCommon
Qt::PrintSupport
KF5::Purpose
KF5::PurposeWidgets
KF5::ItemViews
)
......
......@@ -9,4 +9,4 @@ add_executable( configurepluginslistwidgettest configurepluginslistwidgettest.cp
add_test(NAME configurepluginslistwidgettest COMMAND configurepluginslistwidgettest )
ecm_mark_as_test(kmail-configurepluginslistwidgettest)
target_link_libraries( configurepluginslistwidgettest Qt::Test KF5::I18n Qt::Widgets
KF5::ConfigCore KF5::TextWidgets KF5::WidgetsAddons KF5::PimCommon)
KF5::ConfigCore KF5::TextWidgets KF5::WidgetsAddons KF5::PimCommon KF5::ItemViews)
......@@ -6,6 +6,7 @@
#include "configurepluginslistwidgettest.h"
#include "../configurepluginslistwidget.h"
#include <KTreeWidgetSearchLineWidget>
#include <QTest>
#include <QTreeWidget>
#include <QVBoxLayout>
......@@ -30,6 +31,9 @@ void ConfigurePluginsListWidgetTest::shouldHaveDefaultValue()
auto mListWidget = w.findChild<QTreeWidget *>(QStringLiteral("listwidget"));
QVERIFY(mListWidget);
QVERIFY(mListWidget->isSortingEnabled());
auto mTreeWidgetSearchLineEdit = w.findChild<KTreeWidgetSearchLineWidget *>(QStringLiteral("mTreeWidgetSearchLineEdit"));
QVERIFY(mTreeWidgetSearchLineEdit);
}
QTEST_MAIN(ConfigurePluginsListWidgetTest)
......@@ -8,6 +8,7 @@
#include <KLocalizedString>
#include <KSharedConfig>
#include <KTreeWidgetSearchLineWidget>
#include <QAction>
#include <QHeaderView>
......@@ -33,9 +34,13 @@ ConfigurePluginsListWidget::ConfigurePluginsListWidget(QWidget *parent)
mListWidget->setColumnCount(2);
mListWidget->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
mTreeWidgetSearchLineEdit = new KTreeWidgetSearchLineWidget(this, mListWidget);
mTreeWidgetSearchLineEdit->setObjectName(QStringLiteral("mTreeWidgetSearchLineEdit"));
connect(mListWidget, &QTreeWidget::itemSelectionChanged, this, &ConfigurePluginsListWidget::slotItemSelectionChanged);
connect(mListWidget, &QTreeWidget::itemChanged, this, &ConfigurePluginsListWidget::slotItemChanged);
mainLayout->addWidget(mTreeWidgetSearchLineEdit);
mainLayout->addWidget(mListWidget);
}
......
......@@ -13,6 +13,7 @@
#include <QTreeWidgetItem>
class QTreeWidget;
class QAction;
class KTreeWidgetSearchLineWidget;
namespace PimCommon
{
/**
......@@ -70,6 +71,7 @@ protected:
QTreeWidget *mListWidget = nullptr;
private:
KTreeWidgetSearchLineWidget *mTreeWidgetSearchLineEdit = nullptr;
void slotConfigureClicked(QAction *act);
bool mInitializeDone = false;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment