From 8e44ab2338f4ca63d58de4b3329c384df9d6c053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 19 Mar 2018 02:36:12 +0100 Subject: NOISSUE redo new instance dialog --- application/VersionProxyModel.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'application/VersionProxyModel.h') diff --git a/application/VersionProxyModel.h b/application/VersionProxyModel.h index 4441ea6b..33a0d1ea 100644 --- a/application/VersionProxyModel.h +++ b/application/VersionProxyModel.h @@ -2,17 +2,15 @@ #include #include "BaseVersionList.h" +#include + class VersionFilterModel; class VersionProxyModel: public QAbstractProxyModel { Q_OBJECT public: - struct Filter - { - QString string; - bool exact = false; - }; + enum Column { Name, @@ -22,7 +20,7 @@ public: Architecture, Path }; - typedef QHash FilterMap; + typedef QHash> FilterMap; public: VersionProxyModel ( QObject* parent = 0 ); @@ -39,16 +37,23 @@ public: virtual void setSourceModel(QAbstractItemModel *sourceModel) override; const FilterMap &filters() const; - void setFilter(const BaseVersionList::ModelRoles column, const QString &filter, const bool exact); + void setFilter(const BaseVersionList::ModelRoles column, Filter * filter); void clearFilters(); QModelIndex getRecommended() const; QModelIndex getVersion(const QString & version) const; private slots: void sourceDataChanged(const QModelIndex &source_top_left,const QModelIndex &source_bottom_right); + void sourceAboutToBeReset(); void sourceReset(); + void sourceRowsAboutToBeInserted(const QModelIndex &parent, int first, int last); + void sourceRowsInserted(const QModelIndex &parent, int first, int last); + + void sourceRowsAboutToBeRemoved(const QModelIndex &parent, int first, int last); + void sourceRowsRemoved(const QModelIndex &parent, int first, int last); + private: QList m_columns; FilterMap m_filters; -- cgit v1.2.3