From 2c924b6834d7c032cfec5d6205447333780124e0 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 31 Oct 2014 16:20:43 -0200 Subject: [PATCH] Added the skeleton for the BuddyFilter Just the skeleton of the functions, nothing working yet. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 36 ++++++++++++++++++++++++++++++++++++ qt-ui/models.h | 19 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index e4df20504..2e78f1b43 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -2351,6 +2351,42 @@ bool TagFilterModel::filterRow(int source_row, const QModelIndex &source_parent, return false; } +BuddyFilterModel::BuddyFilterModel(QObject *parent) +{ + +} + +BuddyFilterModel *BuddyFilterModel::instance() +{ + +} + +bool BuddyFilterModel::filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const +{ + +} + +Qt::ItemFlags BuddyFilterModel::flags(const QModelIndex &index) const +{ + return QStringListModel::flags(index); +} + +void BuddyFilterModel::repopulate() +{ + +} + +QVariant BuddyFilterModel::data(const QModelIndex &index, int role) const +{ + return QStringListModel::data(index, role); +} + + +bool BuddyFilterModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + return QStringListModel::setData(index, value, role); +} + MultiFilterSortModel *MultiFilterSortModel::instance() { static MultiFilterSortModel *self = new MultiFilterSortModel(); diff --git a/qt-ui/models.h b/qt-ui/models.h index 032edc58f..fb92d2702 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -443,6 +443,25 @@ private: explicit TagFilterModel(QObject *parent = 0); }; +class BuddyFilterModel : public QStringListModel, public MultiFilterInterface{ + Q_OBJECT +public: + static BuddyFilterModel *instance(); + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + virtual Qt::ItemFlags flags(const QModelIndex &index) const; + virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const; + bool *checkState; + bool anyChecked; +public +slots: + void repopulate(); + +private: + explicit BuddyFilterModel(QObject *parent = 0); +}; + + class MultiFilterSortModel : public QSortFilterProxyModel { Q_OBJECT public: