author | zautrix <zautrix> | 2004-10-17 16:06:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-17 16:06:42 (UTC) |
commit | d92f58ffa1937af8a4240b9d235da15f5f352769 (patch) (side-by-side diff) | |
tree | 48768599988f33c7f20017a76d05e919fa77ac51 | |
parent | 711c4c06a7d1a52b97fd24efa3586543f46cc6d7 (diff) | |
download | kdepimpi-d92f58ffa1937af8a4240b9d235da15f5f352769.zip kdepimpi-d92f58ffa1937af8a4240b9d235da15f5f352769.tar.gz kdepimpi-d92f58ffa1937af8a4240b9d235da15f5f352769.tar.bz2 |
KDE sync fixes
-rw-r--r-- | kde2file/caldump/main.cpp | 7 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 8 | ||||
-rw-r--r-- | libkcal/calendar.cpp | 16 | ||||
-rw-r--r-- | libkcal/calendar.h | 1 |
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 @@ -166,4 +166,5 @@ int main( int argc, char *argv[] ) Incidence::List::ConstIterator it; for( it = newInc.begin(); it != newInc.end(); ++it ) { + if ( (*it)->pilotId() > 0 ) { //changed Incidence* cl = (*it)->clone(); Incidence *incOld = calendarResource->incidence( cl->uid() ); @@ -172,4 +173,5 @@ int main( int argc, char *argv[] ) res = calendarResource->resource( incOld ); if ( res ) { + cl->setPilotId( incOld->pilotId() ); ++num; if ( incOld->type() == "Journal" ) @@ -201,4 +203,9 @@ int main( int argc, char *argv[] ) ++add; } + } else { // added + Incidence* cl = (*it)->clone(); + calendarResource->addIncidence( cl ); + ++add; + } } KCal::Incidence::List allInc = calendarResource->rawIncidences(); diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 1f8ad5b..f727cd4 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -933,4 +933,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int bool fullDateRange = false; local->resetTempSyncStat(); +#ifdef DESKTOP_VERSION + //Needed for KDE - OL sync + local->resetPilotStat(); + remote->resetPilotStat(); +#endif mLastCalendarSync = QDateTime::currentDateTime(); QDateTime modifiedCalendar = mLastCalendarSync;; @@ -1027,4 +1032,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int inR->setIDStr( idS ); remote->addIncidence( inR ); +#ifdef DESKTOP_VERSION + inR->setPilotId( 1 ); +#endif ++changedRemote; } else { diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index a3977d7..eeb5f48 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -249,4 +249,20 @@ QPtrList<Incidence> Calendar::incidences() return incidences; } + +void Calendar::resetPilotStat() +{ + QPtrList<Incidence> incidences; + + Incidence *i; + + QPtrList<Event> e = rawEvents(); + for( i = e.first(); i; i = e.next() ) i->setPilotId( 0 ); + + QPtrList<Todo> t = rawTodos(); + for( i = t.first(); i; i = t.next() ) i->setPilotId( 0 ); + + QPtrList<Journal> j = journals(); + for( i = j.first(); i; i = j.next() ) i->setPilotId( 0 ); +} void Calendar::resetTempSyncStat() { diff --git a/libkcal/calendar.h b/libkcal/calendar.h index c45d81f..d5294eb 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -68,4 +68,5 @@ public: void deleteIncidence(Incidence *in); void resetTempSyncStat(); + void resetPilotStat(); /** Clears out the current calendar, freeing all used memory etc. |