diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 12:11:49 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-03-21 12:11:49 +0100 |
commit | 0c91d01eb26793e745138c4598cf15d9a21c0136 (patch) | |
tree | 53ffeb02eaf1625598e937444430e4040e17b0a4 /framework/domain/peoplemodel.cpp | |
parent | ed09c7689f7435761611cbfd3cda98bbd79c3a5e (diff) | |
download | kube-0c91d01eb26793e745138c4598cf15d9a21c0136.tar.gz kube-0c91d01eb26793e745138c4598cf15d9a21c0136.zip |
Filtering for maillistmodel and peoplemodel
Works surprisingly well and is very useful for testing.
The searchbar in the maillistmodel is a temporary solution as the global
searchbar has some usability issues. E.g. how do we reset the search?
As an intermediate step we could just hide the searchbar and make it
visible by clicking on the search button.
Diffstat (limited to 'framework/domain/peoplemodel.cpp')
-rw-r--r-- | framework/domain/peoplemodel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/framework/domain/peoplemodel.cpp b/framework/domain/peoplemodel.cpp index d33c6703..ef2cc9a0 100644 --- a/framework/domain/peoplemodel.cpp +++ b/framework/domain/peoplemodel.cpp | |||
@@ -29,6 +29,7 @@ PeopleModel::PeopleModel(QObject *parent) | |||
29 | 29 | ||
30 | setDynamicSortFilter(true); | 30 | setDynamicSortFilter(true); |
31 | sort(0, Qt::DescendingOrder); | 31 | sort(0, Qt::DescendingOrder); |
32 | setFilterCaseSensitivity(Qt::CaseInsensitive); | ||
32 | Sink::Query query; | 33 | Sink::Query query; |
33 | query.setFlags(Sink::Query::LiveQuery); | 34 | query.setFlags(Sink::Query::LiveQuery); |
34 | query.request<Contact::Fn>(); | 35 | query.request<Contact::Fn>(); |
@@ -43,6 +44,16 @@ PeopleModel::~PeopleModel() | |||
43 | 44 | ||
44 | } | 45 | } |
45 | 46 | ||
47 | void PeopleModel::setFilter(const QString &filter) | ||
48 | { | ||
49 | setFilterWildcard(filter); | ||
50 | } | ||
51 | |||
52 | QString PeopleModel::filter() const | ||
53 | { | ||
54 | return {}; | ||
55 | } | ||
56 | |||
46 | QHash< int, QByteArray > PeopleModel::roleNames() const | 57 | QHash< int, QByteArray > PeopleModel::roleNames() const |
47 | { | 58 | { |
48 | static QHash<int, QByteArray> roles = { | 59 | static QHash<int, QByteArray> roles = { |