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

List:       kde-commits
Subject:    KDE/kdepim/korganizer
From:       Andras Mantia <amantia () kde ! org>
Date:       2010-10-06 11:55:06
Message-ID: 20101006115506.36612AC7E4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1183155 by amantia:

Use the functionality from calendarsupport. Also be sure that the calendar is \
initialized in FreeBusyManager.

 M  +2 -30     calendarview.cpp  


--- trunk/KDE/kdepim/korganizer/calendarview.cpp #1183154:1183155
@@ -268,6 +268,7 @@
 void CalendarView::setCalendar( CalendarSupport::Calendar *cal )
 {
   mCalendar = cal;
+  CalendarSupport::FreeBusyManager::self()->setCalendar( cal );
 
   delete mHistory;
   mHistory = new History( mCalendar, this );
@@ -1951,38 +1952,9 @@
 
 void CalendarView::mailFreeBusy( int daysToPublish )
 {
-  KDateTime start = KDateTime::currentUtcDateTime().toTimeSpec( \
                mCalendar->timeSpec() );
-  KDateTime end = start.addDays( daysToPublish );
-
-  Event::List events;
-  Akonadi::Item::List items = mCalendar ? mCalendar->rawEvents( start.date(), \
                end.date() ) : Akonadi::Item::List();
-  foreach(const Akonadi::Item &item, items) { //FIXME
-    events << item.payload<Event::Ptr>();
+  CalendarSupport::FreeBusyManager::self()->mailFreeBusy( daysToPublish, this );
   }
 
-  FreeBusy::Ptr freebusy( new FreeBusy( events, start, end ) );
-  freebusy->setOrganizer( Person::Ptr( new Person( \
                CalendarSupport::KCalPrefs::instance()->fullName(),
-                                                   \
                CalendarSupport::KCalPrefs::instance()->email() ) ) );
-
-  QPointer<PublishDialog> publishdlg = new PublishDialog();
-  if ( publishdlg->exec() == QDialog::Accepted ) {
-    // Send the mail
-    CalendarSupport::MailScheduler scheduler( mCalendar );
-    if ( scheduler.publish( freebusy, publishdlg->addresses() ) ) {
-      KMessageBox::information(
-        this,
-        i18n( "The free/busy information was successfully sent." ),
-        i18n( "Sending Free/Busy" ),
-        "FreeBusyPublishSuccess" );
-    } else {
-      KMessageBox::error(
-        this,
-        i18n( "Unable to publish the free/busy data." ) );
-    }
-  }
-  delete publishdlg;
-}
-
 void CalendarView::uploadFreeBusy()
 {
   CalendarSupport::FreeBusyManager::self()->publishFreeBusy( this );


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

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