Commit e9a0697b authored by Krzysztof Nowicki's avatar Krzysztof Nowicki Committed by Laurent Montel
Browse files

Fix clazy warnings (-Wclazy-overloaded-signal)

parent 898760ab
/*
SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -40,8 +40,8 @@ public:
void start() override;
Q_SIGNALS:
void status(int status, const QString &message = QString());
void percent(int progress);
void reportStatus(int status, const QString &message = QString());
void reportPercent(int progress);
private:
Akonadi::Collection::List mChangedFolders;
......
/*
SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -35,8 +35,8 @@ public:
void start() override;
Q_SIGNALS:
void status(int status, const QString &message = QString());
void percent(int progress);
void reportStatus(int status, const QString &message = QString());
void reportPercent(int progress);
private:
Akonadi::Collection::List mFolders;
......
......@@ -51,7 +51,7 @@ void EwsFetchItemPayloadJob::start()
return req->responses();
},
[this](unsigned int progress) {
Q_EMIT percent(progress);
Q_EMIT reportPercent(progress);
},
[this](bool success, const QString &error) {
itemFetchFinished(success, error);
......
......@@ -27,8 +27,8 @@ public:
}
void start() override;
Q_SIGNALS:
void status(int status, const QString &message = QString());
void percent(int progress);
void reportStatus(int status, const QString &message = QString());
void reportPercent(int progress);
private:
void itemFetchFinished(bool success, const QString &error);
......
/*
SPDX-FileCopyrightText: 2015-2019 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -98,8 +98,8 @@ EwsFetchItemsJob::~EwsFetchItemsJob()
void EwsFetchItemsJob::start()
{
Q_EMIT status(AgentBase::Running, i18nc("@info:status", "Retrieving %1 item list", mCollection.name()));
Q_EMIT percent(0);
Q_EMIT reportStatus(AgentBase::Running, i18nc("@info:status", "Retrieving %1 item list", mCollection.name()));
Q_EMIT reportPercent(0);
/* Begin stage 1 - query item list from local and remote side. */
auto syncItemsReq = new EwsSyncFolderItemsRequest(mClient, this);
......@@ -211,9 +211,9 @@ void EwsFetchItemsJob::remoteItemFetchDone(KJob *job)
}
const auto totalItems = mRemoteAddedItems.size() + mRemoteChangedItems.size() + mRemoteDeletedIds.size() + mRemoteFlagChangedIds.size();
if (!mLocalItems.empty()) {
Q_EMIT percent(qMin(totalItems * 50 / mLocalItems.size(), 50));
Q_EMIT reportPercent(qMin(totalItems * 50 / mLocalItems.size(), 50));
}
Q_EMIT status(AgentBase::Running, i18nc("@info:status", "Retrieving %1 item list (%2 items)", mCollection.name(), totalItems));
Q_EMIT reportStatus(AgentBase::Running, i18nc("@info:status", "Retrieving %1 item list (%2 items)", mCollection.name(), totalItems));
}
}
......@@ -389,7 +389,7 @@ void EwsFetchItemsJob::compareItemLists()
qCDebugNC(EWSRES_LOG)
<< QStringLiteral("Changed %2, deleted %3, new %4").arg(mRemoteChangedItems.size()).arg(mDeletedItems.size()).arg(mRemoteAddedItems.size());
Q_EMIT status(AgentBase::Running, i18nc("@info:status", "Retrieving %1 items", mCollection.name()));
Q_EMIT reportStatus(AgentBase::Running, i18nc("@info:status", "Retrieving %1 items", mCollection.name()));
bool fetch = false;
for (const auto &iType : toFetchItems.keys()) {
......@@ -437,7 +437,7 @@ void EwsFetchItemsJob::itemDetailFetchDone(KJob *job)
}
mTotalItemsFetched = mChangedItems.size();
Q_EMIT percent(50 + (mTotalItemsFetched * 50) / mTotalItemsToFetch);
Q_EMIT reportPercent(50 + (mTotalItemsFetched * 50) / mTotalItemsToFetch);
if (subjobs().isEmpty()) {
emitResult();
......
/*
SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -74,8 +74,8 @@ private Q_SLOTS:
void checkedItemsFetchFinished(KJob *job);
void tagSyncFinished(KJob *job);
Q_SIGNALS:
void status(int status, const QString &message = QString());
void percent(int progress);
void reportStatus(int status, const QString &message = QString());
void reportPercent(ulong progress);
private:
void compareItemLists();
......
/*
SPDX-FileCopyrightText: 2015-2019 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -73,11 +73,11 @@ void EwsModifyItemFlagsJob::start()
EwsItemHandler *handler = EwsItemHandler::itemHandler(static_cast<EwsItemType>(type));
EwsModifyItemJob *job = handler->modifyItemJob(mClient, items[type], QSet<QByteArray>() << "FLAGS", this);
connect(job, &EwsModifyItemJob::result, this, &EwsModifyItemFlagsJob::itemModifyFinished);
connect(job, &EwsModifyItemJob::status, this, [this](int s, const QString &message) {
Q_EMIT status(s, message);
connect(job, &EwsModifyItemJob::reportStatus, this, [this](int s, const QString &message) {
Q_EMIT reportStatus(s, message);
});
connect(job, &EwsModifyItemJob::percent, this, [this](int p) {
Q_EMIT percent(p);
connect(job, &EwsModifyItemJob::reportPercent, this, [this](int p) {
Q_EMIT reportPercent(p);
});
addSubjob(job);
......
/*
SPDX-FileCopyrightText: 2015-2019 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -32,8 +32,8 @@ public:
void start() override;
Q_SIGNALS:
void status(int status, const QString &message = QString());
void percent(int progress);
void reportStatus(int status, const QString &message = QString());
void reportPercent(int progress);
protected:
Akonadi::Item::List mItems;
......
/*
SPDX-FileCopyrightText: 2015-2019 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -22,8 +22,8 @@ public:
const Akonadi::Item::List &items() const;
Q_SIGNALS:
void status(int status, const QString &message = QString());
void percent(int progress);
void reportStatus(int status, const QString &message = QString());
void reportPercent(int progress);
protected:
Akonadi::Item::List mItems;
......
......@@ -303,10 +303,12 @@ void EwsResource::doRetrieveCollections()
if (mFolderSyncState.isEmpty()) {
auto job = new EwsFetchFoldersJob(mEwsClient, mRootCollection, this);
connect(job, &EwsFetchFoldersJob::result, this, &EwsResource::fetchFoldersJobFinished);
connectStatusSignals(job);
job->start();
} else {
auto job = new EwsFetchFoldersIncrJob(mEwsClient, mFolderSyncState, mRootCollection, this);
connect(job, &EwsFetchFoldersIncrJob::result, this, &EwsResource::fetchFoldersIncrJobFinished);
connectStatusSignals(job);
job->start();
}
}
......@@ -1429,10 +1431,10 @@ void EwsResource::setInitialReconnectTimeout(int timeout)
template<class Job>
void EwsResource::connectStatusSignals(Job *job)
{
connect(job, &Job::status, this, [this](int s, const QString &message) {
connect(job, &Job::reportStatus, this, [this](int s, const QString &message) {
Q_EMIT status(s, message);
});
connect(job, &Job::percent, this, [this](int p) {
connect(job, &Job::reportPercent, this, [this](int p) {
Q_EMIT percent(p);
});
}
......
/*
SPDX-FileCopyrightText: 2015-2019 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -72,7 +72,7 @@ void EwsModifyMailJob::start()
return req->responses();
},
[this](unsigned int progress) {
Q_EMIT percent(progress);
Q_EMIT reportPercent(progress);
},
[this](bool success, const QString &error) {
updateItemsFinished(success, error);
......
/*
SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -145,7 +145,7 @@ void EwsUpdateItemsTagsJob::doUpdateItemsTags()
return req->responses();
},
[this](unsigned int progress) {
Q_EMIT percent(progress);
Q_EMIT reportPercent(progress);
},
[this](bool success, const QString &error) {
updateItemsTagsRequestFinished(success, error);
......
/*
SPDX-FileCopyrightText: 2015-2016 Krzysztof Nowicki <krissn@op.pl>
SPDX-FileCopyrightText: 2015-2020 Krzysztof Nowicki <krissn@op.pl>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
......@@ -46,8 +46,8 @@ private Q_SLOTS:
void globalTagsWriteFinished(KJob *job);
Q_SIGNALS:
void status(int status, const QString &message = QString());
void percent(int progress);
void reportStatus(int status, const QString &message = QString());
void reportPercent(int progress);
private:
void updateItemsTagsRequestFinished(bool success, const QString &error);
......
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