[Korganizer-devel] [Bug 110262] changing an event in the agenda view is not registered as a change (no undo, no mail to attendees, etc.)

Reinhold Kainhofer reinhold at kainhofer.com
Tue Jan 2 01:03:35 CET 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=110262         
reinhold kainhofer com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From reinhold kainhofer com  2007-01-02 01:03 -------
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 );


More information about the Korganizer-devel mailing list