summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/filtermodels.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/qt-ui/filtermodels.cpp b/qt-ui/filtermodels.cpp
index 8c67ca2b3..557460b3e 100644
--- a/qt-ui/filtermodels.cpp
+++ b/qt-ui/filtermodels.cpp
@@ -57,6 +57,16 @@ CREATE_CLEAR_FILTER_METHOD(LocationFilterModel);
#undef CREATE_CLEAR_FILTER_METHOD
+#define CREATE_FLAGS_METHOD( CLASS ) \
+Qt::ItemFlags CLASS::flags(const QModelIndex &index) const \
+{ \
+ return QStringListModel::flags(index) | Qt::ItemIsUserCheckable; \
+}
+
+CREATE_FLAGS_METHOD(TagFilterModel);
+CREATE_FLAGS_METHOD(BuddyFilterModel);
+CREATE_FLAGS_METHOD(LocationFilterModel);
+
TagFilterModel::TagFilterModel(QObject *parent) : QStringListModel(parent)
{
}
@@ -73,11 +83,6 @@ QVariant TagFilterModel::data(const QModelIndex &index, int role) const
return QVariant();
}
-Qt::ItemFlags TagFilterModel::flags(const QModelIndex &index) const
-{
- return QStringListModel::flags(index) | Qt::ItemIsUserCheckable;
-}
-
void TagFilterModel::repopulate()
{
if (g_tag_list == NULL)
@@ -208,11 +213,6 @@ bool BuddyFilterModel::filterRow(int source_row, const QModelIndex &source_paren
return doFilter(d, index0, sourceModel);
}
-Qt::ItemFlags BuddyFilterModel::flags(const QModelIndex &index) const
-{
- return QStringListModel::flags(index) | Qt::ItemIsUserCheckable;
-}
-
void BuddyFilterModel::repopulate()
{
QStringList list;
@@ -317,11 +317,6 @@ bool LocationFilterModel::filterRow(int source_row, const QModelIndex &source_pa
return doFilter(d, index0, sourceModel);
}
-Qt::ItemFlags LocationFilterModel::flags(const QModelIndex &index) const
-{
- return QStringListModel::flags(index) | Qt::ItemIsUserCheckable;
-}
-
void LocationFilterModel::repopulate()
{
QStringList list;