From cc0c4ab2f16612a145064887614e3f86fe125209 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 16 Dec 2018 20:33:37 +0100 Subject: [PATCH] Filter: connect widget and filter In the latest version of the new filter-widget the connection between widget and filter was lost. Connect both - but use a simple function call instead of a signal, since it is not immediately obivous where the connection should be made. Signed-off-by: Berthold Stoeger --- desktop-widgets/filterwidget2.cpp | 11 ++++++++--- desktop-widgets/filterwidget2.h | 6 +----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp index b2f74d742..fdf2bb843 100644 --- a/desktop-widgets/filterwidget2.cpp +++ b/desktop-widgets/filterwidget2.cpp @@ -97,7 +97,7 @@ void FilterWidget2::updateFilter() data.planned = ui->planned->isChecked(); filterData = data; - emit filterDataChanged(data); + filterDataChanged(data); } void FilterWidget2::updateLogged(int value) { @@ -116,12 +116,17 @@ void FilterWidget2::updatePlanned(int value) { void FilterWidget2::showEvent(QShowEvent *event) { QWidget::showEvent(event); - emit filterDataChanged(filterData); + filterDataChanged(filterData); } void FilterWidget2::hideEvent(QHideEvent *event) { QWidget::hideEvent(event); FilterData data; - emit filterDataChanged(data); + filterDataChanged(data); +} + +void FilterWidget2::filterDataChanged(const FilterData &data) +{ + MultiFilterSortModel::instance()->filterDataChanged(data); } diff --git a/desktop-widgets/filterwidget2.h b/desktop-widgets/filterwidget2.h index fba012095..36f818500 100644 --- a/desktop-widgets/filterwidget2.h +++ b/desktop-widgets/filterwidget2.h @@ -24,17 +24,13 @@ protected: void hideEvent(QHideEvent *event) override; void showEvent(QShowEvent *event) override; -signals: - void filterDataChanged(const FilterData& data); - public slots: void updatePlanned(int value); void updateLogged(int value); - - private: std::unique_ptr ui; + void filterDataChanged(const FilterData &data); FilterData filterData; };