Commit 7b67b7fd authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent 5596fd66
Pipeline #78413 failed with stage
in 25 minutes and 49 seconds
......@@ -115,7 +115,9 @@ KJob *KMigratorBase::createAgentInstance(const QString &typeId, QObject *receive
{
Q_EMIT message(Info, i18n("Creating instance of type %1", typeId));
auto job = new AgentInstanceCreateJob(typeId, this);
connect(job, SIGNAL(result(KJob *)), receiver, slot);
// clang-format off
connect(job, SIGNAL(result(KJob*)), receiver, slot);
// clang-format on
job->start();
return job;
}
......
......@@ -243,8 +243,8 @@ void EwsOAuthRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info
auto pkeyAuthJob = new EwsPKeyAuthJob(url, mPKeyCertFile, mPKeyKeyFile, mPKeyPassword, this);
mPKeyAuthResponse = pkeyAuthJob->getAuthHeader();
QUrlQuery query(url.query());
if (!mPKeyAuthResponse.isEmpty() && query.hasQueryItem(QLatin1String("SubmitUrl"))) {
mPKeyAuthSubmitUrl = query.queryItemValue(QLatin1String("SubmitUrl"), QUrl::FullyDecoded);
if (!mPKeyAuthResponse.isEmpty() && query.hasQueryItem(QStringLiteral("SubmitUrl"))) {
mPKeyAuthSubmitUrl = query.queryItemValue(QStringLiteral("SubmitUrl"), QUrl::FullyDecoded);
/* Workaround for QTBUG-88861
* When the PKey authentication starts, the server issues a request for a "special" PKey URL
* containing the challenge arguments and expects that a response is composed and the browser
......
......@@ -129,7 +129,7 @@ public:
mChanges.append(change);
}
void addItemChanges(ItemChange::List::const_iterator firstChange, ItemChange::List::const_iterator lastChange)
void addItemChanges(const ItemChange::List::const_iterator &firstChange, const ItemChange::List::const_iterator &lastChange)
{
mChanges.reserve(mChanges.size() + lastChange - firstChange);
for (auto it = firstChange; it != lastChange; ++it) {
......
......@@ -35,7 +35,7 @@ void EwsFetchItemPayloadJob::start()
mChunkedJob.setItems(ids);
mChunkedJob.start(
[this](EwsId::List::const_iterator firstId, EwsId::List::const_iterator lastId) {
[this](const EwsId::List::const_iterator &firstId, const EwsId::List::const_iterator &lastId) {
auto req = new EwsGetItemRequest(mClient, this);
EwsId::List ids;
for (auto it = firstId; it != lastId; ++it) {
......
......@@ -354,7 +354,7 @@ void EwsResource::retrieveItems(const Collection &collection)
});
}
void EwsResource::queueFetchItemsJob(const Akonadi::Collection &col, QueuedFetchItemsJobType type, std::function<void(EwsFetchItemsJob *)> startFn)
void EwsResource::queueFetchItemsJob(const Akonadi::Collection &col, QueuedFetchItemsJobType type, const std::function<void(EwsFetchItemsJob *)> &startFn)
{
qCDebugNC(EWSRES_LOG) << QStringLiteral("Enqueuing sync for collection ") << col << col.id();
......
......@@ -147,7 +147,7 @@ private:
static QString getCollectionSyncState(const Akonadi::Collection &col);
static void saveCollectionSyncState(Akonadi::Collection &col, const QString &state);
void queueFetchItemsJob(const Akonadi::Collection &col, QueuedFetchItemsJobType type, std::function<void(EwsFetchItemsJob *)> startFn);
void queueFetchItemsJob(const Akonadi::Collection &col, QueuedFetchItemsJobType type, const std::function<void(EwsFetchItemsJob *)> &startFn);
void startFetchItemsJob(const Akonadi::Collection &col, std::function<void(EwsFetchItemsJob *)> startFn);
void dequeueFetchItemsJob();
......
......@@ -61,7 +61,8 @@ void EwsModifyMailJob::start()
if (doSubmit) {
mChunkedJob.setItems(itemChanges);
mChunkedJob.start(
[this](EwsUpdateItemRequest::ItemChange::List::const_iterator firstChange, EwsUpdateItemRequest::ItemChange::List::const_iterator lastChange) {
[this](const EwsUpdateItemRequest::ItemChange::List::const_iterator &firstChange,
const EwsUpdateItemRequest::ItemChange::List::const_iterator &lastChange) {
auto req = new EwsUpdateItemRequest(mClient, this);
req->addItemChanges(firstChange, lastChange);
return req;
......
......@@ -46,7 +46,7 @@ QString TimezoneConverter::fromCityName(const QString &tz)
countryMap.insert(cityName, QString::fromUtf8(zone));
}
const QRegularExpression locationFinder(QStringLiteral("\\b([a-zA-Z])+\\b"));
static const QRegularExpression locationFinder(QStringLiteral("\\b([a-zA-Z])+\\b"));
QRegularExpressionMatchIterator iter = locationFinder.globalMatch(tz);
while (iter.hasNext()) {
QRegularExpressionMatch match = iter.next();
......
......@@ -2204,7 +2204,7 @@ bool MixedMaildirStore::Private::visit(FileStore::StoreCompactJob *job)
Item::List items;
items.reserve(movedEntries.count());
Q_FOREACH (const KMBox::MBoxEntry::Pair &offsetPair, movedEntries) {
for (const KMBox::MBoxEntry::Pair &offsetPair : std::as_const(movedEntries)) {
const QString oldRemoteId(QString::number(offsetPair.first.messageOffset()));
const QString newRemoteId(QString::number(offsetPair.second.messageOffset()));
......
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