Commit 3fca01d4 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy error step2

parent 9cbca27d
......@@ -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)
......
......@@ -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>"));
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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());
......
......@@ -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());
......
......@@ -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;
}
......
......@@ -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));
......
......@@ -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;
......
......@@ -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();
......
......@@ -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);
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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()));
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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()
......
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