Commit f3178341 authored by flypig's avatar flypig

Merge branch 'failures' into 'master'

[nemo-qml-plugin-calendar] Expose sync failures to events.

See merge request !61
parents dfeee3d6 4f8c1ce4
Name: nemo-qml-plugin-calendar-qt5
Summary: Calendar plugin for Nemo Mobile
Version: 0.5.10
Version: 0.5.17
Release: 1
Group: System/Libraries
License: BSD
......
......@@ -43,6 +43,7 @@ struct Event {
CalendarEvent::Secrecy secrecy;
QString calendarUid;
CalendarEvent::Response ownerStatus = CalendarEvent::ResponseUnspecified;
CalendarEvent::SyncFailure syncFailure = CalendarEvent::NoSyncFailure;
bool operator==(const Event& other) const
{
......
......@@ -176,6 +176,11 @@ CalendarEvent::Secrecy CalendarEvent::secrecy() const
return mManager->getEvent(mUniqueId, mRecurrenceId).secrecy;
}
CalendarEvent::SyncFailure CalendarEvent::syncFailure() const
{
return mManager->getEvent(mUniqueId, mRecurrenceId).syncFailure;
}
CalendarEvent::Response CalendarEvent::ownerStatus() const
{
return mManager->getEvent(mUniqueId, mRecurrenceId).ownerStatus;
......
......@@ -68,6 +68,7 @@ class CalendarEvent : public QObject
Q_PROPERTY(QString calendarUid READ calendarUid NOTIFY calendarUidChanged)
Q_PROPERTY(QString location READ location NOTIFY locationChanged)
Q_PROPERTY(CalendarEvent::Secrecy secrecy READ secrecy NOTIFY secrecyChanged)
Q_PROPERTY(CalendarEvent::SyncFailure syncFailure READ syncFailure NOTIFY syncFailureChanged)
Q_PROPERTY(CalendarEvent::Response ownerStatus READ ownerStatus NOTIFY ownerStatusChanged)
Q_PROPERTY(bool rsvp READ rsvp NOTIFY rsvpChanged)
Q_PROPERTY(bool externalInvitation READ externalInvitation NOTIFY externalInvitationChanged)
......@@ -121,6 +122,14 @@ public:
ResponseDecline
};
enum SyncFailure {
NoSyncFailure,
UploadFailure,
UpdateFailure,
DeleteFailure
};
Q_ENUM(SyncFailure)
CalendarEvent(CalendarManager *manager, const QString &uid, const KDateTime &recurrenceId);
~CalendarEvent();
......@@ -146,6 +155,7 @@ public:
KDateTime recurrenceId() const;
QString recurrenceIdString() const;
Secrecy secrecy() const;
SyncFailure syncFailure() const;
Response ownerStatus() const;
bool rsvp() const;
bool externalInvitation() const;
......@@ -173,6 +183,7 @@ signals:
void hasRecurEndDateChanged();
void recurWeeklyDaysChanged();
void secrecyChanged();
void syncFailureChanged();
void ownerStatusChanged();
void rsvpChanged();
void externalInvitationChanged();
......
......@@ -815,6 +815,14 @@ CalendarData::Event CalendarWorker::createEventStruct(const KCalCore::Event::Ptr
event.readOnly = mStorage->notebook(event.calendarUid)->isReadOnly();
event.recur = CalendarUtils::convertRecurrence(e);
event.recurWeeklyDays = CalendarUtils::convertDayPositions(e);
const QString &syncFailure = e->customProperty("VOLATILE", "SYNC-FAILURE");
if (syncFailure.compare("upload", Qt::CaseInsensitive) == 0) {
event.syncFailure = CalendarEvent::UploadFailure;
} else if (syncFailure.compare("update", Qt::CaseInsensitive) == 0) {
event.syncFailure = CalendarEvent::UpdateFailure;
} else if (syncFailure.compare("delete", Qt::CaseInsensitive) == 0) {
event.syncFailure = CalendarEvent::DeleteFailure;
}
bool externalInvitation = false;
const QString &calendarOwnerEmail = getNotebookAddress(e);
......
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