Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[buteo-sync-plugin-carddav] Use proper enum type. Contributes to JB#3…
…1584
  • Loading branch information
pvuorela committed Apr 9, 2021
1 parent 8db3781 commit beff4d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
14 changes: 4 additions & 10 deletions src/carddavclient.cpp
Expand Up @@ -58,7 +58,7 @@ void CardDavClient::connectivityStateChanged(Sync::ConnectivityType aType, bool
LOG_DEBUG("Received connectivity change event:" << aType << " changed to " << aState);
if (aType == Sync::CONNECTIVITY_INTERNET && !aState) {
// we lost connectivity during sync.
abortSync(Sync::SYNC_CONNECTION_ERROR);
abortSync(Buteo::SyncResults::CONNECTION_ERROR);
}
}

Expand Down Expand Up @@ -112,20 +112,14 @@ void CardDavClient::syncFailed()
syncFinished(Buteo::SyncResults::INTERNAL_ERROR, QString());
}

void CardDavClient::abortSync(Sync::SyncStatus aStatus)
{
FUNCTION_CALL_TRACE;
abort(aStatus);
}

void CardDavClient::abort(Sync::SyncStatus status)
void CardDavClient::abortSync(Buteo::SyncResults::MinorCode code)
{
FUNCTION_CALL_TRACE;
m_syncer->abortSync();
syncFinished(status, QStringLiteral("Sync aborted"));
syncFinished(code, QStringLiteral("Sync aborted"));
}

void CardDavClient::syncFinished(int minorErrorCode, const QString &message)
void CardDavClient::syncFinished(Buteo::SyncResults::MinorCode minorErrorCode, const QString &message)
{
FUNCTION_CALL_TRACE;

Expand Down
5 changes: 2 additions & 3 deletions src/carddavclient.h
Expand Up @@ -46,7 +46,6 @@ class Q_DECL_EXPORT CardDavClient : public Buteo::ClientPlugin
bool init();
bool uninit();
bool startSync();
void abortSync(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
Buteo::SyncResults getSyncResults() const;
bool cleanUp();

Expand All @@ -58,8 +57,8 @@ private Q_SLOTS:
void syncFailed();

private:
void abort(Sync::SyncStatus aStatus = Sync::SYNC_ABORTED);
void syncFinished(int minorErrorCode, const QString &message);
void abortSync(Buteo::SyncResults::MinorCode code);
void syncFinished(Buteo::SyncResults::MinorCode minorErrorCode, const QString &message);
Buteo::SyncProfile::SyncDirection syncDirection();
Buteo::SyncProfile::ConflictResolutionPolicy conflictResolutionPolicy();

Expand Down

0 comments on commit beff4d7

Please sign in to comment.