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

List:       kde-commits
Subject:    KDE/kdepim/korganizer
From:       David Jarvie <software () astrojar ! org ! uk>
Date:       2005-06-28 19:15:48
Message-ID: 1119986148.369374.18438.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 429753 by djarvie:

Add DCOP method addIncidence() to add an incidence to the active calendar


 M  +5 -0      actionmanager.cpp  
 M  +7 -0      actionmanager.h  
 M  +13 -0     calendarview.cpp  
 M  +10 -0     calendarview.h  
 M  +9 -0      korganizeriface.h  
 M  +5 -0      korganizerifaceimpl.cpp  
 M  +3 -0      korganizerifaceimpl.h  


--- trunk/KDE/kdepim/korganizer/actionmanager.cpp #429752:429753
@@ -1330,6 +1330,11 @@
   return mCalendarView->deleteIncidence( uid );
 }
 
+bool ActionManager::addIncidence( const QString& ical )
+{
+  return mCalendarView->addIncidence( ical );
+}
+
 void ActionManager::configureDateTimeFinished( KProcess *proc )
 {
   delete proc;
--- trunk/KDE/kdepim/korganizer/actionmanager.h #429752:429753
@@ -144,6 +144,13 @@
 
     bool editIncidence( const QString& uid );
 
+    /**
+      Add an incidence to the active calendar.
+      @param ical A calendar in iCalendar format containing the incidence.
+    */
+
+    bool addIncidence( const QString& ical );
+
     //// Implementation of the DCOP interface
     virtual ResourceRequestReply resourceRequest( const QValueList<QPair<QDateTime, QDateTime> >& busy,
                                                   const QCString& resource,
--- trunk/KDE/kdepim/korganizer/calendarview.cpp #429752:429753
@@ -1058,6 +1058,19 @@
             QDateTime( date, QTime( 12, 0, 0 ) ), true );
 }
 
+bool CalendarView::addIncidence( const QString &ical )
+{
+  kdDebug(5850) << "CalendarView::addIncidence:\n" << ical << endl;
+  ICalFormat format;
+  format.setTimeZone( mCalendar->timeZoneId(), true );
+  Incidence *incidence = format.fromString( ical );
+  if ( !incidence ) return false;
+  if ( !mChanger->addIncidence( incidence ) ) {
+    delete incidence;
+    return false;
+  }
+  return true;
+}
 
 void CalendarView::appointment_show()
 {
--- trunk/KDE/kdepim/korganizer/calendarview.h #429752:429753
@@ -255,6 +255,16 @@
     bool editIncidence( const QString& uid );
     void deleteIncidence();
 
+    /**
+      Add an incidence to the active calendar.
+      @param ical A calendar in iCalendar format containing the incidence. The
+                  calendar must consist of a VCALENDAR component which contains
+                  the incidence (VEVENT, VTODO, VJOURNAL or VFREEBUSY) and
+                  optionally a VTIMEZONE component. If there is more than one
+                  incidence, only the first is added to KOrganizer's calendar.
+    */
+    bool addIncidence( const QString &ical );
+
     void connectIncidenceEditor( KOIncidenceEditor * );
 
     /** create an editeventwin with supplied date/time, and if bool is true,
--- trunk/KDE/kdepim/korganizer/korganizeriface.h #429752:429753
@@ -35,6 +35,15 @@
     virtual QString getCurrentURLasString() const = 0;
     virtual bool editIncidence(const QString &uid) = 0;
     virtual bool deleteIncidence(const QString &uid) = 0;
+    /**
+      Add an incidence to the active calendar.
+      @param ical A calendar in iCalendar format containing the incidence. The
+                  calendar must consist of a VCALENDAR component which contains
+                  the incidence (VEVENT, VTODO, VJOURNAL or VFREEBUSY) and
+                  optionally a VTIMEZONE component. If there is more than one
+                  incidence, only the first is added to KOrganizer's calendar.
+    */
+    virtual bool addIncidence(const QString &iCal) = 0;
 };
 
 #endif
--- trunk/KDE/kdepim/korganizer/korganizerifaceimpl.cpp #429752:429753
@@ -84,3 +84,8 @@
 {
   return mActionManager->editIncidence( uid );
 }
+
+bool KOrganizerIfaceImpl::addIncidence( const QString &ical )
+{
+  return mActionManager->addIncidence( ical );
+}
--- trunk/KDE/kdepim/korganizer/korganizerifaceimpl.h #429752:429753
@@ -55,6 +55,9 @@
   bool editIncidence( const QString &uid );
   bool deleteIncidence( const QString &uid );
 
+  /** @reimp from KOrganizerIface::addIncidence() */
+  bool addIncidence( const QString &iCal );
+
 private:
   ActionManager* mActionManager;
 };
[prev in list] [next in list] [prev in thread] [next in thread] 

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