summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kde2file/caldump/main.cpp45
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[] )
119 qDebug("**************kdecaldump************* "); 119 qDebug("**************kdecaldump************* ");
120 qDebug("************************************* "); 120 qDebug("************************************* ");
121 qDebug("Using timezone id: %s", calendarResource->timeZoneId().latin1()); 121 qDebug("Using timezone ID: %s", calendarResource->timeZoneId().latin1());
122 122
123 if ( !read ) { 123 if ( !read ) {
@@ -153,4 +153,5 @@ int main( int argc, char *argv[] )
153 153
154 } else { 154 } else {
155 qDebug("*************************load");
155 localCalendar = new CalendarLocal(); 156 localCalendar = new CalendarLocal();
156 localCalendar->setTimeZoneId( calendarResource->timeZoneId()); 157 localCalendar->setTimeZoneId( calendarResource->timeZoneId());
@@ -161,4 +162,5 @@ int main( int argc, char *argv[] )
161 int add = 0; 162 int add = 0;
162 if ( storage->load() ) { 163 if ( storage->load() ) {
164 qDebug("*************************loaded!");
163 KCal::Incidence::List newInc = localCalendar->rawIncidences(); 165 KCal::Incidence::List newInc = localCalendar->rawIncidences();
164 Incidence::List::ConstIterator it; 166 Incidence::List::ConstIterator it;
@@ -199,26 +201,27 @@ int main( int argc, char *argv[] )
199 ++add; 201 ++add;
200 } 202 }
201 KCal::Incidence::List allInc = calendarResource->rawIncidences(); 203 }
204 KCal::Incidence::List allInc = calendarResource->rawIncidences();
202 205
203 for( it = allInc.begin(); it != allInc.end(); ++it ) { 206 for( it = allInc.begin(); it != allInc.end(); ++it ) {
204 ResourceCalendar * re = calendarResource->resource( (*it) ); 207 ResourceCalendar * re = calendarResource->resource( (*it) );
205 if ( re && !re->readOnly() ) { 208 if ( re && !re->readOnly() ) {
206 Incidence* cl = localCalendar->incidence( (*it)->uid() ); 209 Incidence* cl = localCalendar->incidence( (*it)->uid() );
207 if ( !cl ) { 210 if ( !cl ) {
208 ++del; 211 ++del;
209 cl = (*it); 212 cl = (*it);
210 if ( cl->type() == "Journal" ) 213 if ( cl->type() == "Journal" )
211 calendarResource->deleteJournal( (Journal *) cl ); 214 calendarResource->deleteJournal( (Journal *) cl );
212 else if ( cl->type() == "Todo" ) 215 else if ( cl->type() == "Todo" )
213 calendarResource->deleteTodo( (Todo *) cl ); 216 calendarResource->deleteTodo( (Todo *) cl );
214 else if ( cl->type() == "Event" ) 217 else if ( cl->type() == "Event" )
215 calendarResource->deleteEvent( (Event *) cl ); 218 calendarResource->deleteEvent( (Event *) cl );
216 //QDateTime lm = cl->lastModified(); 219 //QDateTime lm = cl->lastModified();
217 //cl->setResources( (*it)->resources() ); 220 //cl->setResources( (*it)->resources() );
218 //cl->setLastModified(lm); 221 //cl->setLastModified(lm);
219 } 222 }
220 }
221 } 223 }
222 } 224 }
225
223 calendarResource->save(); 226 calendarResource->save();
224 qDebug("************************************* "); 227 qDebug("************************************* ");
@@ -228,5 +231,5 @@ int main( int argc, char *argv[] )
228 231
229 } else 232 } else
230 qDebug("error loading file /tmp/kdedumpall.ics"); 233 qDebug("ERROR loading file %s",fileName.latin1() );
231 234
232 } 235 }