Commit fc686c0c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Merge remote-tracking branch 'origin/release/20.04'

parents 5e64eba7 d3b5ffa8
Pipeline #22248 passed with stage
in 33 minutes and 10 seconds
......@@ -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;
}
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment