Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
libkleo
Commits
e72bcabf
Commit
e72bcabf
authored
Apr 13, 2021
by
Ingo Klöcker
Browse files
Allow retrieval of match contexts from key filter model
GnuPG-bug-id: 5388
parent
2cc77323
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/kleo/keyfilter.h
View file @
e72bcabf
...
...
@@ -94,3 +94,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(KeyFilter::MatchContexts)
}
#include
<QObject>
Q_DECLARE_METATYPE
(
Kleo
::
KeyFilter
::
MatchContexts
)
src/kleo/keyfiltermanager.cpp
View file @
e72bcabf
...
...
@@ -333,9 +333,12 @@ QVariant Model::data(const QModelIndex &idx, int role) const
case
Qt
::
ToolTipRole
:
/* Most useless tooltip ever. */
return
filter
->
name
();
case
Qt
::
User
Role
:
case
KeyFilterManager
::
FilterId
Role
:
return
filter
->
id
();
case
KeyFilterManager
::
FilterMatchContextsRole
:
return
QVariant
::
fromValue
(
filter
->
availableMatchContexts
());
default:
return
QVariant
();
}
...
...
src/kleo/keyfiltermanager.h
View file @
e72bcabf
...
...
@@ -34,6 +34,12 @@ namespace Kleo
class
KLEO_EXPORT
KeyFilterManager
:
public
QObject
{
Q_OBJECT
public:
enum
ModelRoles
{
FilterIdRole
=
Qt
::
UserRole
,
FilterMatchContextsRole
,
};
protected:
explicit
KeyFilterManager
(
QObject
*
parent
=
nullptr
);
~
KeyFilterManager
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment