From 740cad9fc10cc4e3683b619cbe06da24ef18f1b0 Mon Sep 17 00:00:00 2001
From: tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>
Date: Wed, 18 Aug 2010 08:07:58 +0000
Subject: Attempt to fix incorrect meeting motices being sent when the first
 instance of a recurring meeting is deleted. This may need more work depending
 on how the number of recurrences are handled This should be more compatible
 with most CalDAV resources than the old way...

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1165076 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
---
 korganizer/calendarview.cpp                       | 9 ++++++++-
 korganizer/incidencechanger.cpp                   | 4 ++--
 plugins/kmail/bodypartformatter/text_calendar.cpp | 4 +---
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index b13b0691..340c6dab 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2060,7 +2060,14 @@ void CalendarView::deleteIncidence(Incidence *incidence, bool force)
       case KMessageBox::Yes: // just this one
         if ( mChanger->beginChange( incidence ) ) {
           Incidence *oldIncidence = incidence->clone();
-          incidence->recurrence()->addExDate( itemDate );
+          if (incidence->recurrence()->startDate() == itemDate) {
+              // Moving the first in a series...don't bother with the nonstandard exclusion list
+              incidence->recurrence()->setStartDateTime( incidence->recurrence()->getNextDateTime( incidence->recurrence()->startDateTime() ) );
+          }
+          else {
+              // No choice but to use the exclusion list
+              incidence->recurrence()->addExDate( itemDate );
+          }
           mChanger->changeIncidence( oldIncidence, incidence );
           mChanger->endChange( incidence );
           delete oldIncidence;
diff --git a/korganizer/incidencechanger.cpp b/korganizer/incidencechanger.cpp
index 623eaa94..92332578 100644
--- a/korganizer/incidencechanger.cpp
+++ b/korganizer/incidencechanger.cpp
@@ -82,7 +82,7 @@ bool IncidenceChanger::endChange( Incidence *incidence )
   // FIXME: if that's a groupware incidence, and the incidence was
   // never locked, we can't unlock it with endChange().
   if ( !incidence ) return false;
-kdDebug(5850)<<"IncidenceChanger::endChange for incidence \""<<incidence->summary()<<"\""<<endl;
+  // kdDebug(5850)<<"IncidenceChanger::endChange for incidence \""<<incidence->summary()<<"\""<<endl;
   return mCalendar->endChange( incidence );
 }
 
@@ -289,7 +289,7 @@ kdDebug(5850)<<"IncidenceChanger::changeIncidence for incidence \""<<newinc->sum
     int revision = newinc->revision();
     newinc->setRevision( revision + 1 );
     // FIXME: Use a generic method for this! Ideally, have an interface class
-    //        for group cheduling. Each implementation could then just do what
+    //        for group scheduling. Each implementation could then just do what
     //        it wants with the event. If no groupware is used,use the null
     //        pattern...
     bool revert = KOPrefs::instance()->mUseGroupwareCommunication;
diff --git a/plugins/kmail/bodypartformatter/text_calendar.cpp b/plugins/kmail/bodypartformatter/text_calendar.cpp
index 29a00afe..2ea1cfd5 100644
--- a/plugins/kmail/bodypartformatter/text_calendar.cpp
+++ b/plugins/kmail/bodypartformatter/text_calendar.cpp
@@ -336,9 +336,7 @@ class UrlHandler : public KMail::Interface::BodyPartURLHandler
           subject = i18n( "Forwarded: %1" ).arg( summary );
           break;
         case DeclineCounter:
-          // ### string freeze
-          //subject = i18n( "Declined Counter Proposal: %1" ).arg( summary );
-          subject = i18n( "Answer: %1" ).arg( summary );
+          subject = i18n( "Declined Counter Proposal: %1" ).arg( summary );
           break;
       }
 
-- 
cgit v1.2.3

