-rw-r--r-- | kde2file/caldump/main.cpp | 9 |
1 files changed, 6 insertions, 3 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 @@ -117,9 +117,9 @@ int main( int argc, char *argv[] ) calendarResource->load(); qDebug("************************************* "); qDebug("**************kdecaldump************* "); qDebug("************************************* "); - qDebug("Using timezone id: %s", calendarResource->timeZoneId().latin1()); + qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1()); if ( !read ) { localCalendar = new CalendarLocal(); localCalendar->setTimeZoneId( calendarResource->timeZoneId()); @@ -151,16 +151,18 @@ int main( int argc, char *argv[] ) qDebug("************************************* "); qDebug("%d calendar entries dumped to file %s", num, fileName.latin1()); } else { + qDebug("*************************load"); localCalendar = new CalendarLocal(); localCalendar->setTimeZoneId( calendarResource->timeZoneId()); FileStorage* storage = new FileStorage( localCalendar ); storage->setFileName( fileName ); 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 ) { Incidence* cl = (*it)->clone(); @@ -197,8 +199,9 @@ int main( int argc, char *argv[] ) } calendarResource->addIncidence( cl ); ++add; } + } KCal::Incidence::List allInc = calendarResource->rawIncidences(); for( it = allInc.begin(); it != allInc.end(); ++it ) { ResourceCalendar * re = calendarResource->resource( (*it) ); @@ -218,17 +221,17 @@ int main( int argc, char *argv[] ) //cl->setLastModified(lm); } } } - } + calendarResource->save(); qDebug("************************************* "); qDebug("************kdecaldump*************** "); qDebug("************************************* "); qDebug("Calendar entries\nchanged %d\ndeleted %d\nadded %d\nfrom file %s", num,del, add, fileName.latin1()); } else - qDebug("error loading file /tmp/kdedumpall.ics"); + qDebug("ERROR loading file %s",fileName.latin1() ); } if ( localCalendar ) { |