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
PIM Messagelib
Commits
d3b5ffa8
Commit
d3b5ffa8
authored
Jun 02, 2020
by
Laurent Montel
Browse files
Fix save keys. We can't have multi keys
parent
429cdb48
Changes
2
Hide whitespace changes
Inline
Side-by-side
messageviewer/src/dkim-verify/dkimmanagerkey.cpp
View file @
d3b5ffa8
...
...
@@ -56,9 +56,13 @@ QString DKIMManagerKey::keyValue(const QString &selector, const QString &domain)
void
DKIMManagerKey
::
addKey
(
const
KeyInfo
&
key
)
{
if
(
!
mKeys
.
contains
(
key
))
{
mKeys
.
append
(
key
);
const
QVector
<
KeyInfo
>
keys
=
mKeys
;
for
(
const
KeyInfo
&
keyInfo
:
keys
)
{
if
(
keyInfo
.
selector
==
key
.
selector
&&
keyInfo
.
domain
==
key
.
domain
)
{
mKeys
.
removeAll
(
keyInfo
);
}
}
mKeys
.
append
(
key
);
}
void
DKIMManagerKey
::
removeKey
(
const
QString
&
key
)
...
...
@@ -121,5 +125,18 @@ bool KeyInfo::operator ==(const KeyInfo &other) const
{
return
keyValue
==
other
.
keyValue
&&
selector
==
other
.
selector
&&
domain
==
other
.
domain
;
&&
domain
==
other
.
domain
;
}
bool
KeyInfo
::
operator
!=
(
const
KeyInfo
&
other
)
const
{
return
!
(
operator
==
(
other
));
}
QDebug
operator
<<
(
QDebug
d
,
const
KeyInfo
&
t
)
{
d
<<
" keyvalue "
<<
t
.
keyValue
;
d
<<
" selector "
<<
t
.
selector
;
d
<<
" domain "
<<
t
.
domain
;
return
d
;
}
messageviewer/src/dkim-verify/dkimmanagerkey.h
View file @
d3b5ffa8
...
...
@@ -48,6 +48,7 @@ struct MESSAGEVIEWER_EXPORT KeyInfo {
QString
selector
;
QString
domain
;
Q_REQUIRED_RESULT
bool
operator
==
(
const
KeyInfo
&
)
const
;
Q_REQUIRED_RESULT
bool
operator
!=
(
const
KeyInfo
&
)
const
;
};
/**
...
...
@@ -79,4 +80,5 @@ private:
};
}
Q_DECLARE_TYPEINFO
(
MessageViewer
::
KeyInfo
,
Q_MOVABLE_TYPE
);
MESSAGEVIEWER_EXPORT
QDebug
operator
<<
(
QDebug
d
,
const
MessageViewer
::
KeyInfo
&
t
);
#endif // DKIMMANAGERKEY_H
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