From 36fa27050c749717e186c8564d88b11bd53a96c8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 16 Dec 2018 20:43:01 +0100 Subject: Filter: update filterData directly without copying In FilterWidget2::updateFilter() a new FilterData object is generated and then copied onto the filterData member variable. Instead, modify filterData directly. This seems also more logical from a semantic point of view: Do we want to reset fields that were not set by the user? Contains trivial whitespace fix. Signed-off-by: Berthold Stoeger --- qt-models/filtermodels.cpp | 2 +- qt-models/filtermodels.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index 8609243b2..719467fd2 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -228,7 +228,7 @@ bool MultiFilterSortModel::lessThan(const QModelIndex &i1, const QModelIndex &i2 return DiveTripModelBase::instance()->lessThan(i1, i2); } -void MultiFilterSortModel::filterDataChanged(const FilterData& data) +void MultiFilterSortModel::filterDataChanged(const FilterData &data) { filterData = data; myInvalidate(); diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index b16ce4a3b..5cb130522 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -51,7 +51,7 @@ slots: void stopFilterDiveSite(); void filterChanged(const QModelIndex &from, const QModelIndex &to, const QVector &roles); void resetModel(DiveTripModelBase::Layout layout); - void filterDataChanged(const FilterData& data); + void filterDataChanged(const FilterData &data); signals: void filterFinished(); -- cgit v1.2.3-70-g09d2