summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-04-12 15:31:11 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit5aacd73a00bac5721674b1f8b223d3aacc862a4c (patch)
tree81e99850a8cb23500831ccade3335bac503056b8 /qt-models
parent858d3e2eed188b609090b20ecaba2f779aedb6eb (diff)
downloadsubsurface-5aacd73a00bac5721674b1f8b223d3aacc862a4c.tar.gz
Filter: call update title directly in filter model
Instead of sending a signal when counts change, catching them in the filter widget and update the window title there, directly update the window title in the model. This removes a signal/slot pair. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/filtermodels.cpp10
-rw-r--r--qt-models/filtermodels.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index a0c910244..94b74d92d 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -241,6 +241,7 @@ void MultiFilterSortModel::myInvalidate()
// Tell the dive trip model to update the displayed-counts
DiveTripModelBase::instance()->filterFinished();
+ countsChanged();
emit filterFinished();
#if !defined(SUBSURFACE_MOBILE)
@@ -296,7 +297,7 @@ void MultiFilterSortModel::divesAdded(dive_trip *, bool, const QVector<dive *> &
if (!d->hidden_by_filter)
++divesDisplayed;
}
- emit countsChanged();
+ countsChanged();
}
void MultiFilterSortModel::divesDeleted(dive_trip *, bool, const QVector<dive *> &dives)
@@ -305,5 +306,10 @@ void MultiFilterSortModel::divesDeleted(dive_trip *, bool, const QVector<dive *>
if (!d->hidden_by_filter)
--divesDisplayed;
}
- emit countsChanged();
+ countsChanged();
+}
+
+void MultiFilterSortModel::countsChanged()
+{
+ updateWindowTitle();
}
diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h
index 6513788f2..45e1e7189 100644
--- a/qt-models/filtermodels.h
+++ b/qt-models/filtermodels.h
@@ -77,11 +77,11 @@ slots:
signals:
void filterFinished();
- void countsChanged();
private:
MultiFilterSortModel(QObject *parent = 0);
struct dive_site *curr_dive_site;
+ void countsChanged();
FilterData filterData;
};