summaryrefslogtreecommitdiffabout
path: root/kde2file/caldump/main.cpp
Side-by-side diff
Diffstat (limited to 'kde2file/caldump/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kde2file/caldump/main.cpp7
1 files changed, 7 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
@@ -160,22 +160,24 @@ int main( int argc, char *argv[] )
int num = 0;
int del = 0;
int add = 0;
if ( storage->load() ) {
qDebug("*************************loaded!");
KCal::Incidence::List newInc = localCalendar->rawIncidences();
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() );
ResourceCalendar * res = 0;
if ( incOld )
res = calendarResource->resource( incOld );
if ( res ) {
+ cl->setPilotId( incOld->pilotId() );
++num;
if ( incOld->type() == "Journal" )
calendarResource->deleteJournal( (Journal *) incOld );
else if ( incOld->type() == "Todo" )
calendarResource->deleteTodo( (Todo *) incOld );
else if ( incOld->type() == "Event" )
calendarResource->deleteEvent( (Event *) incOld );
@@ -195,16 +197,21 @@ int main( int argc, char *argv[] )
calendarResource->deleteTodo( (Todo *) incOld );
else if ( incOld->type() == "Event" )
calendarResource->deleteEvent( (Event *) incOld );
}
calendarResource->addIncidence( cl );
++add;
}
+ } else { // added
+ Incidence* cl = (*it)->clone();
+ calendarResource->addIncidence( cl );
+ ++add;
+ }
}
KCal::Incidence::List allInc = calendarResource->rawIncidences();
for( it = allInc.begin(); it != allInc.end(); ++it ) {
ResourceCalendar * re = calendarResource->resource( (*it) );
if ( re && !re->readOnly() ) {
Incidence* cl = localCalendar->incidence( (*it)->uid() );
if ( !cl ) {