Commit e7010762 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent a3d5a052
Pipeline #29694 passed with stage
in 38 minutes and 18 seconds
......@@ -97,7 +97,7 @@ void FilterActionAddHeaderTest::shouldNotExecuteActionWhenParameterIsEmpty()
item.setPayload<KMime::Message::Ptr>(msgPtr);
MailCommon::ItemContext context(item, true);
filter.argsFromString(QStringLiteral(""));
filter.argsFromString(QLatin1String(""));
QCOMPARE(filter.process(context, false), MailCommon::FilterAction::ErrorButGoOn);
QCOMPARE(context.needsPayloadStore(), false);
QCOMPARE(context.deleteItem(), false);
......
......@@ -22,7 +22,7 @@
void FilterActionDecryptTest::initTestCase()
{
mGpg = new GPGHelper(QString::fromUtf8(TEST_PATH) + QStringLiteral("/gpghome"));
mGpg = new GPGHelper(QLatin1String(TEST_PATH) + QStringLiteral("/gpghome"));
QVERIFY(mGpg->isValid());
}
......
......@@ -22,7 +22,7 @@
void FilterActionEncryptTest::initTestCase()
{
mGpg = new GPGHelper(QString::fromUtf8(TEST_PATH) + QStringLiteral("/gpghome"));
mGpg = new GPGHelper(QStringLiteral(TEST_PATH) + QStringLiteral("/gpghome"));
QVERIFY(mGpg->isValid());
}
......@@ -40,7 +40,7 @@ void FilterActionEncryptTest::shouldEncrypt_data()
const auto smimeKey = QStringLiteral("SMIME:%1:0FDD972BCEFB5735DC7E8EE57DB7BA4E5FDBE218");
const auto pgpKey = QStringLiteral("PGP:%1:818AE8DA30F81B0CEA4403BA358732559B8659B2");
QDir testDir(QString::fromUtf8(TEST_PATH) + QStringLiteral("/gpgdata"));
QDir testDir(QStringLiteral(TEST_PATH) + QStringLiteral("/gpgdata"));
const auto tests = testDir.entryInfoList({ QStringLiteral("*.msg") }, QDir::Files, QDir::Name);
for (const auto &test : tests) {
QFile plain(test.absoluteFilePath());
......
......@@ -44,7 +44,7 @@ void FilterActionPipeThroughTest::testWithNoCommand()
item.setPayload<KMime::Message::Ptr>(msgPtr);
ItemContext context(item, true);
filter.argsFromString(QStringLiteral(""));
filter.argsFromString(QLatin1String(""));
QCOMPARE(filter.process(context, false), FilterAction::ErrorButGoOn);
QCOMPARE(context.needsPayloadStore(), false);
}
......
......@@ -323,8 +323,7 @@ void KMFilterListBox::slotUpdateFilterName()
// auto-naming of patterns
if (!p->isEmpty() && p->first() && !p->first()->field().trimmed().isEmpty()) {
shouldBeName = QStringLiteral("<%1>: %2").
arg(QString::fromLatin1(p->first()->field())).
arg(p->first()->contents());
arg(QString::fromLatin1(p->first()->field()), p->first()->contents());
} else {
shouldBeName = QLatin1Char('<') + i18n("unnamed") + QLatin1Char('>');
}
......
......@@ -366,7 +366,7 @@ QDataStream &SearchPattern::operator>>(QDataStream &s) const
break;
}
for (const SearchRule::Ptr rule : qAsConst(*this)) {
for (const SearchRule::Ptr &rule : qAsConst(*this)) {
*rule >> s;
}
return s;
......
......@@ -60,7 +60,7 @@ bool SearchRuleDate::matches(const Akonadi::Item &item) const
return rc;
}
bool SearchRuleDate::matchesInternal(const QDate &dateValue, const QDate &msgDate) const
bool SearchRuleDate::matchesInternal(QDate dateValue, QDate msgDate) const
{
switch (function()) {
case SearchRule::FuncEquals:
......
......@@ -56,7 +56,7 @@ public:
* A helper method for the main matches() method.
* Does the actual comparing.
*/
bool matchesInternal(const QDate &dateValue, const QDate &msgDate) const;
bool matchesInternal(QDate dateValue, QDate msgDate) const;
/**
* @copydoc SearchRule::addQueryTerms()
......
......@@ -735,7 +735,8 @@ void SnippetsModel::save(const QString &filename)
KSharedConfig::Ptr config = KSharedConfig::openConfig(filename.isEmpty() ? QStringLiteral("kmailsnippetrc") : filename, KConfig::NoGlobals);
// clear everything
for (const QString &group : config->groupList()) {
const QStringList lst = config->groupList();
for (const QString &group : lst) {
config->deleteGroup(group);
}
......
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