summaryrefslogtreecommitdiffabout
path: root/kde2file/caldump
Unidiff
Diffstat (limited to 'kde2file/caldump') (more/less context) (ignore whitespace changes)
-rw-r--r--kde2file/caldump/main.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/kde2file/caldump/main.cpp b/kde2file/caldump/main.cpp
index 755e792..be1735b 100644
--- a/kde2file/caldump/main.cpp
+++ b/kde2file/caldump/main.cpp
@@ -57,2 +57,3 @@
57#include <qdir.h> 57#include <qdir.h>
58#include <qapplication.h>
58 59
@@ -154,3 +155,3 @@ int main( int argc, char *argv[] )
154 } else { 155 } else {
155 qDebug("*************************load"); 156 qDebug("************load");
156 localCalendar = new CalendarLocal(); 157 localCalendar = new CalendarLocal();
@@ -163,3 +164,3 @@ int main( int argc, char *argv[] )
163 if ( storage->load() ) { 164 if ( storage->load() ) {
164 qDebug("*************************loaded!"); 165 qDebug("***********loaded!");
165 KCal::Incidence::List newInc = localCalendar->rawIncidences(); 166 KCal::Incidence::List newInc = localCalendar->rawIncidences();
@@ -167,5 +168,5 @@ int main( int argc, char *argv[] )
167 for( it = newInc.begin(); it != newInc.end(); ++it ) { 168 for( it = newInc.begin(); it != newInc.end(); ++it ) {
168 if ( (*it)->pilotId() > 0 ) { //changed 169 if ( (*it)->pilotId() > 1 ) { //changed
169 Incidence* cl = (*it)->clone(); 170 qDebug("*********pilot id %d %s ",(*it)->pilotId() ,(*it)->summary().latin1());
170 Incidence *incOld = calendarResource->incidence( cl->uid() ); 171 Incidence *incOld = calendarResource->incidence( (*it)->uid() );
171 ResourceCalendar * res = 0; 172 ResourceCalendar * res = 0;
@@ -174,2 +175,3 @@ int main( int argc, char *argv[] )
174 if ( res ) { 175 if ( res ) {
176 Incidence* cl = (*it)->clone();
175 cl->setPilotId( incOld->pilotId() ); 177 cl->setPilotId( incOld->pilotId() );
@@ -182,3 +184,3 @@ int main( int argc, char *argv[] )
182 calendarResource->deleteEvent( (Event *) incOld ); 184 calendarResource->deleteEvent( (Event *) incOld );
183 185 qDebug("*********change incidence %s ",cl->summary().latin1());
184 if ( cl->type() == "Journal" ) 186 if ( cl->type() == "Journal" )
@@ -191,12 +193,12 @@ int main( int argc, char *argv[] )
191 } else { 193 } else {
192 if ( incOld ) { 194 Incidence* cl = (*it)->clone();
193 qDebug("ERROR: no resource found for old incidence "); 195 qDebug("*********add incidence %s ",cl->summary().latin1());
194 if ( incOld->type() == "Journal" ) 196 calendarResource->addIncidence( cl );
195 calendarResource->deleteJournal( (Journal *) incOld ); 197 ++add;
196 else if ( incOld->type() == "Todo" ) 198 }
197 calendarResource->deleteTodo( (Todo *) incOld ); 199 } else { // maybe added
198 else if ( incOld->type() == "Event" ) 200 Incidence *incOld = calendarResource->incidence( (*it)->uid() );
199 calendarResource->deleteEvent( (Event *) incOld ); 201 if ( !incOld ) { //added
200 202 Incidence* cl = (*it)->clone();
201 } 203 qDebug("*********add incidence %s ",cl->summary().latin1());
202 calendarResource->addIncidence( cl ); 204 calendarResource->addIncidence( cl );
@@ -204,6 +206,2 @@ int main( int argc, char *argv[] )
204 } 206 }
205 } else { // added
206 Incidence* cl = (*it)->clone();
207 calendarResource->addIncidence( cl );
208 ++add;
209 } 207 }