Commit 81dbf56c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent 1d257970
......@@ -351,7 +351,7 @@ void CryptoComposerTest::testBCCEncrypt()
Composer *composer = new Composer;
QString data(QStringLiteral("All happy families are alike; each unhappy family is unhappy in its own way."));
fillComposerData(composer, data);
composer->infoPart()->setBcc(QStringList(QLatin1String("bcc@bcc.org")));
composer->infoPart()->setBcc(QStringList(QStringLiteral("bcc@bcc.org")));
std::vector<GpgME::Key> keys = MessageComposer::Test::getKeys();
......@@ -543,7 +543,7 @@ void CryptoComposerTest::fillComposerData(Composer *composer, const QString &dat
{
composer->globalPart()->setFallbackCharsetEnabled(true);
composer->infoPart()->setFrom(QStringLiteral("me@me.me"));
composer->infoPart()->setTo(QStringList(QLatin1String("you@you.you")));
composer->infoPart()->setTo(QStringList(QStringLiteral("you@you.you")));
composer->textPart()->setWrappedPlainText(data);
}
......
......@@ -23,73 +23,73 @@ QString MessageComposer::ConvertSnippetVariablesUtil::snippetVariableFromEnum(Me
{
switch (type) {
case CcAddr:
return QLatin1String("%CCADDR");
return QStringLiteral("%CCADDR");
case CcLname:
return QLatin1String("%CCLNAME");
return QStringLiteral("%CCLNAME");
case CcFname:
return QLatin1String("%CCFNAME");
return QStringLiteral("%CCFNAME");
case CcName:
return QLatin1String("%CCNAME");
return QStringLiteral("%CCNAME");
case FullSubject:
return QLatin1String("%FULLSUBJECT");
return QStringLiteral("%FULLSUBJECT");
case ToAddr:
return QLatin1String("%TOADDR");
return QStringLiteral("%TOADDR");
case ToFname:
return QLatin1String("%TOFNAME");
return QStringLiteral("%TOFNAME");
case ToLname:
return QLatin1String("%TOLNAME");
return QStringLiteral("%TOLNAME");
case ToName:
return QLatin1String("%TONAME");
return QStringLiteral("%TONAME");
case FromAddr:
return QLatin1String("%FROMADDR");
return QStringLiteral("%FROMADDR");
case FromLname:
return QLatin1String("%FROMLNAME");
return QStringLiteral("%FROMLNAME");
case FromFname:
return QLatin1String("%FROMFNAME");
return QStringLiteral("%FROMFNAME");
case FromName:
return QLatin1String("%FROMNAME");
return QStringLiteral("%FROMNAME");
case Dow:
return QLatin1String("%DOW");
return QStringLiteral("%DOW");
case Date:
return QLatin1String("%DATE");
return QStringLiteral("%DATE");
case ShortDate:
return QLatin1String("%SHORTDATE");
return QStringLiteral("%SHORTDATE");
case Time:
return QLatin1String("%TIME");
return QStringLiteral("%TIME");
case TimeLong:
return QLatin1String("%TIMELONG");
return QStringLiteral("%TIMELONG");
case AttachmentCount:
return QLatin1String("%ATTACHMENTCOUNT");
return QStringLiteral("%ATTACHMENTCOUNT");
case AttachmentName:
return QLatin1String("%ATTACHMENTNAMES");
return QStringLiteral("%ATTACHMENTNAMES");
case AttachmentFilenames:
return QLatin1String("%ATTACHMENTFILENAMES");
return QStringLiteral("%ATTACHMENTFILENAMES");
case AttachmentNamesAndSizes:
return QLatin1String("%ATTACHMENTNAMESANDSIZES");
return QStringLiteral("%ATTACHMENTNAMESANDSIZES");
case Year:
return QLatin1String("%YEAR");
return QStringLiteral("%YEAR");
case LastYear:
return QLatin1String("%LASTYEAR");
return QStringLiteral("%LASTYEAR");
case NextYear:
return QLatin1String("%NEXTYEAR");
return QStringLiteral("%NEXTYEAR");
case MonthNumber:
return QLatin1String("%MONTHNUMBER"); //1-12
return QStringLiteral("%MONTHNUMBER"); //1-12
case DayOfMonth:
return QLatin1String("%DAYOFMONTH"); //1-31
return QStringLiteral("%DAYOFMONTH"); //1-31
case WeekNumber:
return QLatin1String("%WEEKNUMBER"); //1-52
return QStringLiteral("%WEEKNUMBER"); //1-52
case MonthNameShort:
return QLatin1String("%MONTHNAMESHORT"); //(Jan-Dec)
return QStringLiteral("%MONTHNAMESHORT"); //(Jan-Dec)
case MonthNameLong:
return QLatin1String("%MONTHNAMELONG"); //(January-December)
return QStringLiteral("%MONTHNAMELONG"); //(January-December)
case DayOfWeek:
return QLatin1String("%DAYOFWEEK"); //(1-7)
return QStringLiteral("%DAYOFWEEK"); //(1-7)
case DayOfWeekNameShort:
return QLatin1String("%DAYOFWEEKNAMESHORT"); //(Mon-Sun)
return QStringLiteral("%DAYOFWEEKNAMESHORT"); //(Mon-Sun)
case DayOfWeekNameLong:
return QLatin1String("%DAYOFWEEKNAMELONG"); //(Monday-Sunday)
return QStringLiteral("%DAYOFWEEKNAMELONG"); //(Monday-Sunday)
case YearLastMonth:
return QLatin1String("%YEARLASTMONTH"); //january 2020 will how 2019-12
return QStringLiteral("%YEARLASTMONTH"); //january 2020 will how 2019-12
}
return {};
}
......@@ -194,7 +194,7 @@ bool SortOrder::validForAggregation(const Aggregation *aggregation) const
&& groupSortingOk && groupSortDirectionOk;
}
SortOrder SortOrder::defaultForAggregation(const Aggregation *aggregation, const SortOrder &oldSortOrder)
SortOrder SortOrder::defaultForAggregation(const Aggregation *aggregation, SortOrder oldSortOrder)
{
SortOrder newSortOrder;
......
......@@ -176,7 +176,7 @@ public:
* will be based on that old sort order, i.e. the message sorting and
* message sort direction is adopted.
*/
static SortOrder defaultForAggregation(const Aggregation *aggregation, const SortOrder &oldSortOrder);
static SortOrder defaultForAggregation(const Aggregation *aggregation, SortOrder oldSortOrder);
/**
* Returns true if the ms parameter specifies a valid MessageSorting option.
......
......@@ -564,7 +564,7 @@ DKIMCheckSignatureJob::DKIMWarning DKIMCheckSignatureJob::warning() const
return mWarning;
}
void DKIMCheckSignatureJob::setWarning(const DKIMCheckSignatureJob::DKIMWarning &warning)
void DKIMCheckSignatureJob::setWarning(DKIMCheckSignatureJob::DKIMWarning warning)
{
mWarning = warning;
}
......@@ -654,7 +654,7 @@ DKIMCheckSignatureJob::DKIMStatus DKIMCheckSignatureJob::status() const
return mStatus;
}
void DKIMCheckSignatureJob::setStatus(const DKIMCheckSignatureJob::DKIMStatus &status)
void DKIMCheckSignatureJob::setStatus(DKIMCheckSignatureJob::DKIMStatus status)
{
mStatus = status;
}
......
......@@ -125,7 +125,7 @@ public:
Q_REQUIRED_RESULT QString dkimValue() const;
Q_REQUIRED_RESULT DKIMCheckSignatureJob::DKIMStatus status() const;
void setStatus(const DKIMCheckSignatureJob::DKIMStatus &status);
void setStatus(MessageViewer::DKIMCheckSignatureJob::DKIMStatus status);
Q_REQUIRED_RESULT MessageViewer::DKIMCheckSignatureJob::DKIMStatus checkSignature(const MessageViewer::DKIMInfo &info);
......@@ -135,7 +135,7 @@ public:
void setMessage(const KMime::Message::Ptr &message);
Q_REQUIRED_RESULT DKIMCheckSignatureJob::DKIMWarning warning() const;
void setWarning(const DKIMWarning &warning);
void setWarning(MessageViewer::DKIMCheckSignatureJob::DKIMWarning warning);
Q_REQUIRED_RESULT QString headerCanonizationResult() const;
......
......@@ -189,7 +189,7 @@ DKIMInfo::CanonicalizationType DKIMInfo::bodyCanonization() const
return mBodyCanonization;
}
void DKIMInfo::setBodyCanonization(const CanonicalizationType &bodyCanonization)
void DKIMInfo::setBodyCanonization(CanonicalizationType bodyCanonization)
{
mBodyCanonization = bodyCanonization;
}
......@@ -219,7 +219,7 @@ DKIMInfo::CanonicalizationType DKIMInfo::headerCanonization() const
return mHeaderCanonization;
}
void DKIMInfo::setHeaderCanonization(const CanonicalizationType &headerCanonization)
void DKIMInfo::setHeaderCanonization(CanonicalizationType headerCanonization)
{
mHeaderCanonization = headerCanonization;
}
......
......@@ -92,10 +92,10 @@ public:
void setBodyLengthCount(int bodyLengthCount);
Q_REQUIRED_RESULT CanonicalizationType headerCanonization() const;
void setHeaderCanonization(const CanonicalizationType &headerCanonization);
void setHeaderCanonization(CanonicalizationType headerCanonization);
Q_REQUIRED_RESULT CanonicalizationType bodyCanonization() const;
void setBodyCanonization(const CanonicalizationType &bodyCanonization);
void setBodyCanonization(CanonicalizationType bodyCanonization);
Q_REQUIRED_RESULT bool operator==(const DKIMInfo &other) const;
......
......@@ -105,9 +105,9 @@ void DKIMManagerKey::saveKeys()
const QString groupName = QStringLiteral("DKIM Key Record #%1").arg(i);
KConfigGroup group = config->group(groupName);
const KeyInfo &info = mKeys.at(i);
group.writeEntry(QLatin1String("Selector"), info.selector);
group.writeEntry(QLatin1String("Domain"), info.domain);
group.writeEntry(QLatin1String("Key"), info.keyValue);
group.writeEntry(QStringLiteral("Selector"), info.selector);
group.writeEntry(QStringLiteral("Domain"), info.domain);
group.writeEntry(QStringLiteral("Key"), info.keyValue);
}
}
......
......@@ -75,13 +75,13 @@ int DKIMManagerRules::loadRules(const QString &fileName)
int numberOfRulesAdded = 0;
for (const QString &groupName : rulesGroups) {
KConfigGroup group = config->group(groupName);
const QStringList signedDomainIdentifier = group.readEntry(QLatin1String("SignedDomainIdentifier"), QStringList());
const QString from = group.readEntry(QLatin1String("From"), QString());
const QString domain = group.readEntry(QLatin1String("Domain"), QString());
const bool enabled = group.readEntry(QLatin1String("Enabled"), true);
const int ruleType = group.readEntry(QLatin1String("RuleType"), 0);
const QString listId = group.readEntry(QLatin1String("List-Id"), QString());
const int priority = group.readEntry(QLatin1String("Priority"), 1000);
const QStringList signedDomainIdentifier = group.readEntry(QStringLiteral("SignedDomainIdentifier"), QStringList());
const QString from = group.readEntry(QStringLiteral("From"), QString());
const QString domain = group.readEntry(QStringLiteral("Domain"), QString());
const bool enabled = group.readEntry(QStringLiteral("Enabled"), true);
const int ruleType = group.readEntry(QStringLiteral("RuleType"), 0);
const QString listId = group.readEntry(QStringLiteral("List-Id"), QString());
const int priority = group.readEntry(QStringLiteral("Priority"), 1000);
DKIMRule rule;
rule.setEnabled(enabled);
rule.setDomain(domain);
......@@ -133,12 +133,12 @@ void DKIMManagerRules::save(const QString &fileName)
KConfigGroup group = config->group(groupName);
const DKIMRule &rule = mRules.at(i);
group.writeEntry(QLatin1String("SignedDomainIdentifier"), rule.signedDomainIdentifier());
group.writeEntry(QLatin1String("From"), rule.from());
group.writeEntry(QLatin1String("Domain"), rule.domain());
group.writeEntry(QLatin1String("Enabled"), rule.enabled());
group.writeEntry(QLatin1String("RuleType"), static_cast<int>(rule.ruleType()));
group.writeEntry(QLatin1String("List-Id"), rule.listId());
group.writeEntry(QLatin1String("Priority"), rule.priority());
group.writeEntry(QStringLiteral("SignedDomainIdentifier"), rule.signedDomainIdentifier());
group.writeEntry(QStringLiteral("From"), rule.from());
group.writeEntry(QStringLiteral("Domain"), rule.domain());
group.writeEntry(QStringLiteral("Enabled"), rule.enabled());
group.writeEntry(QStringLiteral("RuleType"), static_cast<int>(rule.ruleType()));
group.writeEntry(QStringLiteral("List-Id"), rule.listId());
group.writeEntry(QStringLiteral("Priority"), rule.priority());
}
}
......@@ -74,7 +74,7 @@ DKIMRule::RuleType DKIMRule::ruleType() const
return mRuleType;
}
void DKIMRule::setRuleType(const RuleType &ruleType)
void DKIMRule::setRuleType(RuleType ruleType)
{
mRuleType = ruleType;
}
......
......@@ -56,7 +56,7 @@ public:
Q_REQUIRED_RESULT bool isValid() const;
Q_REQUIRED_RESULT RuleType ruleType() const;
void setRuleType(const RuleType &ruleType);
void setRuleType(MessageViewer::DKIMRule::RuleType ruleType);
Q_REQUIRED_RESULT QString listId() const;
void setListId(const QString &listId);
......
......@@ -67,7 +67,7 @@ Akonadi::Item::Id DKIMWidgetInfo::currentItemId() const
return mCurrentItemId;
}
void DKIMWidgetInfo::setCurrentItemId(const Akonadi::Item::Id &currentItemId)
void DKIMWidgetInfo::setCurrentItemId(Akonadi::Item::Id currentItemId)
{
mCurrentItemId = currentItemId;
}
......
......@@ -40,7 +40,7 @@ public:
void clear();
Q_REQUIRED_RESULT Akonadi::Item::Id currentItemId() const;
void setCurrentItemId(const Akonadi::Item::Id &currentItemId);
void setCurrentItemId(Akonadi::Item::Id currentItemId);
Q_REQUIRED_RESULT MessageViewer::DKIMCheckSignatureJob::CheckSignatureResult result() const;
......
......@@ -278,7 +278,7 @@ public:
QVector<QByteArray> addressHeaders;
addressHeaders << "to" << "reply-To" << "reply-From" << "cc" << "bcc" << "from" << "sender" << "resent-From" << "resent-To";
for (const auto &header: addressHeaders) {
for (const auto &header: qAsConst(addressHeaders)) {
registerHeaderFormatter(header, QSharedPointer<HeaderFormatter>(new AddressHeaderFormatter(header)));
}
......@@ -366,7 +366,7 @@ QString GrantleeHeaderFormatter::format(const QString &absolutePath, const Grant
QVector<QByteArray> defaultHeaders;
defaultHeaders << "to" << "reply-To" << "reply-From" << "cc" << "bcc" << "from" << "sender" << "resent-From" << "resent-To" << "subject" << "organization" << "list-id" << "date";
for (const auto &header: defaultHeaders) {
for (const auto &header: qAsConst(defaultHeaders)) {
QSharedPointer<HeaderFormatter> formatter;
if (d->headerFormatter.contains(header)) {
formatter = d->headerFormatter.value(header);
......
......@@ -134,9 +134,9 @@ bool Util::containsExternalReferences(const QString &str, const QString &extraHe
}
}
if (!newStringImg.isEmpty()) {
const bool containsReg2 = newStringImg.contains(QRegularExpression(QLatin1String("<img.*src=\"https?:/.*\".*>"), QRegularExpression::CaseInsensitiveOption), &rmatch);
const bool containsReg2 = newStringImg.contains(QRegularExpression(QStringLiteral("<img.*src=\"https?:/.*\".*>"), QRegularExpression::CaseInsensitiveOption), &rmatch);
if (!containsReg2) {
const bool containsReg = newStringImg.contains(QRegularExpression(QLatin1String("<img.*src=https?:/.*>"), QRegularExpression::CaseInsensitiveOption), &rmatch);
const bool containsReg = newStringImg.contains(QRegularExpression(QStringLiteral("<img.*src=https?:/.*>"), QRegularExpression::CaseInsensitiveOption), &rmatch);
return containsReg;
} else {
return true;
......
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