summaryrefslogtreecommitdiffabout
path: root/kde2file
Unidiff
Diffstat (limited to 'kde2file') (more/less context) (ignore whitespace changes)
-rw-r--r--kde2file/caldump/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/kde2file/caldump/main.cpp b/kde2file/caldump/main.cpp
index 95ae29e..76bfad3 100644
--- a/kde2file/caldump/main.cpp
+++ b/kde2file/caldump/main.cpp
@@ -122,16 +122,17 @@ int main( int argc, char *argv[] )
122 KCal::Incidence::List allInc = calendarResource->rawIncidences(); 122 KCal::Incidence::List allInc = calendarResource->rawIncidences();
123 Incidence::List::ConstIterator it; 123 Incidence::List::ConstIterator it;
124 int num = 0; 124 int num = 0;
125 for( it = allInc.begin(); it != allInc.end(); ++it ) { 125 for( it = allInc.begin(); it != allInc.end(); ++it ) {
126 ResourceCalendar * re = calendarResource->resource( (*it) ); 126 ResourceCalendar * re = calendarResource->resource( (*it) );
127 if ( re && !re->readOnly() ) { 127 if ( re && !re->readOnly() ) {
128 ++num; 128 ++num;
129 Incidence* cl = (*it)->clone(); 129 Incidence* cl = (*it)->clone();
130 cl->setLastModified( (*it)->lastModified() );
130 if ( cl->type() == "Journal" ) 131 if ( cl->type() == "Journal" )
131 localCalendar->addJournal( (Journal *) cl ); 132 localCalendar->addJournal( (Journal *) cl );
132 else if ( cl->type() == "Todo" ) 133 else if ( cl->type() == "Todo" )
133 localCalendar->addTodo( (Todo *) cl ); 134 localCalendar->addTodo( (Todo *) cl );
134 else if ( cl->type() == "Event" ) 135 else if ( cl->type() == "Event" )
135 localCalendar->addEvent( (Event *) cl ); 136 localCalendar->addEvent( (Event *) cl );
136 } 137 }
137 } 138 }
@@ -157,32 +158,35 @@ int main( int argc, char *argv[] )
157 KCal::Incidence::List allInc = calendarResource->rawIncidences(); 158 KCal::Incidence::List allInc = calendarResource->rawIncidences();
158 KCal::Incidence::List newInc = localCalendar->rawIncidences(); 159 KCal::Incidence::List newInc = localCalendar->rawIncidences();
159 Incidence::List::ConstIterator it; 160 Incidence::List::ConstIterator it;
160 for( it = allInc.begin(); it != allInc.end(); ++it ) { 161 for( it = allInc.begin(); it != allInc.end(); ++it ) {
161 ResourceCalendar * re = calendarResource->resource( (*it) ); 162 ResourceCalendar * re = calendarResource->resource( (*it) );
162 if ( re && !re->readOnly() ) { 163 if ( re && !re->readOnly() ) {
163 Incidence* cl = localCalendar->incidence( (*it)->uid() ); 164 Incidence* cl = localCalendar->incidence( (*it)->uid() );
164 if ( cl ) { 165 if ( cl ) {
166 QDateTime lm = cl->lastModified();
165 cl->setResources( (*it)->resources() ); 167 cl->setResources( (*it)->resources() );
168 cl->setLastModified(lm);
166 } 169 }
167 ++del; 170 ++del;
168 cl = (*it); 171 cl = (*it);
169 if ( cl->type() == "Journal" ) 172 if ( cl->type() == "Journal" )
170 calendarResource->deleteJournal( (Journal *) cl ); 173 calendarResource->deleteJournal( (Journal *) cl );
171 else if ( cl->type() == "Todo" ) 174 else if ( cl->type() == "Todo" )
172 calendarResource->deleteTodo( (Todo *) cl ); 175 calendarResource->deleteTodo( (Todo *) cl );
173 else if ( cl->type() == "Event" ) 176 else if ( cl->type() == "Event" )
174 calendarResource->deleteEvent( (Event *) cl ); 177 calendarResource->deleteEvent( (Event *) cl );
175 } 178 }
176 } 179 }
177 for( it = newInc.begin(); it != newInc.end(); ++it ) { 180 for( it = newInc.begin(); it != newInc.end(); ++it ) {
178 Incidence* cl = (*it)->clone(); 181 Incidence* cl = (*it)->clone();
179 ++num; 182 ++num;
180 calendarResource->addIncidence( cl ); 183 calendarResource->addIncidence( cl );
184 //cl->setLastModified( (*it)->lastModified() );
181 } 185 }
182 calendarResource->save(); 186 calendarResource->save();
183 qDebug("************************************* "); 187 qDebug("************************************* ");
184 qDebug("************************************* "); 188 qDebug("************************************* ");
185 qDebug("************************************* "); 189 qDebug("************************************* ");
186 qDebug("%d calendar entries deleted/ %d added from file /tmp/kdedumpall.ics", del, num); 190 qDebug("%d calendar entries deleted/ %d added from file /tmp/kdedumpall.ics", del, num);
187 191
188 } else 192 } else