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

Improve version label if manufacturer is unknown

parent ea01aa5c
Pipeline #30432 passed with stage
in 12 minutes and 41 seconds
......@@ -230,9 +230,12 @@ void PGPCardWidget::setCard(const OpenPGPCard *card)
const QString version = QString::fromStdString(card->cardVersion());
mIs21 = versionIsAtLeast("2.1", card->cardVersion().c_str());
mVersionLabel->setText(i18nc("First placeholder is manufacturer, second placeholder is a version number",
"%1 OpenPGP v%2 card", QString::fromStdString(card->manufacturer()),
version));
const QString manufacturer = QString::fromStdString(card->manufacturer());
const bool manufacturerIsUnknown = manufacturer.isEmpty() || manufacturer == QLatin1String("unknown");
mVersionLabel->setText(manufacturerIsUnknown ?
i18nc("Placeholder is a version number", "Unknown OpenPGP v%2 card", version) :
i18nc("First placeholder is manufacturer, second placeholder is a version number",
"%1 OpenPGP v%2 card", manufacturer, version));
const QString sn = QString::fromStdString(card->serialNumber()).mid(16, 12);
mSerialNumber->setText(sn);
mRealSerial = card->serialNumber();
......
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