Commit 22aac883 authored by flypig's avatar flypig

Merge branch 'jb52608' into 'master'

Combines various fixes to try to avoid sync errors blocking a sync from completing, and duplication of events

See merge request !84
parents 5ea2533c e5802286
......@@ -67,6 +67,13 @@ private:
Owner = 4
};
enum SyncFailure {
NoSyncFailure,
UploadFailure,
UpdateFailure,
DeleteFailure
};
struct UpsyncChange {
UpsyncChange() : upsyncType(NoChange) {}
QString accessToken;
......@@ -112,6 +119,7 @@ private:
const QString &calendarId, const QString &syncToken,
const QString &nextSyncToken, const QDateTime &since);
void clampEventTimeToSync(KCalendarCore::Event::Ptr event) const;
bool isCleanSync(const QString &calendarId) const;
static void setCalendarProperties(mKCal::Notebook::Ptr notebook,
const CalendarInfo &calendarInfo,
......@@ -128,6 +136,33 @@ private:
void handleInsertModifyReply(QNetworkReply *reply);
void performSequencedUpsyncs(const QNetworkReply *reply);
KCalendarCore::Event::Ptr addDummyParent(const QJsonObject &eventData,
const QString &parentId,
const mKCal::Notebook::Ptr googleNotebook);
bool applyRemoteDelete(const QString &eventId,
QMap<QString, KCalendarCore::Event::Ptr> &allLocalEventsMap);
bool applyRemoteDeleteOccurence(const QString &eventId,
const QJsonObject &eventData,
QMap<QString, KCalendarCore::Event::Ptr> &allLocalEventsMap);
bool applyRemoteModify(const QString &eventId,
const QJsonObject &eventData,
const QString &calendarId,
QMap<QString, KCalendarCore::Event::Ptr> &allLocalEventsMap);
bool applyRemoteInsert(const QString &eventId,
const QJsonObject &eventData,
const QString &calendarId,
const QHash<QString, QString> &upsyncedUidMapping,
QMap<QString, KCalendarCore::Event::Ptr> &allLocalEventsMap);
void flagUploadFailure(const QString &kcalEventId);
void flagUploadSuccess(const QString &kcalEventId);
void flagUpdateSuccess(const QString &kcalEventId);
void flagDeleteFailure(const QString &kcalEventId);
void applySyncFailureFlag(KCalendarCore::Event::Ptr event, SyncFailure flag);
void applySyncFailureFlags();
private Q_SLOTS:
void calendarsFinishedHandler();
void eventsFinishedHandler();
......@@ -162,6 +197,7 @@ private:
// parent upsync, as recorded in UpsyncChange::eventId
QMultiHash<QString, UpsyncChange> m_sequenced;
int m_collisionErrorCount;
QMap<QString, SyncFailure> m_eventSyncFlags;
};
#endif // GOOGLECALENDARSYNCADAPTOR_H
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