Cleanup: remove global DiveLocationLineEdit variable

DiveLocationLineEdit stored a pointer to itself in a global variable
so that the DiveLocationModel can access it to access the filter text.

Instead, on change simply pass the filter text down from DiveLocationLineEdit
to DiveLocationModel.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-04-15 20:15:40 +02:00 committed by Dirk Hohndel
parent 15b2dbede4
commit f09177e872
2 changed files with 15 additions and 11 deletions

View file

@ -45,10 +45,12 @@ private:
class DiveLocationFilterProxyModel : public QSortFilterProxyModel {
Q_OBJECT
QString filter;
public:
DiveLocationFilterProxyModel(QObject *parent = 0);
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
bool lessThan(const QModelIndex& source_left, const QModelIndex& source_right) const override;
void setFilter(const QString &filter);
};
class DiveLocationModel : public QAbstractTableModel {