author | zautrix <zautrix> | 2004-10-17 15:13:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-17 15:13:12 (UTC) |
commit | 711c4c06a7d1a52b97fd24efa3586543f46cc6d7 (patch) (side-by-side diff) | |
tree | 249481286ad20efb0239d21dfcab0313a9692a4b | |
parent | 780a12295cbbcf4eff4f9570322c1cac517414ad (diff) | |
download | kdepimpi-711c4c06a7d1a52b97fd24efa3586543f46cc6d7.zip kdepimpi-711c4c06a7d1a52b97fd24efa3586543f46cc6d7.tar.gz kdepimpi-711c4c06a7d1a52b97fd24efa3586543f46cc6d7.tar.bz2 |
sync fixes
-rw-r--r-- | kde2file/caldump/main.cpp | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/kde2file/caldump/main.cpp b/kde2file/caldump/main.cpp index 8d81307..03571b9 100644 --- a/kde2file/caldump/main.cpp +++ b/kde2file/caldump/main.cpp @@ -119,5 +119,5 @@ int main( int argc, char *argv[] ) qDebug("**************kdecaldump************* "); qDebug("************************************* "); - qDebug("Using timezone id: %s", calendarResource->timeZoneId().latin1()); + qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1()); if ( !read ) { @@ -153,4 +153,5 @@ int main( int argc, char *argv[] ) } else { + qDebug("*************************load"); localCalendar = new CalendarLocal(); localCalendar->setTimeZoneId( calendarResource->timeZoneId()); @@ -161,4 +162,5 @@ int main( int argc, char *argv[] ) int add = 0; if ( storage->load() ) { + qDebug("*************************loaded!"); KCal::Incidence::List newInc = localCalendar->rawIncidences(); Incidence::List::ConstIterator it; @@ -199,26 +201,27 @@ int main( int argc, char *argv[] ) ++add; } - KCal::Incidence::List allInc = calendarResource->rawIncidences(); + } + 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 ) { - ++del; - cl = (*it); - if ( cl->type() == "Journal" ) - calendarResource->deleteJournal( (Journal *) cl ); - else if ( cl->type() == "Todo" ) - calendarResource->deleteTodo( (Todo *) cl ); - else if ( cl->type() == "Event" ) - calendarResource->deleteEvent( (Event *) cl ); - //QDateTime lm = cl->lastModified(); - //cl->setResources( (*it)->resources() ); - //cl->setLastModified(lm); - } - } + 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 ) { + ++del; + cl = (*it); + if ( cl->type() == "Journal" ) + calendarResource->deleteJournal( (Journal *) cl ); + else if ( cl->type() == "Todo" ) + calendarResource->deleteTodo( (Todo *) cl ); + else if ( cl->type() == "Event" ) + calendarResource->deleteEvent( (Event *) cl ); + //QDateTime lm = cl->lastModified(); + //cl->setResources( (*it)->resources() ); + //cl->setLastModified(lm); + } } } + calendarResource->save(); qDebug("************************************* "); @@ -228,5 +231,5 @@ int main( int argc, char *argv[] ) } else - qDebug("error loading file /tmp/kdedumpall.ics"); + qDebug("ERROR loading file %s",fileName.latin1() ); } |