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

List:       kde-commits
Subject:    proko2: kdepim/kresources/kolab/kcal
From:       Bo Thorsen <bo () sonofthor ! dk>
Date:       2004-10-27 12:06:38
Message-ID: 20041027120638.29E9C16BC9 () office ! kde ! org
[Download RAW message or body]

CVS commit by thorsen: 

Support the scheduling ID scheme


  M +22 -0     incidence.cpp   1.1.2.26
  M +4 -0      incidence.h   1.1.2.13


--- kdepim/kresources/kolab/kcal/incidence.cpp  #1.1.2.25:1.1.2.26
@@ -147,4 +147,14 @@ const QValueList<Incidence::Attendee>& I
 }
 
+void Incidence::setSchedulingID( const QString& sid )
+{
+  mSchedulingID = sid;
+}
+
+QString Incidence::schedulingID() const
+{
+  return mSchedulingID;
+}
+
 bool Incidence::loadAttendeeAttribute( QDomElement& element,
                                        Attendee& attendee )
@@ -306,4 +316,6 @@ bool Incidence::loadAttribute( QDomEleme
     // Alarms should be minutes before. Libkcal uses event time + alarm time
     setAlarm( - element.text().toInt() );
+  else if ( tagName == "scheduling-id" )
+    setSchedulingID( element.text() );
   else if ( tagName == "x-custom" )
     loadCustomAttributes( element );
@@ -345,4 +357,5 @@ bool Incidence::saveAttributes( QDomElem
     writeString( element, "alarm", QString::number( alarmTime ) );
   }
+  writeString( element, "scheduling-id", schedulingID() );
   saveCustomAttributes( element );
   return true;
@@ -607,4 +620,11 @@ void Incidence::setFields( const KCal::I
   }
 
+  // Handle the scheduling ID
+  if ( incidence->schedulingID() == incidence->uid() )
+    // There is no scheduling ID
+    setSchedulingID( QString::null );
+  else
+    setSchedulingID( incidence->schedulingID() );
+
   // Unhandled tags and other custom properties (see libkcal/customproperties.h)
   const QMap<QCString, QString> map = incidence->customProperties();
@@ -729,4 +749,6 @@ void Incidence::saveTo( KCal::Incidence*
   }
 
+  incidence->setSchedulingID( schedulingID() );
+
   for( QValueList<Custom>::ConstIterator it = mCustomList.begin(); it != mCustomList.end(); ++it ) {
     incidence->setNonKDECustomProperty( (*it).key, (*it).value );

--- kdepim/kresources/kolab/kcal/incidence.h  #1.1.2.12:1.1.2.13
@@ -102,4 +102,7 @@ public:
   const QValueList<Attendee>& attendees() const;
 
+  virtual void setSchedulingID( const QString& sid );
+  virtual QString schedulingID() const;
+
   // Load the attributes of this class
   virtual bool loadAttribute( QDomElement& );
@@ -137,4 +140,5 @@ protected:
   QValueList<Attendee> mAttendees;
   QValueList<KCal::Attachment*> mAttachments;
+  QString mSchedulingID;
 
   struct Custom {


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

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