Commit 2f5f4470 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Add accessibleExpirationDate overload for signatures

GnuPG-bug-id: 6102
parent 95ff877d
Pipeline #210318 passed with stage
in 1 minute and 26 seconds
......@@ -623,6 +623,15 @@ QString Formatting::accessibleExpirationDate(const Subkey &subkey, const QString
}
}
QString Formatting::accessibleExpirationDate(const UserID::Signature &sig, const QString &noExpiration)
{
if (sig.neverExpires()) {
return noExpiration.isEmpty() ? i18n("no expiration") : noExpiration;
} else {
return accessibleDate(expirationDate(sig));
}
}
QString Formatting::creationDateString(const Key &key)
{
return dateString(creation_date(key.subkey(0)));
......
......@@ -99,6 +99,12 @@ KLEO_EXPORT QString accessibleExpirationDate(const GpgME::Key &key, const QStrin
* returns the localization of "no expiration".
*/
KLEO_EXPORT QString accessibleExpirationDate(const GpgME::Subkey &subkey, const QString &noExpiration = {});
/**
* Returns expiration date of @p sig as string suitable for screen readers.
* If the signature doesn't expire, then it returns @p noExpiration if @p noExpiration is not empty. Otherwise,
* returns the localization of "no expiration".
*/
KLEO_EXPORT QString accessibleExpirationDate(const GpgME::UserID::Signature &sig, const QString &noExpiration = {});
KLEO_EXPORT QString creationDateString(const GpgME::Key &key);
KLEO_EXPORT QString creationDateString(const GpgME::Subkey &subkey);
......
Supports Markdown
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