Commit 4b24843e authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Fix a bunch of clazy warning in the Ews resources

* QList -> QVector for EwsId::List
* QTimer::singleShot add this
parent f0c467ff
Pipeline #70925 failed with stage
in 18 minutes and 22 seconds
......@@ -39,7 +39,7 @@ public:
Unspecified,
};
typedef QList<EwsId> List;
typedef QVector<EwsId> List;
explicit EwsId(EwsDistinguishedId did)
: mType(Distinguished)
......
......@@ -276,7 +276,7 @@ void EwsResource::rootCollectionFetched(KJob *job)
} else {
auto fetchJob = qobject_cast<CollectionFetchJob *>(job);
if (fetchJob && !fetchJob->collections().isEmpty()) {
mRootCollection = fetchJob->collections().first();
mRootCollection = fetchJob->collections().at(0);
adjustRootCollectionName(name());
qCDebugNC(EWSRES_LOG) << QStringLiteral("Root collection fetched: ") << mRootCollection;
}
......@@ -1058,7 +1058,7 @@ void EwsResource::foldersModifiedCollectionSyncFinished(KJob *job)
}
auto fetchJob = qobject_cast<CollectionFetchJob *>(job);
synchronizeCollection(fetchJob->collections()[0].id());
synchronizeCollection(fetchJob->collections().at(0).id());
}
void EwsResource::folderTreeModifiedEvent()
......@@ -1356,7 +1356,7 @@ void EwsResource::requestAuthFailed()
qCWarningNC(EWSRES_LOG) << "requestAuthFailed - going offline";
if (mAuthStage == 0) {
QTimer::singleShot(0, [&]() {
QTimer::singleShot(0, this, [&]() {
setTemporaryOffline(reconnectTimeout());
});
Q_EMIT status(Broken, i18nc("@info:status", "Authentication failed"));
......
......@@ -297,7 +297,8 @@ void EwsSubscriptionManager::processEvents(EwsEventRequestBase *req, bool finish
}
if (!mUpdatedFolderIds.isEmpty()) {
qCDebugNC(EWSRES_LOG) << QStringLiteral("Found %1 modified folders").arg(mUpdatedFolderIds.size());
Q_EMIT foldersModified(mUpdatedFolderIds.values());
const auto updated = mUpdatedFolderIds.values();
Q_EMIT foldersModified(EwsId::List(updated.cbegin(), updated.cend()));
mUpdatedFolderIds.clear();
}
}
......
......@@ -222,7 +222,7 @@ void UtEwsSettings::readNoPassword()
password = p;
loop.exit(0);
});
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.requestPassword(false);
if (!wallet) {
qDebug() << "Wallet is null";
......@@ -319,7 +319,7 @@ void UtEwsSettings::readTimeout()
password = p;
loop.exit(0);
});
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.requestPassword(false);
if (!wallet) {
qDebug() << "Wallet is null";
......@@ -380,7 +380,7 @@ void UtEwsSettings::readTimeoutInterrupted()
loop.exit(1);
}
});
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.requestPassword(false);
if (!wallet) {
qDebug() << "Wallet is null";
......@@ -395,7 +395,7 @@ void UtEwsSettings::readTimeoutInterrupted()
return false;
};
});
QTimer::singleShot(1000, [&]() {
QTimer::singleShot(1000, this, [&]() {
settings.setTestPassword(QStringLiteral("foo"));
});
QTimer timeoutTimer;
......@@ -443,7 +443,7 @@ void UtEwsSettings::readValidPassword()
password = p;
loop.exit(0);
});
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.requestPassword(false);
if (!wallet) {
qDebug() << "Wallet is null";
......@@ -503,7 +503,7 @@ void UtEwsSettings::writeNullPassword()
};
EwsSettings settings(0);
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.setPassword(QString());
if (wallet) {
qDebug() << "Wallet is not null";
......@@ -543,7 +543,7 @@ void UtEwsSettings::writeNullWallet()
};
EwsSettings settings(0);
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.setPassword(QStringLiteral("foo"));
if (wallet) {
qDebug() << "Wallet is not null";
......@@ -588,7 +588,7 @@ void UtEwsSettings::writeTimeout()
bool setFolderCalled = false;
QString password;
EwsSettings settings(0);
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.setPassword(QStringLiteral("foo"));
if (!wallet) {
qDebug() << "Wallet is null";
......@@ -654,7 +654,7 @@ void UtEwsSettings::writeValidPassword()
bool setFolderCalled = false;
QString password;
EwsSettings settings(0);
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.setPassword(QStringLiteral("foo"));
if (!wallet) {
qDebug() << "Wallet is null";
......@@ -728,7 +728,7 @@ void UtEwsSettings::readValidMap()
map = m;
loop.exit(0);
});
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.requestMap();
if (!wallet) {
qDebug() << "Wallet is null";
......@@ -794,7 +794,7 @@ void UtEwsSettings::writeValidMap()
const QMap<QString, QString> expectedMap = {{accessTokenMapKey, QStringLiteral("afoo")}, {refreshTokenMapKey, QStringLiteral("rfoo")}};
QMap<QString, QString> map;
EwsSettings settings(0);
QTimer::singleShot(100, [&]() {
QTimer::singleShot(100, this, [&]() {
settings.setMap(expectedMap);
if (!wallet) {
qDebug() << "Wallet is null";
......
Supports Markdown
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