Commit 03b1edfa authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

convert string to enum

parent aadcb73b
......@@ -189,6 +189,16 @@ QString MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(Message
MessageViewer::DKIMCheckSignatureJob::AuthenticationMethod MessageViewer::DKIMUtil::convertAuthenticationMethodToString(const QString &str)
{
//TODO
return {};
if (str == QLatin1String("dkim")) {
return MessageViewer::DKIMCheckSignatureJob::AuthenticationMethod::Dkim;
} else if (str == QLatin1String("spf")) {
return MessageViewer::DKIMCheckSignatureJob::AuthenticationMethod::Spf;
} else if (str == QLatin1String("dmarc")) {
return MessageViewer::DKIMCheckSignatureJob::AuthenticationMethod::Dmarc;
} else if (str == QLatin1String("dkim-atps")) {
return MessageViewer::DKIMCheckSignatureJob::AuthenticationMethod::Dkimatps;
} else {
qCWarning(MESSAGEVIEWER_DKIMCHECKER_LOG) << "Undefined type " << str;
return MessageViewer::DKIMCheckSignatureJob::AuthenticationMethod::Unknown;
}
}
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