summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-12 13:54:14 +0200
committerMontel Laurent <[email protected]>2017-10-12 13:54:14 +0200
commit3fca01d419a52250f7149d812f66b41a796299cf (patch)
tree185d5e8533243a5ed47996ca368744be0a1da7fb
parent9cbca27dbd32f7b30f13579f63016ab5f54ee6ee (diff)
Fix clazy error step2
-rw-r--r--agents/maildispatcher/sendjob.cpp2
-rw-r--r--resources/ews/configdialog.cpp2
-rw-r--r--resources/ews/ewsclient/ewsattachment.cpp4
-rw-r--r--resources/ews/ewsclient/ewsdeletefolderrequest.cpp2
-rw-r--r--resources/ews/ewsclient/ewseventrequestbase.cpp4
-rw-r--r--resources/ews/ewsclient/ewsfindfolderrequest.cpp2
-rw-r--r--resources/ews/ewsclient/ewsgeteventsrequest.cpp2
-rw-r--r--resources/ews/ewsclient/ewsgetfolderrequest.cpp2
-rw-r--r--resources/ews/ewsclient/ewsgetitemrequest.cpp2
-rw-r--r--resources/ews/ewsclient/ewssubscriberequest.h4
-rw-r--r--resources/ews/ewsclient/ewsupdatefolderrequest.h2
-rw-r--r--resources/ews/ewsclient/ewsupdateitemrequest.h2
-rw-r--r--resources/ews/ewsclient/ewsxml.cpp2
-rw-r--r--resources/ews/ewsclient/ewsxml.h2
-rw-r--r--resources/ews/ewsmodifyitemflagsjob.cpp2
-rw-r--r--resources/ews/ewsmodifyitemflagsjob.h2
-rw-r--r--resources/ews/ewsresource.cpp4
-rw-r--r--resources/ews/test/fakeserver/fakeewsserverthread.cpp2
-rw-r--r--resources/ews/test/fakeserver/fakeewsserverthread.h2
-rw-r--r--resources/ews/test/isolatedtestbase.cpp2
-rw-r--r--resources/ews/test/unittests/faketransferjob.cpp2
-rw-r--r--resources/facebook/resource.cpp4
-rw-r--r--resources/kolab/kolabretrievetagstask.cpp2
-rw-r--r--resources/kolab/pimkolab/conversion/kolabconversion.cpp1
-rw-r--r--resources/kolab/pimkolab/conversion/timezoneconverter.cpp2
-rw-r--r--resources/kolab/pimkolab/icalendar/icalendar.cpp2
-rw-r--r--resources/kolab/pimkolab/icalendar/icalendar.h2
-rw-r--r--resources/kolab/pimkolab/kolabformat/mimeobject.cpp2
-rw-r--r--resources/kolab/tagchangehelper.cpp2
-rw-r--r--resources/kolab/tagchangehelper.h2
-rw-r--r--resources/mixedmaildir/mixedmaildirresource.cpp12
-rw-r--r--resources/tomboynotes/o2/o0baseauth.cpp2
-rw-r--r--resources/tomboynotes/o2/o0baseauth.h2
-rw-r--r--resources/tomboynotes/o2/o0simplecrypt.h8
-rw-r--r--resources/tomboynotes/o2/o1.cpp2
-rw-r--r--resources/tomboynotes/o2/o1.h2
-rw-r--r--resources/tomboynotes/o2/o2.cpp2
-rw-r--r--resources/tomboynotes/o2/o2simplecrypt.cpp8
38 files changed, 53 insertions, 54 deletions
diff --git a/agents/maildispatcher/sendjob.cpp b/agents/maildispatcher/sendjob.cpp
index b03e8da..7af9ec1 100644
--- a/agents/maildispatcher/sendjob.cpp
+++ b/agents/maildispatcher/sendjob.cpp
@@ -406,7 +406,7 @@ void SendJob::Private::storeResult(bool success, const QString &message)
Q_ASSERT(currentJob == nullptr);
currentJob = new StoreResultJob(item, success, message);
- connect(currentJob, &StoreResultJob::result, [this](KJob *job) { doEmitResult(job); });
+ connect(currentJob, &StoreResultJob::result, q, [this](KJob *job) { doEmitResult(job); });
}
void SendJob::Private::doEmitResult(KJob *job)
diff --git a/resources/ews/configdialog.cpp b/resources/ews/configdialog.cpp
index a33dd77..ce00f0e 100644
--- a/resources/ews/configdialog.cpp
+++ b/resources/ews/configdialog.cpp
@@ -127,7 +127,7 @@ ConfigDialog::ConfigDialog(EwsResource *parentResource, EwsClient &client, WId w
mUi->aboutIconLabel->setPixmap(ewsIcon.pixmap(96, 96, QIcon::Normal, QIcon::On));
mUi->aboutTextLabel->setText(i18nc("@info", "Akonadi Resource for Microsoft Exchange Web Services (EWS)"));
mUi->aboutCopyrightLabel->setText(i18nc("@info", "Copyright (c) Krzysztof Nowicki 2015-2017"));
- mUi->aboutVersionLabel->setText(i18nc("@info", "Version %1", QString::fromLatin1(AKONADI_EWS_VERSION)));
+ mUi->aboutVersionLabel->setText(i18nc("@info", "Version %1", QStringLiteral(AKONADI_EWS_VERSION)));
mUi->aboutLicenseLabel->setText(i18nc("@info", "Distributed under the GNU Library General Public License version 2.0 or later."));
mUi->aboutUrlLabel->setText(QStringLiteral("<a href=\"https://github.com/KrissN/akonadi-ews\">https://github.com/KrissN/akonadi-ews</a>"));
diff --git a/resources/ews/ewsclient/ewsattachment.cpp b/resources/ews/ewsclient/ewsattachment.cpp
index 4152b05..1eff39b 100644
--- a/resources/ews/ewsclient/ewsattachment.cpp
+++ b/resources/ews/ewsclient/ewsattachment.cpp
@@ -172,7 +172,7 @@ EwsAttachment::EwsAttachment(QXmlStreamReader &reader)
d->mItem = EwsItem(reader);
if (!d->mItem.isValid()) {
qCWarningNC(EWSCLI_LOG) << QStringLiteral("Failed to read %1 element - invalid %2 element.")
- .arg(QStringLiteral("Attachment")).arg(QStringLiteral("Item"));
+ .arg(QStringLiteral("Attachment"), QStringLiteral("Item"));
reader.skipCurrentElement();
ok = false;
} else {
@@ -180,7 +180,7 @@ EwsAttachment::EwsAttachment(QXmlStreamReader &reader)
}
} else {
qCWarningNC(EWSCLI_LOG) << QStringLiteral("Failed to read %1 element - unknown %2 element.")
- .arg(QStringLiteral("Attachment")).arg(elmName);
+ .arg(QStringLiteral("Attachment"), elmName);
reader.skipCurrentElement();
ok = false;
}
diff --git a/resources/ews/ewsclient/ewsdeletefolderrequest.cpp b/resources/ews/ewsclient/ewsdeletefolderrequest.cpp
index 7834cf9..147c12e 100644
--- a/resources/ews/ewsclient/ewsdeletefolderrequest.cpp
+++ b/resources/ews/ewsclient/ewsdeletefolderrequest.cpp
@@ -102,7 +102,7 @@ EwsDeleteFolderRequest::Response::Response(QXmlStreamReader &reader)
while (reader.readNextStartElement()) {
if (reader.namespaceUri() != ewsMsgNsUri && reader.namespaceUri() != ewsTypeNsUri) {
setErrorMsg(QStringLiteral("Unexpected namespace in %1 element: %2")
- .arg(QStringLiteral("ResponseMessage")).arg(reader.namespaceUri().toString()));
+ .arg(QStringLiteral("ResponseMessage"), reader.namespaceUri().toString()));
return;
}
diff --git a/resources/ews/ewsclient/ewseventrequestbase.cpp b/resources/ews/ewsclient/ewseventrequestbase.cpp
index 4f7a7ca..e93b270 100644
--- a/resources/ews/ewsclient/ewseventrequestbase.cpp
+++ b/resources/ews/ewsclient/ewseventrequestbase.cpp
@@ -75,7 +75,7 @@ bool EwsEventRequestBase::parseNotificationsResponse(QXmlStreamReader &reader)
.arg(mReqName).arg(resp.notifications().size()).arg(numEv);
} else {
qCDebug(EWSCLI_REQUEST_LOG) << QStringLiteral("Got %1 response - %2")
- .arg(mReqName).arg(resp.responseMessage());
+ .arg(mReqName, resp.responseMessage());
}
}
@@ -93,7 +93,7 @@ EwsEventRequestBase::Response::Response(QXmlStreamReader &reader)
while (reader.readNextStartElement()) {
if (reader.namespaceUri() != ewsMsgNsUri && reader.namespaceUri() != ewsTypeNsUri) {
setErrorMsg(QStringLiteral("Unexpected namespace in %1 element: %2")
- .arg(QStringLiteral("ResponseMessage")).arg(reader.namespaceUri().toString()));
+ .arg(QStringLiteral("ResponseMessage"), reader.namespaceUri().toString()));
return;
}
diff --git a/resources/ews/ewsclient/ewsfindfolderrequest.cpp b/resources/ews/ewsclient/ewsfindfolderrequest.cpp
index 66a9fbf..35e9c2e 100644
--- a/resources/ews/ewsclient/ewsfindfolderrequest.cpp
+++ b/resources/ews/ewsclient/ewsfindfolderrequest.cpp
@@ -112,7 +112,7 @@ EwsFindFolderResponse::EwsFindFolderResponse(QXmlStreamReader &reader)
while (reader.readNextStartElement()) {
if (reader.namespaceUri() != ewsMsgNsUri && reader.namespaceUri() != ewsTypeNsUri) {
setErrorMsg(QStringLiteral("Unexpected namespace in %1 element: %2")
- .arg(QStringLiteral("ResponseMessage")).arg(reader.namespaceUri().toString()));
+ .arg(QStringLiteral("ResponseMessage"), reader.namespaceUri().toString()));
return;
}
diff --git a/resources/ews/ewsclient/ewsgeteventsrequest.cpp b/resources/ews/ewsclient/ewsgeteventsrequest.cpp
index 613b608..a065cdc 100644
--- a/resources/ews/ewsclient/ewsgeteventsrequest.cpp
+++ b/resources/ews/ewsclient/ewsgeteventsrequest.cpp
@@ -48,7 +48,7 @@ void EwsGetEventsRequest::start()
endSoapDocument(writer);
qCDebugNC(EWSCLI_REQUEST_LOG) << QStringLiteral("Starting GetEvents request (subId: %1, wmark: %2)")
- .arg(mSubscriptionId).arg(mWatermark);
+ .arg(mSubscriptionId, mWatermark);
qCDebug(EWSCLI_PROTO_LOG) << reqString;
diff --git a/resources/ews/ewsclient/ewsgetfolderrequest.cpp b/resources/ews/ewsclient/ewsgetfolderrequest.cpp
index ce8089e..abc4875 100644
--- a/resources/ews/ewsclient/ewsgetfolderrequest.cpp
+++ b/resources/ews/ewsclient/ewsgetfolderrequest.cpp
@@ -91,7 +91,7 @@ bool EwsGetFolderRequest::parseFoldersResponse(QXmlStreamReader &reader)
const EwsFolder &folder = resp.folder();
const EwsId &id = folder[EwsFolderFieldFolderId].value<EwsId>();
qCDebugNC(EWSCLI_REQUEST_LOG) << QStringLiteral("Got GetFolder response (id: %1, name: %2)")
- .arg(ewsHash(id.id())).arg(folder[EwsFolderFieldDisplayName].toString());
+ .arg(ewsHash(id.id()), folder[EwsFolderFieldDisplayName].toString());
} else {
qCDebugNC(EWSCLI_REQUEST_LOG) << QStringLiteral("Got GetFolder response - %1")
.arg(resp.responseMessage());
diff --git a/resources/ews/ewsclient/ewsgetitemrequest.cpp b/resources/ews/ewsclient/ewsgetitemrequest.cpp
index 7732813..2d312e5 100644
--- a/resources/ews/ewsclient/ewsgetitemrequest.cpp
+++ b/resources/ews/ewsclient/ewsgetitemrequest.cpp
@@ -87,7 +87,7 @@ bool EwsGetItemRequest::parseItemsResponse(QXmlStreamReader &reader)
const EwsItem &item = resp.item();
const EwsId &id = item[EwsItemFieldItemId].value<EwsId>();
qCDebugNC(EWSCLI_REQUEST_LOG) << QStringLiteral("Got GetItem response (id: %1, subject: %2)")
- .arg(ewsHash(id.id())).arg(item[EwsItemFieldSubject].toString());
+ .arg(ewsHash(id.id()), item[EwsItemFieldSubject].toString());
} else {
qCDebugNC(EWSCLI_REQUEST_LOG) << QStringLiteral("Got GetItem response - %1")
.arg(resp.responseMessage());
diff --git a/resources/ews/ewsclient/ewssubscriberequest.h b/resources/ews/ewsclient/ewssubscriberequest.h
index be82061..76336da 100644
--- a/resources/ews/ewsclient/ewssubscriberequest.h
+++ b/resources/ews/ewsclient/ewssubscriberequest.h
@@ -67,7 +67,7 @@ public:
mType = t;
}
- void setFolderIds(EwsId::List folders)
+ void setFolderIds(const EwsId::List &folders)
{
mFolderIds = folders;
}
@@ -77,7 +77,7 @@ public:
mAllFolders = allFolders;
}
- void setEventTypes(QList<EwsEventType> types)
+ void setEventTypes(const QList<EwsEventType> &types)
{
mEventTypes = types;
}
diff --git a/resources/ews/ewsclient/ewsupdatefolderrequest.h b/resources/ews/ewsclient/ewsupdatefolderrequest.h
index aac8cfa..a3d7cc1 100644
--- a/resources/ews/ewsclient/ewsupdatefolderrequest.h
+++ b/resources/ews/ewsclient/ewsupdatefolderrequest.h
@@ -77,7 +77,7 @@ public:
class FolderChange
{
public:
- FolderChange(EwsId folderId, EwsFolderType type) : mId(folderId), mType(type) {}
+ FolderChange(const EwsId &folderId, EwsFolderType type) : mId(folderId), mType(type) {}
void addUpdate(const Update *upd)
{
mUpdates.append(QSharedPointer<const Update>(upd));
diff --git a/resources/ews/ewsclient/ewsupdateitemrequest.h b/resources/ews/ewsclient/ewsupdateitemrequest.h
index b5baae5..07a1216 100644
--- a/resources/ews/ewsclient/ewsupdateitemrequest.h
+++ b/resources/ews/ewsclient/ewsupdateitemrequest.h
@@ -48,7 +48,7 @@ public:
Unknown
};
- Update(EwsPropertyField field, const QVariant &val, Type type)
+ Update(const EwsPropertyField &field, const QVariant &val, Type type)
: mField(field), mValue(val), mType(type) {}
EwsPropertyField mField;
diff --git a/resources/ews/ewsclient/ewsxml.cpp b/resources/ews/ewsclient/ewsxml.cpp
index f5a4935..5ad6c38 100644
--- a/resources/ews/ewsclient/ewsxml.cpp
+++ b/resources/ews/ewsclient/ewsxml.cpp
@@ -222,7 +222,7 @@ bool ewsXmlFolderReader(QXmlStreamReader &reader, QVariant &val)
return true;
}
-bool ewsXmlEnumReader(QXmlStreamReader &reader, QVariant &val, QVector<QString> items)
+bool ewsXmlEnumReader(QXmlStreamReader &reader, QVariant &val, const QVector<QString> &items)
{
QString elmName = reader.name().toString();
QString text = reader.readElementText();
diff --git a/resources/ews/ewsclient/ewsxml.h b/resources/ews/ewsclient/ewsxml.h
index 051b9c0..fd7c2f9 100644
--- a/resources/ews/ewsclient/ewsxml.h
+++ b/resources/ews/ewsclient/ewsxml.h
@@ -168,7 +168,7 @@ extern bool ewsXmlDateTimeReader(QXmlStreamReader &reader, QVariant &val);
extern bool ewsXmlItemReader(QXmlStreamReader &reader, QVariant &val);
extern bool ewsXmlFolderReader(QXmlStreamReader &reader, QVariant &val);
-extern bool ewsXmlEnumReader(QXmlStreamReader &reader, QVariant &val, QVector<QString> items);
+extern bool ewsXmlEnumReader(QXmlStreamReader &reader, QVariant &val, const QVector<QString> &items);
extern bool ewsXmlSensitivityReader(QXmlStreamReader &reader, QVariant &val);
extern bool ewsXmlImportanceReader(QXmlStreamReader &reader, QVariant &val);
extern bool ewsXmlCalendarItemTypeReader(QXmlStreamReader &reader, QVariant &val);
diff --git a/resources/ews/ewsmodifyitemflagsjob.cpp b/resources/ews/ewsmodifyitemflagsjob.cpp
index 1eec5dd..d770716 100644
--- a/resources/ews/ewsmodifyitemflagsjob.cpp
+++ b/resources/ews/ewsmodifyitemflagsjob.cpp
@@ -24,7 +24,7 @@
using namespace Akonadi;
-EwsModifyItemFlagsJob::EwsModifyItemFlagsJob(EwsClient &client, QObject *parent, const Item::List items,
+EwsModifyItemFlagsJob::EwsModifyItemFlagsJob(EwsClient &client, QObject *parent, const Item::List &items,
const QSet<QByteArray> &addedFlags, const QSet<QByteArray> &removedFlags)
: EwsJob(parent), mItems(items), mClient(client), mAddedFlags(addedFlags), mRemovedFlags(removedFlags)
{
diff --git a/resources/ews/ewsmodifyitemflagsjob.h b/resources/ews/ewsmodifyitemflagsjob.h
index 8579dc8..ffa8338 100644
--- a/resources/ews/ewsmodifyitemflagsjob.h
+++ b/resources/ews/ewsmodifyitemflagsjob.h
@@ -31,7 +31,7 @@ class EwsModifyItemFlagsJob : public EwsJob
{
Q_OBJECT
public:
- EwsModifyItemFlagsJob(EwsClient &client, QObject *parent, const Akonadi::Item::List,
+ EwsModifyItemFlagsJob(EwsClient &client, QObject *parent, const Akonadi::Item::List &,
const QSet<QByteArray> &addedFlags, const QSet<QByteArray> &removedFlags);
~EwsModifyItemFlagsJob() override;
diff --git a/resources/ews/ewsresource.cpp b/resources/ews/ewsresource.cpp
index 466d153..b03b072 100644
--- a/resources/ews/ewsresource.cpp
+++ b/resources/ews/ewsresource.cpp
@@ -705,7 +705,7 @@ void EwsResource::itemMoveRequestFinished(KJob *job)
movedItems.append(item);
}
} else {
- warning(QStringLiteral("Move failed for item %1").arg(item.remoteId()));
+ Q_EMIT warning(QStringLiteral("Move failed for item %1").arg(item.remoteId()));
qCDebugNC(EWSRES_AGENTIF_LOG) << QStringLiteral("itemsMoved: failed for item %1").arg(ewsHash(item.remoteId()));
failedIds.append(EwsId(item.remoteId(), QString()));
}
@@ -785,7 +785,7 @@ void EwsResource::itemDeleteRequestFinished(KJob *job)
}
mQueuedUpdates[item.parentCollection().remoteId()].append({item.remoteId(), QString(), EwsDeletedEvent});
} else {
- warning(QStringLiteral("Delete failed for item %1").arg(item.remoteId()));
+ Q_EMIT warning(QStringLiteral("Delete failed for item %1").arg(item.remoteId()));
qCWarningNC(EWSRES_AGENTIF_LOG) << QStringLiteral("itemsRemoved: failed for item %1").arg(ewsHash(item.remoteId()));
EwsId colId = EwsId(item.parentCollection().remoteId(), QString());
mItemsToCheck[colId.id()].append(EwsId(item.remoteId(), QString()));
diff --git a/resources/ews/test/fakeserver/fakeewsserverthread.cpp b/resources/ews/test/fakeserver/fakeewsserverthread.cpp
index a648860..6681b8e 100644
--- a/resources/ews/test/fakeserver/fakeewsserverthread.cpp
+++ b/resources/ews/test/fakeserver/fakeewsserverthread.cpp
@@ -85,7 +85,7 @@ void FakeEwsServerThread::queueEventsXml(const QStringList &events)
}
}
-void FakeEwsServerThread::doQueueEventsXml(const QStringList events)
+void FakeEwsServerThread::doQueueEventsXml(const QStringList &events)
{
mServer->queueEventsXml(events);
}
diff --git a/resources/ews/test/fakeserver/fakeewsserverthread.h b/resources/ews/test/fakeserver/fakeewsserverthread.h
index 14997a5..ebe3035 100644
--- a/resources/ews/test/fakeserver/fakeewsserverthread.h
+++ b/resources/ews/test/fakeserver/fakeewsserverthread.h
@@ -50,7 +50,7 @@ Q_SIGNALS:
protected:
void run() override;
private Q_SLOTS:
- void doQueueEventsXml(const QStringList events);
+ void doQueueEventsXml(const QStringList &events);
private:
QScopedPointer<FakeEwsServer> mServer;
ushort mPortNumber;
diff --git a/resources/ews/test/isolatedtestbase.cpp b/resources/ews/test/isolatedtestbase.cpp
index 15bbf19..a2d4ac5 100644
--- a/resources/ews/test/isolatedtestbase.cpp
+++ b/resources/ews/test/isolatedtestbase.cpp
@@ -36,7 +36,7 @@ constexpr int OnlineStateChangeTimeoutMs = 20000;
IsolatedTestBase::IsolatedTestBase(QObject *parent)
: QObject(parent), mFakeServerThread(new FakeEwsServerThread(this))
{
- qsrand(QDateTime::currentDateTime().toTime_t());
+ qsrand(QDateTime::currentDateTimeUtc().toTime_t());
}
IsolatedTestBase::~IsolatedTestBase()
diff --git a/resources/ews/test/unittests/faketransferjob.cpp b/resources/ews/test/unittests/faketransferjob.cpp
index 45b5b78..f9fac9f 100644
--- a/resources/ews/test/unittests/faketransferjob.cpp
+++ b/resources/ews/test/unittests/faketransferjob.cpp
@@ -48,7 +48,7 @@ void FakeTransferJob::postResponse(const QByteArray &resp)
{
mResponse = resp;
qRegisterMetaType<KIO::Job*>();
- metaObject()->invokeMethod(this, "doData", Qt::QueuedConnection, Q_ARG(const QByteArray&, mResponse));
+ metaObject()->invokeMethod(this, "doData", Qt::QueuedConnection, Q_ARG(QByteArray, mResponse));
metaObject()->invokeMethod(this, "doEmitResult", Qt::QueuedConnection);
}
diff --git a/resources/facebook/resource.cpp b/resources/facebook/resource.cpp
index 6aabac3..9911aa7 100644
--- a/resources/facebook/resource.cpp
+++ b/resources/facebook/resource.cpp
@@ -46,10 +46,10 @@ void FacebookResource::configure(WId windowId)
QScopedPointer<SettingsDialog> dlg(new SettingsDialog(this));
if (dlg->exec()) {
- configurationDialogAccepted();
+ Q_EMIT configurationDialogAccepted();
synchronize();
} else {
- configurationDialogRejected();
+ Q_EMIT configurationDialogRejected();
}
}
diff --git a/resources/kolab/kolabretrievetagstask.cpp b/resources/kolab/kolabretrievetagstask.cpp
index c51d32c..3cf214f 100644
--- a/resources/kolab/kolabretrievetagstask.cpp
+++ b/resources/kolab/kolabretrievetagstask.cpp
@@ -127,7 +127,7 @@ Akonadi::Item KolabRetrieveTagTask::extractMember(const Kolab::RelationMember &m
col.setParentCollection(Akonadi::Collection::root());
parent = col;
}
- for (const QByteArray part : qAsConst(member.mailbox)) {
+ for (const QByteArray &part : qAsConst(member.mailbox)) {
Akonadi::Collection col;
col.setRemoteId(separatorCharacter() + QString::fromLatin1(part));
col.setParentCollection(parent);
diff --git a/resources/kolab/pimkolab/conversion/kolabconversion.cpp b/resources/kolab/pimkolab/conversion/kolabconversion.cpp
index b63646f..fcaedc9 100644
--- a/resources/kolab/pimkolab/conversion/kolabconversion.cpp
+++ b/resources/kolab/pimkolab/conversion/kolabconversion.cpp
@@ -55,6 +55,7 @@ Note fromNote(const KMime::Message::Ptr &m)
n.setCustomProperties(customs);
std::vector<Kolab::Attachment> attachments;
+ attachments.reserve(note.attachments().count());
foreach (const Akonadi::NoteUtils::Attachment &a, note.attachments()) {
Kolab::Attachment attachment;
if (a.url().isValid()) {
diff --git a/resources/kolab/pimkolab/conversion/timezoneconverter.cpp b/resources/kolab/pimkolab/conversion/timezoneconverter.cpp
index 22334eb..d6f9969 100644
--- a/resources/kolab/pimkolab/conversion/timezoneconverter.cpp
+++ b/resources/kolab/pimkolab/conversion/timezoneconverter.cpp
@@ -52,7 +52,7 @@ QString TimezoneConverter::fromCityName(const QString &tz)
{
const auto zones = QTimeZone::availableTimeZoneIds();
QHash<QString, QString> countryMap;
- for (auto zone : zones) {
+ for (const auto &zone : zones) {
const QString cityName = zone.split('/').last();
Q_ASSERT(!countryMap.contains(cityName));
countryMap.insert(cityName, zone);
diff --git a/resources/kolab/pimkolab/icalendar/icalendar.cpp b/resources/kolab/pimkolab/icalendar/icalendar.cpp
index 5239171..858eeb0 100644
--- a/resources/kolab/pimkolab/icalendar/icalendar.cpp
+++ b/resources/kolab/pimkolab/icalendar/icalendar.cpp
@@ -119,7 +119,7 @@ ITipHandler::ITipMethod ITipHandler::method() const
return mMethod;
}
-std::string ITipHandler::toIMip(const Event &event, ITipHandler::ITipMethod m, std::string from, bool bccMe) const
+std::string ITipHandler::toIMip(const Event &event, ITipHandler::ITipMethod m, const std::string &from, bool bccMe) const
{
KCalCore::Event::Ptr e = Conversion::toKCalCore(event);
// e->recurrence()->addRDateTime(e->dtStart()); //FIXME The createScheduleMessage converts everything to utc without a recurrence.
diff --git a/resources/kolab/pimkolab/icalendar/icalendar.h b/resources/kolab/pimkolab/icalendar/icalendar.h
index 6b6afaf..4e47be8 100644
--- a/resources/kolab/pimkolab/icalendar/icalendar.h
+++ b/resources/kolab/pimkolab/icalendar/icalendar.h
@@ -56,7 +56,7 @@ public:
iTIPNoMethod /**< No method */
};
- std::string toIMip(const Kolab::Event &, ITipMethod, std::string from, bool bbcMe = false) const;
+ std::string toIMip(const Kolab::Event &, ITipMethod, const std::string &from, bool bbcMe = false) const;
std::vector<Kolab::Event> fromIMip(const std::string &);
/**
diff --git a/resources/kolab/pimkolab/kolabformat/mimeobject.cpp b/resources/kolab/pimkolab/kolabformat/mimeobject.cpp
index d287c1c..d61eb43 100644
--- a/resources/kolab/pimkolab/kolabformat/mimeobject.cpp
+++ b/resources/kolab/pimkolab/kolabformat/mimeobject.cpp
@@ -513,7 +513,7 @@ void MIMEObject::setVersion(Version version)
static std::string createCid()
{
- return QStringLiteral("cid:%[email protected]%2").arg(KRandom::randomString(16)).arg(QStringLiteral("kolab.resource.akonadi")).toStdString();
+ return QStringLiteral("cid:%[email protected]%2").arg(KRandom::randomString(16), QStringLiteral("kolab.resource.akonadi")).toStdString();
}
std::vector<Kolab::Attachment> convertToReferences(const std::vector<Kolab::Attachment> &attachments, std::vector<std::string> &attachmentCids)
diff --git a/resources/kolab/tagchangehelper.cpp b/resources/kolab/tagchangehelper.cpp
index 49e6b8d..018e3a4 100644
--- a/resources/kolab/tagchangehelper.cpp
+++ b/resources/kolab/tagchangehelper.cpp
@@ -87,7 +87,7 @@ void TagChangeHelper::start(const Akonadi::Tag &tag, const KMime::Message::Ptr &
append->start();
}
-void TagChangeHelper::recordNewUid(qint64 newUid, Akonadi::Tag tag)
+void TagChangeHelper::recordNewUid(qint64 newUid, const Akonadi::Tag &tag)
{
Q_ASSERT(newUid > 0);
Q_ASSERT(tag.isValid());
diff --git a/resources/kolab/tagchangehelper.h b/resources/kolab/tagchangehelper.h
index 5e95748..66840fb 100644
--- a/resources/kolab/tagchangehelper.h
+++ b/resources/kolab/tagchangehelper.h
@@ -61,7 +61,7 @@ private:
KolabRelationResourceTask *const mTask;
private:
- void recordNewUid(qint64 newUid, Akonadi::Tag tag);
+ void recordNewUid(qint64 newUid, const Akonadi::Tag &tag);
private Q_SLOTS:
void onReplaceDone(KJob *job);
diff --git a/resources/mixedmaildir/mixedmaildirresource.cpp b/resources/mixedmaildir/mixedmaildirresource.cpp
index a9e3e20..ab23d49 100644
--- a/resources/mixedmaildir/mixedmaildirresource.cpp
+++ b/resources/mixedmaildir/mixedmaildirresource.cpp
@@ -248,7 +248,7 @@ void MixedMaildirResource::retrieveCollections()
FileStore::CollectionFetchJob *job = mStore->fetchCollections(mStore->topLevelCollection(), FileStore::CollectionFetchJob::Recursive);
connect(job, &FileStore::CollectionFetchJob::result, this, &MixedMaildirResource::retrieveCollectionsResult);
- status(Running, i18nc("@info:status", "Synchronizing email folders"));
+ Q_EMIT status(Running, i18nc("@info:status", "Synchronizing email folders"));
}
void MixedMaildirResource::retrieveItems(const Collection &col)
@@ -263,7 +263,7 @@ void MixedMaildirResource::retrieveItems(const Collection &col)
RetrieveItemsJob *job = new RetrieveItemsJob(col, mStore, this);
connect(job, &RetrieveItemsJob::result, this, &MixedMaildirResource::retrieveItemsResult);
- status(Running, i18nc("@info:status", "Synchronizing email folder %1", col.name()));
+ Q_EMIT status(Running, i18nc("@info:status", "Synchronizing email folder %1", col.name()));
}
bool MixedMaildirResource::retrieveItems(const Item::List &items, const QSet<QByteArray> &parts)
@@ -527,7 +527,7 @@ void MixedMaildirResource::retrieveItemsResult(KJob *job)
for (const Item &item : items) {
const QVariant tagListVar = tagListHash[ item.remoteId() ];
if (tagListVar.isValid()) {
- const QStringList tagList = tagListVar.value<QStringList>();
+ const QStringList tagList = tagListVar.toStringList();
if (!tagListHash.isEmpty()) {
TagContext tag;
tag.mItem = item;
@@ -650,8 +650,6 @@ void MixedMaildirResource::itemRemovedResult(KJob *job)
changeCommitted(itemJob->item());
- const QString remoteId = itemJob->item().remoteId();
-
const QVariant compactStoreVar = itemJob->property("compactStore");
if (compactStoreVar.isValid() && compactStoreVar.toBool()) {
scheduleCustomTask(this, "compactStore", QVariant());
@@ -670,7 +668,7 @@ void MixedMaildirResource::collectionAddedResult(KJob *job)
{
if (job->error() != 0) {
qCCritical(MIXEDMAILDIRRESOURCE_LOG) << job->errorString();
- status(Broken, job->errorString());
+ Q_EMIT status(Broken, job->errorString());
cancelTask(job->errorString());
return;
}
@@ -685,7 +683,7 @@ void MixedMaildirResource::collectionChangedResult(KJob *job)
{
if (job->error() != 0) {
qCCritical(MIXEDMAILDIRRESOURCE_LOG) << job->errorString();
- status(Broken, job->errorString());
+ Q_EMIT status(Broken, job->errorString());
cancelTask(job->errorString());
return;
}
diff --git a/resources/tomboynotes/o2/o0baseauth.cpp b/resources/tomboynotes/o2/o0baseauth.cpp
index 4f8063e..79ea0ac 100644
--- a/resources/tomboynotes/o2/o0baseauth.cpp
+++ b/resources/tomboynotes/o2/o0baseauth.cpp
@@ -116,7 +116,7 @@ QVariantMap O0BaseAuth::extraTokens()
return extraTokens_;
}
-void O0BaseAuth::setExtraTokens(QVariantMap extraTokens)
+void O0BaseAuth::setExtraTokens(const QVariantMap &extraTokens)
{
extraTokens_ = extraTokens;
QByteArray bytes;
diff --git a/resources/tomboynotes/o2/o0baseauth.h b/resources/tomboynotes/o2/o0baseauth.h
index 8aeb0ab..f6ba4e6 100644
--- a/resources/tomboynotes/o2/o0baseauth.h
+++ b/resources/tomboynotes/o2/o0baseauth.h
@@ -101,7 +101,7 @@ protected:
void setLinked(bool v);
/// Set extra tokens found in OAuth response
- void setExtraTokens(QVariantMap extraTokens);
+ void setExtraTokens(const QVariantMap &extraTokens);
protected:
QString clientId_;
diff --git a/resources/tomboynotes/o2/o0simplecrypt.h b/resources/tomboynotes/o2/o0simplecrypt.h
index c4a569b..07e960f 100644
--- a/resources/tomboynotes/o2/o0simplecrypt.h
+++ b/resources/tomboynotes/o2/o0simplecrypt.h
@@ -168,7 +168,7 @@ public:
a cyphertext the result. The result is a base64 encoded version of the binary array that is the
actual result of the encryption, so it can be stored easily in a text format.
*/
- QString encryptToString(QByteArray plaintext);
+ QString encryptToString(const QByteArray &plaintext);
/**
Encrypts the @arg plaintext string with the key the class was initialized with, and returns
a binary cyphertext in a QByteArray the result.
@@ -184,7 +184,7 @@ public:
This method returns a byte array, that is useable for storing a binary format. If you need
a string you can store in a text file, use encryptToString() instead.
*/
- QByteArray encryptToByteArray(QByteArray plaintext);
+ QByteArray encryptToByteArray(const QByteArray &plaintext);
/**
Decrypts a cyphertext string encrypted with this class with the set key back to the
@@ -209,7 +209,7 @@ public:
If an error occured, such as non-matching keys between encryption and decryption,
an empty string or a string containing nonsense may be returned.
*/
- QString decryptToString(QByteArray cypher);
+ QString decryptToString(const QByteArray &cypher);
/**
Decrypts a cyphertext binary encrypted with this class with the set key back to the
plain text version.
@@ -217,7 +217,7 @@ public:
If an error occured, such as non-matching keys between encryption and decryption,
an empty string or a string containing nonsense may be returned.
*/
- QByteArray decryptToByteArray(QByteArray cypher);
+ QByteArray decryptToByteArray(const QByteArray &cypher);
//enum to describe options that have been used for the encryption. Currently only one, but
//that only leaves room for future extensions like adding a cryptographic hash...
diff --git a/resources/tomboynotes/o2/o1.cpp b/resources/tomboynotes/o2/o1.cpp
index 3a91b09..bc87bdd 100644
--- a/resources/tomboynotes/o2/o1.cpp
+++ b/resources/tomboynotes/o2/o1.cpp
@@ -305,7 +305,7 @@ void O1::onTokenRequestFinished()
Q_EMIT openBrowser(url);
}
-void O1::onVerificationReceived(QMap<QString, QString> params)
+void O1::onVerificationReceived(const QMap<QString, QString> &params)
{
qCDebug(TOMBOYNOTESRESOURCE_LOG) << "O1::onVerificationReceived";
Q_EMIT closeBrowser();
diff --git a/resources/tomboynotes/o2/o1.h b/resources/tomboynotes/o2/o1.h
index 369179b..0416d63 100644
--- a/resources/tomboynotes/o2/o1.h
+++ b/resources/tomboynotes/o2/o1.h
@@ -93,7 +93,7 @@ Q_SIGNALS:
protected Q_SLOTS:
/// Handle verification received from the reply server.
- virtual void onVerificationReceived(QMap<QString, QString> params);
+ virtual void onVerificationReceived(const QMap<QString, QString> &params);
/// Handle token request error.
virtual void onTokenRequestError(QNetworkReply::NetworkError error);
diff --git a/resources/tomboynotes/o2/o2.cpp b/resources/tomboynotes/o2/o2.cpp
index a6d05e5..4b99323 100644
--- a/resources/tomboynotes/o2/o2.cpp
+++ b/resources/tomboynotes/o2/o2.cpp
@@ -55,7 +55,7 @@ static QVariantMap parseTokenResponse(const QByteArray &data)
}
/// Add query parameters to a query
-static void addQueryParametersToUrl(QUrl &url, QList<QPair<QString, QString> > parameters)
+static void addQueryParametersToUrl(QUrl &url, const QList<QPair<QString, QString> > &parameters)
{
#if QT_VERSION < 0x050000
url.setQueryItems(parameters);
diff --git a/resources/tomboynotes/o2/o2simplecrypt.cpp b/resources/tomboynotes/o2/o2simplecrypt.cpp
index 3d51206..9602a38 100644
--- a/resources/tomboynotes/o2/o2simplecrypt.cpp
+++ b/resources/tomboynotes/o2/o2simplecrypt.cpp
@@ -75,7 +75,7 @@ QByteArray O0SimpleCrypt::encryptToByteArray(const QString &plaintext)
return encryptToByteArray(plaintextArray);
}
-QByteArray O0SimpleCrypt::encryptToByteArray(QByteArray plaintext)
+QByteArray O0SimpleCrypt::encryptToByteArray(const QByteArray &plaintext)
{
if (m_keyParts.isEmpty()) {
qCWarning(TOMBOYNOTESRESOURCE_LOG) << "No key set.";
@@ -142,7 +142,7 @@ QString O0SimpleCrypt::encryptToString(const QString &plaintext)
return cypherString;
}
-QString O0SimpleCrypt::encryptToString(QByteArray plaintext)
+QString O0SimpleCrypt::encryptToString(const QByteArray &plaintext)
{
QByteArray cypher = encryptToByteArray(plaintext);
QString cypherString = QString::fromLatin1(cypher.toBase64());
@@ -158,7 +158,7 @@ QString O0SimpleCrypt::decryptToString(const QString &cyphertext)
return plaintext;
}
-QString O0SimpleCrypt::decryptToString(QByteArray cypher)
+QString O0SimpleCrypt::decryptToString(const QByteArray &cypher)
{
QByteArray ba = decryptToByteArray(cypher);
QString plaintext = QString::fromUtf8(ba.constData(), ba.size());
@@ -174,7 +174,7 @@ QByteArray O0SimpleCrypt::decryptToByteArray(const QString &cyphertext)
return ba;
}
-QByteArray O0SimpleCrypt::decryptToByteArray(QByteArray cypher)
+QByteArray O0SimpleCrypt::decryptToByteArray(const QByteArray &cypher)
{
if (m_keyParts.isEmpty()) {
qCWarning(TOMBOYNOTESRESOURCE_LOG) << "No key set.";