[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 14:05:37
Message-ID: 20101006140537.3CC12AC892 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1183200 by amantia:
Use sendAsICalendar from CalendarSupport
M +4 -43 calendarview.cpp
--- trunk/KDE/kdepim/korganizer/calendarview.cpp #1183199:1183200
@@ -1903,53 +1903,14 @@
void CalendarView::schedule_forward( const Akonadi::Item &item )
{
- Incidence::Ptr incidence = CalendarSupport::incidence( item );
- if ( !incidence ) {
- const Akonadi::Item item = selectedIncidence();
- incidence = CalendarSupport::incidence( item );
+ Akonadi::Item selectedItem = item;
+ if ( !item.hasPayload<KCalCore::Incidence::Ptr>() ) {
+ selectedItem = selectedIncidence();
}
- if ( !incidence ) {
- KMessageBox::information(
- this,
- i18n( "No item selected." ),
- i18n( "Forwarding" ),
- "ForwardNoEventSelected" );
- return;
+ CalendarSupport::sendAsICalendar( selectedItem, KOCore::self()->identityManager(), this );
}
- QPointer<PublishDialog> publishdlg = new PublishDialog;
- if ( publishdlg->exec() == QDialog::Accepted ) {
- const QString recipients = publishdlg->addresses();
- if ( incidence->organizer()->isEmpty() ) {
- incidence->setOrganizer( Person::Ptr( new Person( CalendarSupport::KCalPrefs::instance()->fullName(),
- CalendarSupport::KCalPrefs::instance()->email() ) ) );
- }
-
- ICalFormat format;
- const QString from = CalendarSupport::KCalPrefs::instance()->email();
- const bool bccMe = CalendarSupport::KCalPrefs::instance()->mBcc;
- const QString messageText = format.createScheduleMessage( incidence, iTIPRequest );
- CalendarSupport::MailClient mailer;
- if ( mailer.mailTo(
- incidence,
- KOCore::self()->identityManager()->identityForAddress( from ),
- from, bccMe, recipients, messageText, MailTransport::TransportManager::self()->defaultTransportName() ) ) {
- KMessageBox::information(
- this,
- i18n( "The item information was successfully sent." ),
- i18n( "Forwarding" ),
- "IncidenceForwardSuccess" );
- } else {
- KMessageBox::error(
- this,
- i18n( "Unable to forward the item '%1'", incidence->summary() ),
- i18n( "Forwarding Error" ) );
- }
- }
- delete publishdlg;
-}
-
void CalendarView::mailFreeBusy( int daysToPublish )
{
CalendarSupport::FreeBusyManager::self()->mailFreeBusy( daysToPublish, this );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic