Bug 110262

Summary: changing an event in the agenda view is not registered as a change (no undo, no mail to attendees, etc.)
Product: [Applications] korganizer Reporter: Jason 'vanRijn' Kasper <vR>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: hughwarrington
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandriva RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jason 'vanRijn' Kasper 2005-08-05 20:56:09 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Mandriva RPMs
OS:                Linux

I have an existing event on my korganizer calendar which contains attendees.  I need to make a small change to that event.  Let's say that I need to move the event an hour down in my calendar to make another appointment.  If I double-click the event and use the popup event editor to change the date/time/any information, I am prompted with "This event includes other people. Should email be sent out to the attendees?" and Yes/No/Cancel. 

However, it is much easier to move the event down a few notches in the calendar itself (not going into the edit event dialog) and the problem is that doing this does not also trigger the "This event includes other people. Should email be sent out to the attendees?" dialog, and subsequently the other event attendees are not informed of the change in the event.

Thanks!  =:)
Comment 1 Reinhold Kainhofer 2006-11-02 19:33:13 UTC
Reassigning all KOrganizer bug reports and wishes to the newly created 
korganizer-devel mailing list.
Comment 2 Reinhold Kainhofer 2007-01-01 16:03:12 UTC
*** Bug 120721 has been marked as a duplicate of this bug. ***
Comment 3 Reinhold Kainhofer 2007-01-02 01:03:33 UTC
SVN commit 618657 by kainhofe:

Correctly use the incidence changer to notify the korganizer core about the change when moving items in the agenda view. Previously, the event was changed, but korganizer wasn't notified, so no undo was available and no automatic groupware communication, as well as that the item wasn't even save in the dimap resource. All of these issues are now fixed by simply adding a call to mIncidenceChanger->changeIncidence(oldIncidence, incidence)...

BUG: 110262


 M  +3 -3      koagenda.cpp  
 M  +8 -0      koagendaview.cpp  


--- branches/KDE/3.5/kdepim/korganizer/koagenda.cpp #618656:618657
@@ -1038,6 +1038,7 @@
 void KOAgenda::endItemAction()
 {
 //  kdDebug(5850) << "KOAgenda::endItemAction() " << endl;
+  mActionType = NOP;
   mScrollUpTimer.stop();
   mScrollDownTimer.stop();
   setCursor( arrowCursor );
@@ -1123,7 +1124,6 @@
     if ( modify ) {
       mActionItem->endMove();
       KOAgendaItem *placeItem = mActionItem->firstMultiItem();
-      // FIXME: A mChanger->changeIncidence is missing here!
       if  ( !placeItem ) {
         placeItem = mActionItem;
       }
@@ -1141,7 +1141,8 @@
         placeItem = placeItem->nextMultiItem();
       }
 
-      // Notify about change, so that agenda view can update the event data
+      // Notify about change
+      // the agenda view will apply the changes to the actual Incidence*!
       emit itemModified( modif );
     }
     // FIXME: If the change failed, we need to update the view!
@@ -1149,7 +1150,6 @@
   }
 
   mActionItem = 0;
-  mActionType = NOP;
   mItemMoved = false;
 
   if ( multiModify ) emit endMultiModify();
--- branches/KDE/3.5/kdepim/korganizer/koagendaview.cpp #618656:618657
@@ -972,6 +972,8 @@
 
   Incidence *incidence = item->incidence();
   if ( !incidence ) return;
+  if ( !mChanger || !mChanger->beginChange(incidence) ) return;
+  Incidence *oldIncidence = incidence->clone();
 
   QTime startTime(0,0,0), endTime(0,0,0);
   if ( incidence->doesFloat() ) {
@@ -997,6 +999,7 @@
     Event*ev = static_cast<Event*>(incidence);
     if( incidence->dtStart() == startDt && ev->dtEnd() == endDt ) {
       // No change
+      delete oldIncidence;
       return;
     }
     incidence->setDtStart( startDt );
@@ -1011,6 +1014,7 @@
 
     if( td->dtDue() == endDt ) {
       // No change
+      delete oldIncidence;
       return;
     }
   }
@@ -1170,6 +1174,10 @@
     td->setDtDue( endDt );
   }
 
+  mChanger->changeIncidence( oldIncidence, incidence );
+  mChanger->endChange(incidence);
+  delete oldIncidence;
+
   item->setItemDate( startDt.date() );
 
   KOIncidenceToolTip::remove( item );