-rw-r--r-- | korganizer/calendarview.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e45240a..6128137 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1488,32 +1488,32 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b return 2; if ( lastSync > remoteMod ) return 1; return 2; break; case SYNC_PREF_NEWEST: if ( localMod >= remoteMod ) return 1; else return 2; break; case SYNC_PREF_ASK: - qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); + //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); if ( lastSync > remoteMod && lastSync > localMod) return 0; if ( lastSync > remoteMod ) return 1; if ( lastSync > localMod ) return 2; - qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); + //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); localIsNew = localMod >= remoteMod; if ( localIsNew ) getEventViewerDialog()->setColorMode( 1 ); else getEventViewerDialog()->setColorMode( 2 ); getEventViewerDialog()->setIncidence(local); if ( localIsNew ) getEventViewerDialog()->setColorMode( 2 ); else getEventViewerDialog()->setColorMode( 1 ); getEventViewerDialog()->addIncidence(remote); getEventViewerDialog()->setColorMode( 0 ); @@ -1532,39 +1532,42 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b break; default: // SYNC_PREF_TAKE_BOTH not implemented break; } return 0; } Event* CalendarView::getLastSyncEvent() { Event* lse; //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); + mCalendar->setSyncEventsEnabled(); lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice ); if (!lse) { + qDebug("KO: New last Syncevent created for local: %s",mCurrentSyncDevice.latin1() ); lse = new Event(); lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); QString sum = ""; if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) sum = "E: "; lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); lse->setDtStart( mLastCalendarSync ); lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); lse->setCategories( i18n("SyncEvent") ); lse->setReadOnly( true ); lse->setCalID( 1 ); mCalendar->addEvent( lse ); - } + } else + qDebug("KO: Last Syncevent on local found"); return lse; } // we check, if the to delete event has a id for a profile // if yes, we set this id in the profile to delete void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) { if ( lastSync.count() == 0 ) { //qDebug(" lastSync.count() == 0"); return; @@ -1624,25 +1627,25 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int remote->resetPilotStat(1); if ( KSyncManager::mRequestedSyncEvent.isValid() ) { mLastCalendarSync = KSyncManager::mRequestedSyncEvent; qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); } else { qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); } } QDateTime modifiedCalendar = mLastCalendarSync; eventLSync = getLastSyncEvent(); eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); if ( eventR ) { - qDebug("last-syncEvent on remote found "); + qDebug("KO: Last-syncEvent on remote found "); eventRSync = (Event*) eventR->clone(); remote->deleteEvent(eventR ); } else { if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { eventRSync = (Event*)eventLSync->clone(); } else { fullDateRange = true; eventRSync = new Event(); eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); eventRSync->setDtStart( mLastCalendarSync ); |