Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 619d31a4 authored by Allen Winter's avatar Allen Winter

src/aboutdata.cpp, src/view/pgpcardwidget.cpp - minor optimization

minor code formatting
parent 33386fd9
......@@ -92,7 +92,7 @@ AboutData::AboutData()
QLatin1String(kleopatra_version), i18n(description), KAboutLicense::GPL,
i18n("(c) 2002 Steffen\u00A0Hansen, Matthias\u00A0Kalle\u00A0" "Dalheimer, Klar\u00E4lvdalens\u00A0" "Datakonsult\u00A0" "AB\n"
"(c) 2004, 2007, 2008, 2009 Marc\u00A0Mutz, Klar\u00E4lvdalens\u00A0" "Datakonsult\u00A0" "AB") +
"\n" + i18n("(c) 2010-2017 The Kleopatra developers")
'\n' + i18n("(c) 2010-2017 The Kleopatra developers")
#ifdef Q_OS_WIN
, i18n("<a href=https://www.gpg4win.org>Visit the Gpg4win homepage</a>")
#endif
......@@ -100,10 +100,12 @@ AboutData::AboutData()
{
using ::authors;
using ::credits;
for (unsigned int i = 0; i < sizeof authors / sizeof * authors; ++i)
for (unsigned int i = 0; i < sizeof authors / sizeof * authors; ++i) {
addAuthor(i18n(authors[i].name), i18n(authors[i].desc),
QLatin1String(authors[i].email), QLatin1String(authors[i].web));
for (unsigned int i = 0; i < sizeof credits / sizeof * credits; ++i)
}
for (unsigned int i = 0; i < sizeof credits / sizeof * credits; ++i) {
addCredit(i18n(credits[i].name), i18n(credits[i].desc),
QLatin1String(credits[i].email), QLatin1String(credits[i].web));
}
}
......@@ -63,14 +63,12 @@
#include <QGpgME/DataProvider>
#if GPGMEPP_VERSION > 0x10801 // 1.8.1
// TODO remove ifdef once > 1.8.1 is required
#include <gpgme++/gpggencardkeyinteractor.h>
# define GPGME_CAN_GENCARDKEY
#endif
using namespace Kleo;
using namespace Kleo::SmartCard;
......@@ -88,9 +86,9 @@ class GenKeyThread: public QThread
}
GpgME::Error error()
{
return mErr;
}
{
return mErr;
}
std::string bkpFile()
{
......@@ -122,7 +120,6 @@ class GenKeyThread: public QThread
#endif
} // Namespace
PGPCardWidget::PGPCardWidget():
mSerialNumber(new QLabel),
mCardHolderLabel(new QLabel),
......@@ -203,7 +200,7 @@ PGPCardWidget::PGPCardWidget():
auto pukButton = new QPushButton(i18n("Change Admin PIN"));
pukButton->setToolTip(i18n("Change the PIN required to unlock the smartcard."));
actionLayout->addWidget(pukButton);
connect(pukButton, &QPushButton::clicked, this, [this] () {doChangePin(3);});
connect(pukButton, &QPushButton::clicked, this, [this] () {doChangePin(3);});
auto resetCodeButton = new QPushButton(i18n("Change Reset Code"));
pukButton->setToolTip(i18n("Change the PIN required to reset the smartcard to an empty state."));
......@@ -216,7 +213,7 @@ PGPCardWidget::PGPCardWidget():
grid->setColumnStretch(4, -1);
}
void PGPCardWidget::setCard(const OpenPGPCard* card)
void PGPCardWidget::setCard(const OpenPGPCard *card)
{
const QString version = QString::fromStdString(card->cardVersion());
mIs21 = version == "2.1";
......@@ -257,7 +254,7 @@ void PGPCardWidget::doGenKey(GenCardKeyDialog *dlg)
progress->setWindowTitle(i18n("Generating keys"));
progress->setLabel(new QLabel(i18n("This may take several minutes...")));
GenKeyThread *workerThread = new GenKeyThread(params, mRealSerial);
connect (workerThread, &QThread::finished, this, [this, workerThread, progress] {
connect(workerThread, &QThread::finished, this, [this, workerThread, progress] {
progress->accept();
delete progress;
genKeyDone(workerThread->error(), workerThread->bkpFile());
......@@ -382,14 +379,13 @@ void PGPCardWidget::changeNameRequested()
}
break;
}
auto parts = text.split(" ");
auto parts = text.split(' ');
const auto lastName = parts.takeLast();
const auto formatted = lastName + QStringLiteral("<<") + parts.join('<');
ReaderStatus::mutableInstance()
->startSimpleTransaction(QStringLiteral("SCD SETATTR DISP-NAME %1").arg(formatted).toUtf8().constData(),
this, "changeNameResult");
}
void PGPCardWidget::changeNameResult(const GpgME::Error &err)
......@@ -406,7 +402,6 @@ void PGPCardWidget::changeNameResult(const GpgME::Error &err)
i18nc("@title", "Success"));
ReaderStatus::mutableInstance()->updateStatus();
}
}
void PGPCardWidget::updateKey(QLabel *label, const std::string &fpr)
......
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