summaryrefslogtreecommitdiffabout
path: root/kde2file/caldump
authorzautrix <zautrix>2004-10-17 18:08:43 (UTC)
committer zautrix <zautrix>2004-10-17 18:08:43 (UTC)
commit6f6d1d58938539215bb4fcb5b97cf9fb089a11ef (patch) (side-by-side diff)
tree9937fe24c3fa3f29421b39a58b393e893a11636a /kde2file/caldump
parentd92f58ffa1937af8a4240b9d235da15f5f352769 (diff)
downloadkdepimpi-6f6d1d58938539215bb4fcb5b97cf9fb089a11ef.zip
kdepimpi-6f6d1d58938539215bb4fcb5b97cf9fb089a11ef.tar.gz
kdepimpi-6f6d1d58938539215bb4fcb5b97cf9fb089a11ef.tar.bz2
more KDE sync fixes
Diffstat (limited to 'kde2file/caldump') (more/less context) (show whitespace changes)
-rw-r--r--kde2file/caldump/main.cpp32
1 files changed, 15 insertions, 17 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 @@
#include <qdir.h>
+#include <qapplication.h>
@@ -154,3 +155,3 @@ int main( int argc, char *argv[] )
} else {
- qDebug("*************************load");
+ qDebug("************load");
localCalendar = new CalendarLocal();
@@ -163,3 +164,3 @@ int main( int argc, char *argv[] )
if ( storage->load() ) {
- qDebug("*************************loaded!");
+ qDebug("***********loaded!");
KCal::Incidence::List newInc = localCalendar->rawIncidences();
@@ -167,5 +168,5 @@ int main( int argc, char *argv[] )
for( it = newInc.begin(); it != newInc.end(); ++it ) {
- if ( (*it)->pilotId() > 0 ) { //changed
- Incidence* cl = (*it)->clone();
- Incidence *incOld = calendarResource->incidence( cl->uid() );
+ if ( (*it)->pilotId() > 1 ) { //changed
+ qDebug("*********pilot id %d %s ",(*it)->pilotId() ,(*it)->summary().latin1());
+ Incidence *incOld = calendarResource->incidence( (*it)->uid() );
ResourceCalendar * res = 0;
@@ -174,2 +175,3 @@ int main( int argc, char *argv[] )
if ( res ) {
+ Incidence* cl = (*it)->clone();
cl->setPilotId( incOld->pilotId() );
@@ -182,3 +184,3 @@ int main( int argc, char *argv[] )
calendarResource->deleteEvent( (Event *) incOld );
-
+ qDebug("*********change incidence %s ",cl->summary().latin1());
if ( cl->type() == "Journal" )
@@ -191,12 +193,4 @@ int main( int argc, char *argv[] )
} else {
- if ( incOld ) {
- qDebug("ERROR: no resource found for old incidence ");
- if ( incOld->type() == "Journal" )
- calendarResource->deleteJournal( (Journal *) incOld );
- else if ( incOld->type() == "Todo" )
- calendarResource->deleteTodo( (Todo *) incOld );
- else if ( incOld->type() == "Event" )
- calendarResource->deleteEvent( (Event *) incOld );
-
- }
+ Incidence* cl = (*it)->clone();
+ qDebug("*********add incidence %s ",cl->summary().latin1());
calendarResource->addIncidence( cl );
@@ -204,4 +198,7 @@ int main( int argc, char *argv[] )
}
- } else { // added
+ } else { // maybe added
+ Incidence *incOld = calendarResource->incidence( (*it)->uid() );
+ if ( !incOld ) { //added
Incidence* cl = (*it)->clone();
+ qDebug("*********add incidence %s ",cl->summary().latin1());
calendarResource->addIncidence( cl );
@@ -210,2 +207,3 @@ int main( int argc, char *argv[] )
}
+ }
KCal::Incidence::List allInc = calendarResource->rawIncidences();