[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/pim/akonadi/exchangews/exchange/types
From:       Roman Jarosz <kedgedev () gmail ! com>
Date:       2013-01-22 21:46:18
Message-ID: 20130122214618.6825AAC86C () svn ! kde ! org
[Download RAW message or body]

SVN commit 1334543 by rjarosz:

calendar item++


 M  +26 -11    tcalendaritem.cpp  
 M  +3 -3      tcalendaritem.h  
 M  +1 -1      tdatetime.cpp  


--- trunk/playground/pim/akonadi/exchangews/exchange/types/tcalendaritem.cpp \
#1334542:1334543 @@ -38,12 +38,19 @@
 
     mLocation = event->location();
     mDateTimeCreated = event->created();
+    mLastModifiedTime = event->lastModified();
 
     mBody = event->description();
     mBody.setType((event->descriptionIsRich()) ? "HTML" : "Text");
 
     mOrganizer = TRecipient(event->organizer());
 
+    if (event->transparency() == KCalCore::Event::Transparent) {
+        mLegacyFreeBusyStatus = "Free";
+    } else {
+        mLegacyFreeBusyStatus = "Busy";
+    }
+
     foreach (KCalCore::Attendee::Ptr attendee, event->attendees()) {
         switch (attendee->role()) {
         case KCalCore::Attendee::ReqParticipant:
@@ -116,10 +123,16 @@
     }
     event->setLocation(mLocation);
     event->setCreated(KDateTime(mDateTimeCreated));
-    event->setLastModified(KDateTime(mDateTimeCreated)); //FIXME:
+    if (!mDateTimeCreated.isNull()) \
event->setLastModified(KDateTime(mDateTimeCreated));  event->setDescription(mBody, \
(mBody.type() == "HTML"));  event->setOrganizer(mOrganizer.getPerson());
 
+    if (mLegacyFreeBusyStatus == "Free") {
+        event->setTransparency(KCalCore::Event::Transparent);
+    } else {
+        event->setTransparency(KCalCore::Event::Opaque);
+    }
+
     foreach (const TAttendee& a, mRequiredAttendees) {
         KCalCore::Attendee::Ptr attendee = a.getAttendee();
         attendee->setRole(KCalCore::Attendee::ReqParticipant);
@@ -165,7 +178,9 @@
 
     {
         QString myResponseType = mMyResponseType;
-        if (myResponseType == "Unknown") {
+        if (mIsCancelled) {
+            event->setStatus(KCalCore::Incidence::StatusCanceled);
+        } else if (myResponseType == "Unknown") {
             event->setStatus(KCalCore::Incidence::StatusNone);
         } else if (myResponseType == "Organizer") {
             event->setStatus(KCalCore::Incidence::StatusNone);
@@ -232,11 +247,11 @@
         else if (End.equals(e)) mEnd.read(e);
         //else if (OriginalStart.equals(e)) mOriginalStart.read(e);
         else if (IsAllDayEvent.equals(e)) mIsAllDayEvent.read(e);
-        //else if (LegacyFreeBusyStatus.equals(e)) mLegacyFreeBusyStatus.read(e);
+        else if (LegacyFreeBusyStatus.equals(e)) mLegacyFreeBusyStatus.read(e);
         else if (Location.equals(e)) mLocation.read(e);
         //else if (When.equals(e)) mWhen.read(e);
         //else if (IsMeeting.equals(e)) mIsMeeting.read(e);
-        //else if (IsCancelled.equals(e)) mIsCancelled.read(e);
+        else if (IsCancelled.equals(e)) mIsCancelled.read(e);
         //else if (IsRecurring.equals(e)) mIsRecurring.read(e);
         //else if (MeetingRequestWasSent.equals(e)) mMeetingRequestWasSent.read(e);
         //else if (IsResponseRequested.equals(e)) mIsResponseRequested.read(e);
@@ -270,7 +285,7 @@
         //else if (NetShowUrl.equals(e)) mNetShowUrl.read(e);
         //else if (EffectiveRights.equals(e)) mEffectiveRights.read(e);
         //else if (LastModifiedName.equals(e)) mLastModifiedName.read(e);
-        //else if (LastModifiedTime.equals(e)) mLastModifiedTime.read(e);
+        else if (LastModifiedTime.equals(e)) mLastModifiedTime.read(e);
         //else if (IsAssociated.equals(e)) mIsAssociated.read(e);
         //else if (WebClientReadFormQueryString.equals(e)) \
                mWebClientReadFormQueryString.read(e);
         //else if (WebClientEditFormQueryString.equals(e)) \
mWebClientEditFormQueryString.read(e); @@ -364,11 +379,11 @@
     writeUpdateItem(stream, mEnd, End);
     //writeUpdateItem(stream, mOriginalStart, OriginalStart);
     writeUpdateItem(stream, mIsAllDayEvent, IsAllDayEvent);
-    //writeUpdateItem(stream, mLegacyFreeBusyStatus, LegacyFreeBusyStatus);
+    writeUpdateItem(stream, mLegacyFreeBusyStatus, LegacyFreeBusyStatus);
     writeUpdateItem(stream, mLocation, Location);
     //writeUpdateItem(stream, mWhen, When);
     //writeUpdateItem(stream, mIsMeeting, IsMeeting);
-    //writeUpdateItem(stream, mIsCancelled, IsCancelled);
+    writeUpdateItem(stream, mIsCancelled, IsCancelled);
     //writeUpdateItem(stream, mIsRecurring, IsRecurring);
     //writeUpdateItem(stream, mMeetingRequestWasSent, MeetingRequestWasSent);
     //writeUpdateItem(stream, mIsResponseRequested, IsResponseRequested);
@@ -402,7 +417,7 @@
     //writeUpdateItem(stream, mNetShowUrl, NetShowUrl);
     //writeUpdateItem(stream, mEffectiveRights, EffectiveRights);
     //writeUpdateItem(stream, mLastModifiedName, LastModifiedName);
-    //writeUpdateItem(stream, mLastModifiedTime, LastModifiedTime);
+    //READONLY writeUpdateItem(stream, mLastModifiedTime, LastModifiedTime);
     //writeUpdateItem(stream, mIsAssociated, IsAssociated);
     //writeUpdateItem(stream, mWebClientReadFormQueryString, \
                WebClientReadFormQueryString);
     //writeUpdateItem(stream, mWebClientEditFormQueryString, \
WebClientEditFormQueryString); @@ -452,11 +467,11 @@
     mEnd.write(stream, End);
     //mOriginalStart.write(stream, OriginalStart);
     mIsAllDayEvent.write(stream, IsAllDayEvent);
-    //mLegacyFreeBusyStatus.write(stream, LegacyFreeBusyStatus);
+    mLegacyFreeBusyStatus.write(stream, LegacyFreeBusyStatus);
     mLocation.write(stream, Location);
     //mWhen.write(stream, When);
     //mIsMeeting.write(stream, IsMeeting);
-    //mIsCancelled.write(stream, IsCancelled);
+    mIsCancelled.write(stream, IsCancelled);
     //mIsRecurring.write(stream, IsRecurring);
     //mMeetingRequestWasSent.write(stream, MeetingRequestWasSent);
     //mIsResponseRequested.write(stream, IsResponseRequested);
@@ -490,7 +505,7 @@
     //mNetShowUrl.write(stream, NetShowUrl);
     //mEffectiveRights.write(stream, EffectiveRights);
     //mLastModifiedName.write(stream, LastModifiedName);
-    //mLastModifiedTime.write(stream, LastModifiedTime);
+    //READONLY mLastModifiedTime.write(stream, LastModifiedTime);
     //mIsAssociated.write(stream, IsAssociated);
     //mWebClientReadFormQueryString.write(stream, WebClientReadFormQueryString);
     //mWebClientEditFormQueryString.write(stream, WebClientEditFormQueryString);
--- trunk/playground/pim/akonadi/exchangews/exchange/types/tcalendaritem.h \
#1334542:1334543 @@ -69,11 +69,11 @@
     TDateTime mEnd; //Represents the end of a duration. This element only applies to \
                a single occurrence of a calendar item.
     //TDateTime mOriginalStart; //Represents the original start time of a calendar \
                item.
     TBoolean mIsAllDayEvent; //Indicates whether a calendar item or meeting request \
                represents an all-day event.
-    //TString mLegacyFreeBusyStatus; //Represents the free/busy status of the \
calendar item. +    TString mLegacyFreeBusyStatus; //Represents the free/busy status \
                of the calendar item.
     TString mLocation; //Represents the location of a meeting or appointment.
     //TString mWhen; //Provides information about when a calendar item occurs.
     //TBoolean mIsMeeting; //Indicates whether the calendar item is a meeting or \
                appointment.
-    //TBoolean mIsCancelled; //Indicates whether an appointment or meeting has been \
canceled. +    TBoolean mIsCancelled; //Indicates whether an appointment or meeting \
                has been canceled.
     //TBoolean mIsRecurring; //Indicates whether a calendar item is part of a \
                recurring item. This element is read-only.
     //TBoolean mMeetingRequestWasSent; //Indicates whether a meeting request has \
                been sent to requested attendees.
     //TBoolean mIsResponseRequested; //Indicates whether a response to an item is \
required. @@ -107,7 +107,7 @@
     //TString mNetShowUrl; //Specifies the URL for a Microsoft NetShow online \
                meeting.
     //T mEffectiveRights; //Contains the client's rights based on the permission \
                settings for the item or folder. This element is read-only.
     //TString mLastModifiedName; //Contains the display name of the last user to \
                modify an item.
-    //TBoolean mLastModifiedTime; //Indicates when an item was last modified.
+    TDateTime mLastModifiedTime; //Indicates when an item was last modified.
     //TBoolean mIsAssociated; //Indicates whether the item is associated with a \
                folder.
     //TString mWebClientReadFormQueryString; //Represents a URL to concatenate to \
                the Microsoft Office Outlook Web App endpoint to read an item in \
                Outlook Web App.
     //TString mWebClientEditFormQueryString; //Represents a URL to concatenate to \
                the Microsoft Office Outlook Web App endpoint to edit an item in \
                Outlook Web App.
--- trunk/playground/pim/akonadi/exchangews/exchange/types/tdatetime.cpp \
#1334542:1334543 @@ -19,7 +19,7 @@
 
 bool TDateTime::isNull() const
 {
-    return mDateTime.isNull();
+    return (mDateTime.isNull() || !mDateTime.isValid());
 }
 
 void TDateTime::read(QDomElement& root)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic