summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kde2file/caldump/main.cpp7
-rw-r--r--korganizer/calendarview.cpp8
-rw-r--r--libkcal/calendar.cpp16
-rw-r--r--libkcal/calendar.h1
4 files changed, 32 insertions, 0 deletions
diff --git a/kde2file/caldump/main.cpp b/kde2file/caldump/main.cpp
index 03571b9..755e792 100644
--- a/kde2file/caldump/main.cpp
+++ b/kde2file/caldump/main.cpp
@@ -164,14 +164,16 @@ int main( int argc, char *argv[] )
164 qDebug("*************************loaded!"); 164 qDebug("*************************loaded!");
165 KCal::Incidence::List newInc = localCalendar->rawIncidences(); 165 KCal::Incidence::List newInc = localCalendar->rawIncidences();
166 Incidence::List::ConstIterator it; 166 Incidence::List::ConstIterator it;
167 for( it = newInc.begin(); it != newInc.end(); ++it ) { 167 for( it = newInc.begin(); it != newInc.end(); ++it ) {
168 if ( (*it)->pilotId() > 0 ) { //changed
168 Incidence* cl = (*it)->clone(); 169 Incidence* cl = (*it)->clone();
169 Incidence *incOld = calendarResource->incidence( cl->uid() ); 170 Incidence *incOld = calendarResource->incidence( cl->uid() );
170 ResourceCalendar * res = 0; 171 ResourceCalendar * res = 0;
171 if ( incOld ) 172 if ( incOld )
172 res = calendarResource->resource( incOld ); 173 res = calendarResource->resource( incOld );
173 if ( res ) { 174 if ( res ) {
175 cl->setPilotId( incOld->pilotId() );
174 ++num; 176 ++num;
175 if ( incOld->type() == "Journal" ) 177 if ( incOld->type() == "Journal" )
176 calendarResource->deleteJournal( (Journal *) incOld ); 178 calendarResource->deleteJournal( (Journal *) incOld );
177 else if ( incOld->type() == "Todo" ) 179 else if ( incOld->type() == "Todo" )
@@ -199,8 +201,13 @@ int main( int argc, char *argv[] )
199 } 201 }
200 calendarResource->addIncidence( cl ); 202 calendarResource->addIncidence( cl );
201 ++add; 203 ++add;
202 } 204 }
205 } else { // added
206 Incidence* cl = (*it)->clone();
207 calendarResource->addIncidence( cl );
208 ++add;
209 }
203 } 210 }
204 KCal::Incidence::List allInc = calendarResource->rawIncidences(); 211 KCal::Incidence::List allInc = calendarResource->rawIncidences();
205 212
206 for( it = allInc.begin(); it != allInc.end(); ++it ) { 213 for( it = allInc.begin(); it != allInc.end(); ++it ) {
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1f8ad5b..f727cd4 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -931,8 +931,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
931 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 931 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
932 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 932 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
933 bool fullDateRange = false; 933 bool fullDateRange = false;
934 local->resetTempSyncStat(); 934 local->resetTempSyncStat();
935#ifdef DESKTOP_VERSION
936 //Needed for KDE - OL sync
937 local->resetPilotStat();
938 remote->resetPilotStat();
939#endif
935 mLastCalendarSync = QDateTime::currentDateTime(); 940 mLastCalendarSync = QDateTime::currentDateTime();
936 QDateTime modifiedCalendar = mLastCalendarSync;; 941 QDateTime modifiedCalendar = mLastCalendarSync;;
937 eventLSync = getLastSyncEvent(); 942 eventLSync = getLastSyncEvent();
938 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 943 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
@@ -1025,8 +1030,11 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1025 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1030 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1026 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1031 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1027 inR->setIDStr( idS ); 1032 inR->setIDStr( idS );
1028 remote->addIncidence( inR ); 1033 remote->addIncidence( inR );
1034#ifdef DESKTOP_VERSION
1035 inR->setPilotId( 1 );
1036#endif
1029 ++changedRemote; 1037 ++changedRemote;
1030 } else { 1038 } else {
1031 if ( inR->revision() < maxrev ) 1039 if ( inR->revision() < maxrev )
1032 inR->setRevision( maxrev ); 1040 inR->setRevision( maxrev );
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index a3977d7..eeb5f48 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -247,8 +247,24 @@ QPtrList<Incidence> Calendar::incidences()
247 for( i = j.first(); i; i = j.next() ) incidences.append( i ); 247 for( i = j.first(); i; i = j.next() ) incidences.append( i );
248 248
249 return incidences; 249 return incidences;
250} 250}
251
252void Calendar::resetPilotStat()
253{
254 QPtrList<Incidence> incidences;
255
256 Incidence *i;
257
258 QPtrList<Event> e = rawEvents();
259 for( i = e.first(); i; i = e.next() ) i->setPilotId( 0 );
260
261 QPtrList<Todo> t = rawTodos();
262 for( i = t.first(); i; i = t.next() ) i->setPilotId( 0 );
263
264 QPtrList<Journal> j = journals();
265 for( i = j.first(); i; i = j.next() ) i->setPilotId( 0 );
266}
251void Calendar::resetTempSyncStat() 267void Calendar::resetTempSyncStat()
252{ 268{
253 QPtrList<Incidence> incidences; 269 QPtrList<Incidence> incidences;
254 270
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index c45d81f..d5294eb 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -66,8 +66,9 @@ public:
66 Calendar(const QString &timeZoneId); 66 Calendar(const QString &timeZoneId);
67 virtual ~Calendar(); 67 virtual ~Calendar();
68 void deleteIncidence(Incidence *in); 68 void deleteIncidence(Incidence *in);
69 void resetTempSyncStat(); 69 void resetTempSyncStat();
70 void resetPilotStat();
70 /** 71 /**
71 Clears out the current calendar, freeing all used memory etc. 72 Clears out the current calendar, freeing all used memory etc.
72 */ 73 */
73 virtual void close() = 0; 74 virtual void close() = 0;