Commit 79714d7a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Implement remove filter

parent 907b1dc9
Pipeline #63301 passed with stage
in 39 minutes and 59 seconds
...@@ -33,16 +33,19 @@ void ConfigureFiltersWidget::init() ...@@ -33,16 +33,19 @@ void ConfigureFiltersWidget::init()
{ {
const QVector<FilterSavedManager::FilterInfo> lstFilters = FilterSavedManager::self()->filterInfos(); const QVector<FilterSavedManager::FilterInfo> lstFilters = FilterSavedManager::self()->filterInfos();
for (const auto &filter : lstFilters) { for (const auto &filter : lstFilters) {
mListFiltersWidget->addItem(filter.filterName); auto item = new FilterListWidgetItem(mListFiltersWidget);
item->setText(filter.filterName);
item->setIdentifier(filter.identifier);
mListFiltersWidget->addItem(item);
} }
} }
void ConfigureFiltersWidget::slotCustomContextMenuRequested(const QPoint &pos) void ConfigureFiltersWidget::slotCustomContextMenuRequested(const QPoint &pos)
{ {
auto item = mListFiltersWidget->itemAt(pos); auto item = static_cast<FilterListWidgetItem *>(mListFiltersWidget->itemAt(pos));
if (item) { if (item) {
QMenu menu(this); QMenu menu(this);
QString identifier; const QString identifier = item->identifier();
menu.addAction(i18n("Remove"), this, [this, identifier]() { menu.addAction(i18n("Remove"), this, [this, identifier]() {
removeFilterInfo(identifier); removeFilterInfo(identifier);
}); });
......
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