mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Filter: move calculation of shown dives to undo command
The filter-model was catching dives-added / dives-deleted signals from the models to keep track of the number of shown dives. To simplify the data flow, do this directly in the undo-command. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2d09819ddf
commit
6d6d10f03a
5 changed files with 23 additions and 23 deletions
|
@ -111,9 +111,6 @@ MultiFilterSortModel::MultiFilterSortModel(QObject *parent) : QSortFilterProxyMo
|
|||
{
|
||||
setFilterKeyColumn(-1); // filter all columns
|
||||
setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
connect(&diveListNotifier, &DiveListNotifier::divesAdded, this, &MultiFilterSortModel::divesAdded);
|
||||
connect(&diveListNotifier, &DiveListNotifier::divesDeleted, this, &MultiFilterSortModel::divesDeleted);
|
||||
}
|
||||
|
||||
void MultiFilterSortModel::resetModel(DiveTripModelBase::Layout layout)
|
||||
|
@ -343,24 +340,6 @@ void MultiFilterSortModel::filterDataChanged(const FilterData &data)
|
|||
myInvalidate();
|
||||
}
|
||||
|
||||
void MultiFilterSortModel::divesAdded(dive_trip *, bool, const QVector<dive *> &dives)
|
||||
{
|
||||
for (dive *d: dives) {
|
||||
if (!d->hidden_by_filter)
|
||||
++shown_dives;
|
||||
}
|
||||
countsChanged();
|
||||
}
|
||||
|
||||
void MultiFilterSortModel::divesDeleted(dive_trip *, bool, const QVector<dive *> &dives)
|
||||
{
|
||||
for (dive *d: dives) {
|
||||
if (!d->hidden_by_filter)
|
||||
--shown_dives;
|
||||
}
|
||||
countsChanged();
|
||||
}
|
||||
|
||||
void MultiFilterSortModel::countsChanged()
|
||||
{
|
||||
updateWindowTitle();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue