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

Allow configuration of the initial reconnect timeout



This enables testing of the reconnect functionality - the test can
complete quicker.
Signed-off-by: Krzysztof Nowicki's avatarKrzysztof Nowicki <krissn@op.pl>
parent 7a8246ef
......@@ -81,6 +81,7 @@ EwsResource::EwsResource(const QString &id)
, mAuthStage(AuthIdle)
, mTagsRetrieved(false)
, mReconnectTimeout(InitialReconnectTimeout)
, mInitialReconnectTimeout(InitialReconnectTimeout)
, mSettings(new EwsSettings(winIdForDialogs()))
{
mEwsClient.setUserAgent(mSettings->userAgent());
......@@ -214,7 +215,7 @@ void EwsResource::rootFolderFetchFinished(KJob *job)
mRootCollection.setRemoteRevision(id.changeKey());
qCDebug(EWSRES_LOG) << "Root folder is " << id;
emitReadyStatus();
mReconnectTimeout = InitialReconnectTimeout;
mReconnectTimeout = mInitialReconnectTimeout;
if (mSettings->serverSubscription()) {
mSubManager.reset(new EwsSubscriptionManager(mEwsClient, id, mSettings.data(), this));
......@@ -1407,4 +1408,9 @@ void EwsResource::adjustRootCollectionName(const QString &newName)
}
}
void EwsResource::setInitialReconnectTimeout(int timeout)
{
mInitialReconnectTimeout = mReconnectTimeout = timeout;
}
AKONADI_RESOURCE_MAIN(EwsResource)
......@@ -75,6 +75,7 @@ public Q_SLOTS:
Q_SCRIPTABLE void clearFolderSyncState(const QString &folderId);
Q_SCRIPTABLE void clearFolderSyncState();
Q_SCRIPTABLE void clearFolderTreeSyncState();
Q_SCRIPTABLE void setInitialReconnectTimeout(int timeout);
protected Q_SLOTS:
void retrieveCollections() override;
void retrieveItems(const Akonadi::Collection &collection) override;
......@@ -154,6 +155,7 @@ private:
bool mTagsRetrieved = false;
int mReconnectTimeout;
int mInitialReconnectTimeout;
EwsTagStore *mTagStore = nullptr;
QScopedPointer<EwsSettings> mSettings;
};
......
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