mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-11 03:21:29 +00:00
A bit of code cleanup.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1841eb98b9
commit
819d358f8c
3 changed files with 7 additions and 10 deletions
|
@ -2253,7 +2253,7 @@ int LanguageModel::rowCount(const QModelIndex &parent) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TagFilterModel::TagFilterModel(QObject *parent) : QStringListModel(parent), checkState(NULL)
|
TagFilterModel::TagFilterModel(QObject *parent) : QStringListModel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2366,7 +2366,7 @@ bool TagFilterModel::filterRow(int source_row, const QModelIndex &source_parent,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuddyFilterModel::BuddyFilterModel(QObject *parent) : QStringListModel(parent), checkState(NULL)
|
BuddyFilterModel::BuddyFilterModel(QObject *parent) : QStringListModel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2482,7 +2482,7 @@ bool BuddyFilterModel::setData(const QModelIndex &index, const QVariant &value,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LocationFilterModel::LocationFilterModel(QObject *parent) : QStringListModel(parent), checkState(NULL)
|
LocationFilterModel::LocationFilterModel(QObject *parent) : QStringListModel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -440,7 +440,10 @@ private:
|
||||||
|
|
||||||
class MultiFilterInterface {
|
class MultiFilterInterface {
|
||||||
public:
|
public:
|
||||||
|
MultiFilterInterface() : checkState(NULL){};
|
||||||
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const = 0;
|
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const = 0;
|
||||||
|
bool *checkState;
|
||||||
|
bool anyChecked;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TagFilterModel : public QStringListModel, public MultiFilterInterface{
|
class TagFilterModel : public QStringListModel, public MultiFilterInterface{
|
||||||
|
@ -451,8 +454,6 @@ public:
|
||||||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
||||||
bool *checkState;
|
|
||||||
bool anyChecked;
|
|
||||||
public
|
public
|
||||||
slots:
|
slots:
|
||||||
void repopulate();
|
void repopulate();
|
||||||
|
@ -469,8 +470,6 @@ public:
|
||||||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
||||||
bool *checkState;
|
|
||||||
bool anyChecked;
|
|
||||||
public
|
public
|
||||||
slots:
|
slots:
|
||||||
void repopulate();
|
void repopulate();
|
||||||
|
@ -487,8 +486,6 @@ public:
|
||||||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||||
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
||||||
bool *checkState;
|
|
||||||
bool anyChecked;
|
|
||||||
public
|
public
|
||||||
slots:
|
slots:
|
||||||
void repopulate();
|
void repopulate();
|
||||||
|
|
|
@ -569,7 +569,7 @@ MultiFilter::MultiFilter(QWidget *parent) : QScrollArea(parent)
|
||||||
tb->addWidget(closeBtn);
|
tb->addWidget(closeBtn);
|
||||||
|
|
||||||
connect(closeBtn, SIGNAL(clicked(bool)), this, SLOT(hide()));
|
connect(closeBtn, SIGNAL(clicked(bool)), this, SLOT(hide()));
|
||||||
|
connect(clearBtn, SIGNAL(clicked(bool)), MultiFilterSortModel::instance(), SLOT(clearFilter()));
|
||||||
l->addWidget(tb);
|
l->addWidget(tb);
|
||||||
l->addWidget(tagFilter);
|
l->addWidget(tagFilter);
|
||||||
l->addWidget(new BuddyFilter());
|
l->addWidget(new BuddyFilter());
|
||||||
|
|
Loading…
Reference in a new issue