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

List:       kde-commits
Subject:    branches/KDE/3.5/kdepim/korganizer
From:       Reinhold Kainhofer <reinhold () kainhofer ! com>
Date:       2007-01-02 0:03:30
Message-ID: 1167696210.018550.9132.nullmailer () svn ! kde ! org
[Download RAW message or body]

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 );


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

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