Commit 234be202 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent ab707f2a
Pipeline #61608 passed with stage
in 7 minutes and 6 seconds
......@@ -108,7 +108,7 @@ void AbstractKeyListModelTest::testKeys()
QScopedPointer<AbstractKeyListModel> model(createModel());
const Key key = createTestKey("test@example.net");
const KeyGroup group = createGroup("test", {key});
const KeyGroup group = createGroup(QStringLiteral("test"), {key});
model->setKeys({key});
model->setGroups({group});
......@@ -204,7 +204,7 @@ void AbstractKeyListModelTest::testAddGroup()
}
{
const KeyGroup group = createGroup("test");
const KeyGroup group = createGroup(QStringLiteral("test"));
const QModelIndex resultIndex = model->addGroup(group);
QVERIFY( resultIndex.isValid() );
QCOMPARE( resultIndex.row(), 0 );
......@@ -225,10 +225,10 @@ void AbstractKeyListModelTest::testSetData()
QScopedPointer<AbstractKeyListModel> model(createModel());
const Key key = createTestKey("test@example.net");
const KeyGroup group = createGroup("test");
const KeyGroup group = createGroup(QStringLiteral("test"));
model->setKeys({key});
model->setGroups({group});
const KeyGroup updatedGroup = createGroup("updated", {key});
const KeyGroup updatedGroup = createGroup(QStringLiteral("updated"), {key});
QVERIFY( !model->setData(QModelIndex(), QVariant::fromValue(updatedGroup)) );
QVERIFY( !model->setData(model->index(key), QVariant::fromValue(updatedGroup)) );
......@@ -244,7 +244,7 @@ void AbstractKeyListModelTest::testRemoveGroup()
{
QScopedPointer<AbstractKeyListModel> model(createModel());
const KeyGroup group = createGroup("test");
const KeyGroup group = createGroup(QStringLiteral("test"));
model->setGroups({group});
{
......@@ -254,7 +254,7 @@ void AbstractKeyListModelTest::testRemoveGroup()
}
{
const KeyGroup otherGroup = createGroup("test2");
const KeyGroup otherGroup = createGroup(QStringLiteral("test2"));
const bool result = model->removeGroup(otherGroup);
QVERIFY( !result );
......
......@@ -76,7 +76,7 @@ class KeyResolverCoreTest: public QObject
private Q_SLOTS:
void init()
{
mGnupgHome = QTest::qExtractTestData("/fixtures/keyresolvercoretest");
mGnupgHome = QTest::qExtractTestData(QStringLiteral("/fixtures/keyresolvercoretest"));
qputenv("GNUPGHOME", mGnupgHome->path().toLocal8Bit());
// hold a reference to the key cache to avoid rebuilding while the test is running
......@@ -92,7 +92,7 @@ private Q_SLOTS:
mKeyCache.reset();
// kill all running gpg daemons
(void)QProcess::execute("gpgconf", {"--kill", "all"});
(void)QProcess::execute(QStringLiteral("gpgconf"), {"--kill", "all"});
mGnupgHome.reset();
qunsetenv("GNUPGHOME");
......@@ -825,7 +825,7 @@ private Q_SLOTS:
};
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true, OpenPGP);
resolver.setSender("sender-mixed@example.net");
resolver.setSender(QStringLiteral("sender-mixed@example.net"));
const auto result = resolver.resolve();
......@@ -853,7 +853,7 @@ private Q_SLOTS:
};
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true, OpenPGP);
resolver.setSender("sender-alias@example.net");
resolver.setSender(QStringLiteral("sender-alias@example.net"));
const auto result = resolver.resolve();
......@@ -875,7 +875,7 @@ private Q_SLOTS:
};
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true, OpenPGP);
resolver.setSender("sender-alias@example.net");
resolver.setSender(QStringLiteral("sender-alias@example.net"));
const auto result = resolver.resolve();
......@@ -896,7 +896,7 @@ private Q_SLOTS:
};
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true, CMS);
resolver.setSender("sender-mixed@example.net");
resolver.setSender(QStringLiteral("sender-mixed@example.net"));
const auto result = resolver.resolve();
......@@ -924,7 +924,7 @@ private Q_SLOTS:
};
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true, CMS);
resolver.setSender("sender-alias@example.net");
resolver.setSender(QStringLiteral("sender-alias@example.net"));
const auto result = resolver.resolve();
......@@ -946,7 +946,7 @@ private Q_SLOTS:
};
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true, CMS);
resolver.setSender("sender-alias@example.net");
resolver.setSender(QStringLiteral("sender-alias@example.net"));
const auto result = resolver.resolve();
......@@ -969,7 +969,7 @@ private Q_SLOTS:
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true);
resolver.setAllowMixedProtocols(false);
resolver.setSender("sender-mixed@example.net");
resolver.setSender(QStringLiteral("sender-mixed@example.net"));
const auto result = resolver.resolve();
......@@ -1001,7 +1001,7 @@ private Q_SLOTS:
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true);
resolver.setAllowMixedProtocols(false);
resolver.setSender("sender-alias@example.net");
resolver.setSender(QStringLiteral("sender-alias@example.net"));
const auto result = resolver.resolve();
......@@ -1026,7 +1026,7 @@ private Q_SLOTS:
};
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true);
resolver.setSender("sender-mixed@example.net");
resolver.setSender(QStringLiteral("sender-mixed@example.net"));
const auto result = resolver.resolve();
......@@ -1049,7 +1049,7 @@ private Q_SLOTS:
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true);
resolver.setPreferredProtocol(CMS);
resolver.setSender("sender-mixed@example.net");
resolver.setSender(QStringLiteral("sender-mixed@example.net"));
const auto result = resolver.resolve();
......@@ -1077,7 +1077,7 @@ private Q_SLOTS:
};
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true);
resolver.setSender("sender-alias@example.net");
resolver.setSender(QStringLiteral("sender-alias@example.net"));
const auto result = resolver.resolve();
......@@ -1106,7 +1106,7 @@ private Q_SLOTS:
KeyCache::mutableInstance()->setGroups(groups);
KeyResolverCore resolver(/*encrypt=*/ false, /*sign=*/ true);
resolver.setPreferredProtocol(CMS);
resolver.setSender("sender-alias@example.net");
resolver.setSender(QStringLiteral("sender-alias@example.net"));
const auto result = resolver.resolve();
......
......@@ -294,8 +294,8 @@ private Q_SLOTS:
forcedProtocol);
dialog->show();
verifyProtocolButton(dialog->findChild<QRadioButton *>("openpgp button"), IsVisible, IsChecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>("smime button"), IsVisible, IsUnchecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>(QStringLiteral("openpgp button")), IsVisible, IsChecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>(QStringLiteral("smime button")), IsVisible, IsUnchecked);
const auto signingKeyWidgets = visibleAndHiddenWidgets(dialog->findChildren<KeySelectionCombo *>(QStringLiteral("signing key")));
QCOMPARE(signingKeyWidgets.visible.size(), 1);
QCOMPARE(signingKeyWidgets.hidden.size(), 1);
......@@ -362,8 +362,8 @@ private Q_SLOTS:
forcedProtocol);
dialog->show();
verifyProtocolButton(dialog->findChild<QRadioButton *>("openpgp button"), IsVisible, IsUnchecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>("smime button"), IsVisible, IsChecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>(QStringLiteral("openpgp button")), IsVisible, IsUnchecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>(QStringLiteral("smime button")), IsVisible, IsChecked);
const auto signingKeyWidgets = visibleAndHiddenWidgets(dialog->findChildren<KeySelectionCombo *>(QStringLiteral("signing key")));
QCOMPARE(signingKeyWidgets.visible.size(), 1);
QCOMPARE(signingKeyWidgets.hidden.size(), 1);
......@@ -422,8 +422,8 @@ private Q_SLOTS:
forcedProtocol);
dialog->show();
verifyProtocolButton(dialog->findChild<QRadioButton *>("openpgp button"), IsHidden, IsChecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>("smime button"), IsHidden, IsUnchecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>(QStringLiteral("openpgp button")), IsHidden, IsChecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>(QStringLiteral("smime button")), IsHidden, IsUnchecked);
const auto signingKeyWidgets = visibleAndHiddenWidgets(dialog->findChildren<KeySelectionCombo *>(QStringLiteral("signing key")));
QCOMPARE(signingKeyWidgets.visible.size(), 1);
QCOMPARE(signingKeyWidgets.hidden.size(), 0);
......@@ -472,8 +472,8 @@ private Q_SLOTS:
forcedProtocol);
dialog->show();
verifyProtocolButton(dialog->findChild<QRadioButton *>("openpgp button"), IsHidden, IsUnchecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>("smime button"), IsHidden, IsChecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>(QStringLiteral("openpgp button")), IsHidden, IsUnchecked);
verifyProtocolButton(dialog->findChild<QRadioButton *>(QStringLiteral("smime button")), IsHidden, IsChecked);
const auto signingKeyWidgets = visibleAndHiddenWidgets(dialog->findChildren<KeySelectionCombo *>(QStringLiteral("signing key")));
QCOMPARE(signingKeyWidgets.visible.size(), 1);
QCOMPARE(signingKeyWidgets.hidden.size(), 0);
......@@ -523,9 +523,9 @@ private Q_SLOTS:
forcedProtocol);
dialog->show();
verifyProtocolButton(dialog->findChild<QCheckBox *>("openpgp button"), IsVisible, IsChecked);
verifyProtocolButton(dialog->findChild<QCheckBox *>("smime button"), IsVisible, IsChecked);
verifyProtocolLabels(dialog->findChildren<QLabel *>("protocol label"), 4, IsVisible);
verifyProtocolButton(dialog->findChild<QCheckBox *>(QStringLiteral("openpgp button")), IsVisible, IsChecked);
verifyProtocolButton(dialog->findChild<QCheckBox *>(QStringLiteral("smime button")), IsVisible, IsChecked);
verifyProtocolLabels(dialog->findChildren<QLabel *>(QStringLiteral("protocol label")), 4, IsVisible);
const auto signingKeyWidgets = visibleAndHiddenWidgets(dialog->findChildren<KeySelectionCombo *>(QStringLiteral("signing key")));
QCOMPARE(signingKeyWidgets.visible.size(), 2);
QCOMPARE(signingKeyWidgets.hidden.size(), 0);
......@@ -582,9 +582,9 @@ private Q_SLOTS:
forcedProtocol);
dialog->show();
verifyProtocolButton(dialog->findChild<QCheckBox *>("openpgp button"), IsVisible, IsChecked);
verifyProtocolButton(dialog->findChild<QCheckBox *>("smime button"), IsVisible, IsUnchecked);
verifyProtocolLabels(dialog->findChildren<QLabel *>("protocol label"), 4, IsHidden);
verifyProtocolButton(dialog->findChild<QCheckBox *>(QStringLiteral("openpgp button")), IsVisible, IsChecked);
verifyProtocolButton(dialog->findChild<QCheckBox *>(QStringLiteral("smime button")), IsVisible, IsUnchecked);
verifyProtocolLabels(dialog->findChildren<QLabel *>(QStringLiteral("protocol label")), 4, IsHidden);
const auto signingKeyWidgets = visibleAndHiddenWidgets(dialog->findChildren<KeySelectionCombo *>(QStringLiteral("signing key")));
QCOMPARE(signingKeyWidgets.visible.size(), 1);
QCOMPARE(signingKeyWidgets.hidden.size(), 1);
......@@ -638,9 +638,9 @@ private Q_SLOTS:
forcedProtocol);
dialog->show();
verifyProtocolButton(dialog->findChild<QCheckBox *>("openpgp button"), IsVisible, IsUnchecked);
verifyProtocolButton(dialog->findChild<QCheckBox *>("smime button"), IsVisible, IsChecked);
verifyProtocolLabels(dialog->findChildren<QLabel *>("protocol label"), 4, IsHidden);
verifyProtocolButton(dialog->findChild<QCheckBox *>(QStringLiteral("openpgp button")), IsVisible, IsUnchecked);
verifyProtocolButton(dialog->findChild<QCheckBox *>(QStringLiteral("smime button")), IsVisible, IsChecked);
verifyProtocolLabels(dialog->findChildren<QLabel *>(QStringLiteral("protocol label")), 4, IsHidden);
const auto signingKeyWidgets = visibleAndHiddenWidgets(dialog->findChildren<KeySelectionCombo *>(QStringLiteral("signing key")));
QCOMPARE(signingKeyWidgets.visible.size(), 1);
QCOMPARE(signingKeyWidgets.hidden.size(), 1);
......@@ -799,9 +799,9 @@ private Q_SLOTS:
const auto generateIndex = encryptionKeyCombo->findData(GenerateKey);
QVERIFY(generateIndex != -1);
encryptionKeyCombo->setCurrentIndex(generateIndex);
QCOMPARE(okButton->text(), "Generate");
QCOMPARE(okButton->text(), QStringLiteral("Generate"));
encryptionKeyCombo->setCurrentIndex(originalIndex);
QVERIFY(okButton->text() != "Generate");
QVERIFY(okButton->text() != QStringLiteral("Generate"));
}
}
......@@ -839,9 +839,9 @@ private Q_SLOTS:
const auto generateIndex = signingKeyCombo->findData(GenerateKey);
QVERIFY(generateIndex != -1);
signingKeyCombo->setCurrentIndex(generateIndex);
QVERIFY(okButton->text() != "Generate");
QVERIFY(okButton->text() != QStringLiteral("Generate"));
signingKeyCombo->setCurrentIndex(originalIndex);
QVERIFY(okButton->text() != "Generate");
QVERIFY(okButton->text() != QStringLiteral("Generate"));
}
{
// get the first encryption key combo which is the OpenPGP one for the sender
......@@ -851,9 +851,9 @@ private Q_SLOTS:
const auto generateIndex = encryptionKeyCombo->findData(GenerateKey);
QVERIFY(generateIndex != -1);
encryptionKeyCombo->setCurrentIndex(generateIndex);
QVERIFY(okButton->text() != "Generate");
QVERIFY(okButton->text() != QStringLiteral("Generate"));
encryptionKeyCombo->setCurrentIndex(originalIndex);
QVERIFY(okButton->text() != "Generate");
QVERIFY(okButton->text() != QStringLiteral("Generate"));
}
}
......@@ -879,7 +879,7 @@ private Q_SLOTS:
dialog->show();
waitForKeySelectionCombosBeingInitialized(dialog.get());
const auto okButton = dialog->findChild<QPushButton *>("ok button");
const auto okButton = dialog->findChild<QPushButton *>(QStringLiteral("ok button"));
QVERIFY(okButton);
QVERIFY(okButton->isEnabled());
......@@ -919,7 +919,7 @@ private Q_SLOTS:
dialog->show();
waitForKeySelectionCombosBeingInitialized(dialog.get());
const auto complianceLabel = dialog->findChild<QLabel *>("compliance label");
const auto complianceLabel = dialog->findChild<QLabel *>(QStringLiteral("compliance label"));
verifyWidgetVisibility(complianceLabel, IsVisible);
QVERIFY(!complianceLabel->text().contains(" not "));
}
......@@ -950,7 +950,7 @@ private Q_SLOTS:
dialog->show();
waitForKeySelectionCombosBeingInitialized(dialog.get());
const auto complianceLabel = dialog->findChild<QLabel *>("compliance label");
const auto complianceLabel = dialog->findChild<QLabel *>(QStringLiteral("compliance label"));
verifyWidgetVisibility(complianceLabel, IsVisible);
QVERIFY(complianceLabel->text().contains(" not "));
}
......@@ -981,7 +981,7 @@ private Q_SLOTS:
dialog->show();
waitForKeySelectionCombosBeingInitialized(dialog.get());
const auto complianceLabel = dialog->findChild<QLabel *>("compliance label");
const auto complianceLabel = dialog->findChild<QLabel *>(QStringLiteral("compliance label"));
verifyWidgetVisibility(complianceLabel, IsVisible);
QVERIFY(!complianceLabel->text().contains(" not "));
}
......@@ -1016,7 +1016,7 @@ private Q_SLOTS:
const QSignalSpy dialogAcceptedSpy{dialog.get(), &QDialog::accepted};
QVERIFY(dialogAcceptedSpy.isValid());
const auto okButton = dialog->findChild<QPushButton *>("ok button");
const auto okButton = dialog->findChild<QPushButton *>(QStringLiteral("ok button"));
QVERIFY(okButton);
QVERIFY(okButton->isEnabled());
okButton->click();
......@@ -1062,7 +1062,7 @@ private Q_SLOTS:
const QSignalSpy dialogAcceptedSpy{dialog.get(), &QDialog::accepted};
QVERIFY(dialogAcceptedSpy.isValid());
const auto okButton = dialog->findChild<QPushButton *>("ok button");
const auto okButton = dialog->findChild<QPushButton *>(QStringLiteral("ok button"));
QVERIFY(okButton);
QVERIFY(okButton->isEnabled());
okButton->click();
......@@ -1098,7 +1098,7 @@ private Q_SLOTS:
waitForKeySelectionCombosBeingInitialized(dialog.get());
switchKeySelectionCombosFromGenerateKeyToIgnoreKey(dialog->findChildren<KeySelectionCombo *>());
const auto smimeButton = dialog->findChild<QCheckBox *>("smime button");
const auto smimeButton = dialog->findChild<QCheckBox *>(QStringLiteral("smime button"));
QVERIFY(smimeButton);
smimeButton->click();
QVERIFY(!smimeButton->isChecked());
......@@ -1106,7 +1106,7 @@ private Q_SLOTS:
const QSignalSpy dialogAcceptedSpy{dialog.get(), &QDialog::accepted};
QVERIFY(dialogAcceptedSpy.isValid());
const auto okButton = dialog->findChild<QPushButton *>("ok button");
const auto okButton = dialog->findChild<QPushButton *>(QStringLiteral("ok button"));
QVERIFY(okButton);
QVERIFY(okButton->isEnabled());
okButton->click();
......@@ -1149,7 +1149,7 @@ private Q_SLOTS:
waitForKeySelectionCombosBeingInitialized(dialog.get());
switchKeySelectionCombosFromGenerateKeyToIgnoreKey(dialog->findChildren<KeySelectionCombo *>());
const auto openPGPButton = dialog->findChild<QCheckBox *>("openpgp button");
const auto openPGPButton = dialog->findChild<QCheckBox *>(QStringLiteral("openpgp button"));
QVERIFY(openPGPButton);
openPGPButton->click();
QVERIFY(!openPGPButton->isChecked());
......@@ -1157,7 +1157,7 @@ private Q_SLOTS:
const QSignalSpy dialogAcceptedSpy{dialog.get(), &QDialog::accepted};
QVERIFY(dialogAcceptedSpy.isValid());
const auto okButton = dialog->findChild<QPushButton *>("ok button");
const auto okButton = dialog->findChild<QPushButton *>(QStringLiteral("ok button"));
QVERIFY(okButton);
QVERIFY(okButton->isEnabled());
okButton->click();
......
......@@ -20,7 +20,7 @@ using namespace GpgME;
class KeyGroup::Private
{
public:
explicit Private(Id id, const QString &name, const std::vector<Key> &keys, Source source);
explicit Private(const Id &id, const QString &name, const std::vector<Key> &keys, Source source);
Id id;
QString name;
......@@ -29,7 +29,7 @@ public:
bool isImmutable = true;
};
KeyGroup::Private::Private(Id id, const QString &name, const std::vector<Key> &keys, Source source)
KeyGroup::Private::Private(const Id &id, const QString &name, const std::vector<Key> &keys, Source source)
: id(id)
, name(name)
, keys(keys.cbegin(), keys.cend())
......@@ -44,7 +44,7 @@ KeyGroup::KeyGroup()
KeyGroup::~KeyGroup() = default;
KeyGroup::KeyGroup(Id id, const QString &name, const std::vector<Key> &keys, Source source)
KeyGroup::KeyGroup(const Id &id, const QString &name, const std::vector<Key> &keys, Source source)
: d(new Private(id, name, keys, source))
{
}
......
......@@ -44,7 +44,7 @@ public:
KeyGroup();
~KeyGroup();
explicit KeyGroup(Id id, const QString &name, const std::vector<GpgME::Key> &keys, Source source);
explicit KeyGroup(const Id &id, const QString &name, const std::vector<GpgME::Key> &keys, Source source);
KeyGroup(const KeyGroup &other);
KeyGroup &operator=(const KeyGroup &other);
......
......@@ -237,7 +237,8 @@ public:
// collect the key fingerprints for all groups read from the configuration
QMap<QString, QStringList> fingerprints;
for (const QString &value: entry->stringValueList()) {
const auto stringValueList = entry->stringValueList();
for (const QString &value: stringValueList) {
const QStringList split = value.split(QLatin1Char('='));
if (split.size() != 2) {
qCDebug (LIBKLEO_LOG) << "Ignoring invalid group config:" << value;
......
......@@ -186,9 +186,9 @@ Q_SIGNALS:
void added(const GpgME::Key &key);
void keyListingDone(const GpgME::KeyListResult &result);
void keysMayHaveChanged();
void groupAdded(const KeyGroup &group);
void groupUpdated(const KeyGroup &group);
void groupRemoved(const KeyGroup &group);
void groupAdded(const Kleo::KeyGroup &group);
void groupUpdated(const Kleo::KeyGroup &group);
void groupRemoved(const Kleo::KeyGroup &group);
private:
class RefreshKeysJob;
......
......@@ -470,7 +470,7 @@ QVariant AbstractKeyListModel::data(const KeyGroup &group, int column, int role)
} else if (role == Qt::FontRole) {
return QFont();
} else if (role == Qt::DecorationRole) {
return column == Icon ? QIcon::fromTheme("group") : QVariant();
return column == Icon ? QIcon::fromTheme(QStringLiteral("group")) : QVariant();
} else if (role == Qt::BackgroundRole) {
} else if (role == Qt::ForegroundRole) {
} else if (role == GroupRole) {
......
......@@ -72,10 +72,10 @@ public Q_SLOTS:
void removeKey(const GpgME::Key &key);
void setGroups(const std::vector<KeyGroup> &groups);
QModelIndex addGroup(const KeyGroup &group);
bool removeGroup(const KeyGroup &group);
QModelIndex addGroup(const Kleo::KeyGroup &group);
bool removeGroup(const Kleo::KeyGroup &group);
void clear(ItemTypes types = All);
void clear(Kleo::AbstractKeyListModel::ItemTypes types = All);
public:
int columnCount(const QModelIndex &pidx) const override;
......
......@@ -532,7 +532,9 @@ void DirectoryServicesWidget::addX509Services(const QList<QUrl> &urls)
QList<QUrl> DirectoryServicesWidget::x509Services() const
{
QList<QUrl> result;
for (unsigned int i = 0, end = d->model.numServices(); i != end; ++i) {
unsigned int numServices{d->model.numServices()};
result.reserve(numServices);
for (unsigned int i = 0; i != numServices; ++i) {
result.push_back(d->model.service(i));
}
return result;
......
......@@ -568,7 +568,7 @@ public:
return comboWidget;
}
void setSigningKeys(std::vector<GpgME::Key> preferredKeys, std::vector<GpgME::Key> alternativeKeys)
void setSigningKeys(const std::vector<GpgME::Key> &preferredKeys, const std::vector<GpgME::Key> &alternativeKeys)
{
auto group = new QGroupBox(i18nc("Caption for signing key selection", "Confirm identity '%1' as:", mSender));
group->setAlignment(Qt::AlignLeft);
......
......@@ -45,7 +45,7 @@ QString Kleo::getCryptoConfigStringValue(const char *componentName, const char *
return entry->stringValue();
}
void Kleo::Private::setFakeCryptoConfigStringValue(std::string componentName, std::string entryName, const QString &fakeValue)
void Kleo::Private::setFakeCryptoConfigStringValue(const std::string &componentName, const std::string &entryName, const QString &fakeValue)
{
fakeCryptoConfigValues[componentName][entryName] = fakeValue;
}
......
......@@ -20,7 +20,7 @@ namespace Kleo
namespace Private
{
void setFakeCryptoConfigStringValue(std::string componentName, std::string entryName, const QString &fakeValue);
void setFakeCryptoConfigStringValue(const std::string &componentName, const std::string &entryName, const QString &fakeValue);
void clearFakeCryptoConfigStringValue(const std::string &componentName, const std::string &entryName);
}
......
......@@ -496,12 +496,12 @@ QString Formatting::toolTip(const KeyGroup &group, int flags)
QStringList result;
result.reserve(3 + 2 + numKeysForTooltip + 2);
if (!validity.isEmpty()) {
result.push_back("<p>");
result.push_back(QStringLiteral("<p>"));
result.push_back(validity.toHtmlEscaped());
result.push_back("</p>");
result.push_back(QStringLiteral("</p>"));
}
result.push_back("<p>");
result.push_back(QStringLiteral("<p>"));
result.push_back(i18n("Keys:"));
{
auto it = keys.cbegin();
......@@ -512,7 +512,7 @@ QString Formatting::toolTip(const KeyGroup &group, int flags)
if (keys.size() > numKeysForTooltip) {
result.push_back(QLatin1String("<br>") + i18ncp("this follows a list of keys", "and 1 more key", "and %1 more keys", keys.size() - numKeysForTooltip));
}
result.push_back("</p>");
result.push_back(QStringLiteral("</p>"));
return result.join(QLatin1Char('\n'));
}
......
......@@ -157,7 +157,6 @@ private:
const QString sigPath = verPath + QStringLiteral(".sig");
QFileInfo versionSig(instPath + QStringLiteral("/../VERSION.sig"));
QString signedVersion;
if (versionSig.exists()) {
/* We have a signed version so let us check it against the GnuPG
* release keys. */
......
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