author | zautrix <zautrix> | 2004-08-01 12:02:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-01 12:02:39 (UTC) |
commit | c31e99f265dbe8762efca20667f8ccd973840f8f (patch) (unidiff) | |
tree | 29e7fd6845d187f41f9d80e756611dc8bc182bdc /libkcal | |
parent | e954cc1e29b129982e4d07c4f490d7e881597374 (diff) | |
download | kdepimpi-c31e99f265dbe8762efca20667f8ccd973840f8f.zip kdepimpi-c31e99f265dbe8762efca20667f8ccd973840f8f.tar.gz kdepimpi-c31e99f265dbe8762efca20667f8ccd973840f8f.tar.bz2 |
Changed zaurusstat to tempsyncstat
-rw-r--r-- | libkcal/icalformatimpl.cpp | 8 | ||||
-rw-r--r-- | libkcal/incidencebase.cpp | 12 | ||||
-rw-r--r-- | libkcal/incidencebase.h | 6 | ||||
-rw-r--r-- | libkcal/sharpformat.cpp | 14 |
4 files changed, 16 insertions, 24 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 3437f45..df05ab3 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp | |||
@@ -271,15 +271,12 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) | |||
271 | incidence->setNonKDECustomProperty("X-ZAURUSID", QString::number(incidence->zaurusId())); | 271 | incidence->setNonKDECustomProperty("X-ZAURUSID", QString::number(incidence->zaurusId())); |
272 | } | 272 | } |
273 | 273 | ||
274 | if (incidence->zaurusUid() > 0) { | 274 | if (incidence->zaurusUid() > 0) { |
275 | incidence->setNonKDECustomProperty("X-ZAURUSUID", QString::number(incidence->zaurusUid())); | 275 | incidence->setNonKDECustomProperty("X-ZAURUSUID", QString::number(incidence->zaurusUid())); |
276 | } | 276 | } |
277 | if (incidence->zaurusStat() > 0) { | ||
278 | incidence->setNonKDECustomProperty("X-ZAURUSSTAT", QString::number(incidence->zaurusStat())); | ||
279 | } | ||
280 | 277 | ||
281 | writeIncidenceBase(parent,incidence); | 278 | writeIncidenceBase(parent,incidence); |
282 | if (incidence->cancelled()) { | 279 | if (incidence->cancelled()) { |
283 | icalcomponent_add_property(parent,icalproperty_new_status(ICAL_STATUS_CANCELLED)); | 280 | icalcomponent_add_property(parent,icalproperty_new_status(ICAL_STATUS_CANCELLED)); |
284 | } | 281 | } |
285 | 282 | ||
@@ -1290,17 +1287,12 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence) | |||
1290 | 1287 | ||
1291 | kp = incidence->nonKDECustomProperty("X-ZAURUSUID"); | 1288 | kp = incidence->nonKDECustomProperty("X-ZAURUSUID"); |
1292 | if (!kp.isNull()) { | 1289 | if (!kp.isNull()) { |
1293 | incidence->setZaurusUid(kp.toInt()); | 1290 | incidence->setZaurusUid(kp.toInt()); |
1294 | } | 1291 | } |
1295 | 1292 | ||
1296 | kp = incidence->nonKDECustomProperty("X-ZAURUSSTAT"); | ||
1297 | if (!kp.isNull()) { | ||
1298 | incidence->setZaurusStat(kp.toInt()); | ||
1299 | } | ||
1300 | |||
1301 | // Cancel backwards compatibility mode for subsequent changes by the application | 1293 | // Cancel backwards compatibility mode for subsequent changes by the application |
1302 | incidence->recurrence()->setCompatVersion(); | 1294 | incidence->recurrence()->setCompatVersion(); |
1303 | 1295 | ||
1304 | // add categories | 1296 | // add categories |
1305 | incidence->setCategories(categories); | 1297 | incidence->setCategories(categories); |
1306 | 1298 | ||
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 9479048..707d666 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp | |||
@@ -37,13 +37,13 @@ IncidenceBase::IncidenceBase() : | |||
37 | mFloats = false; | 37 | mFloats = false; |
38 | mDuration = 0; | 38 | mDuration = 0; |
39 | mHasDuration = false; | 39 | mHasDuration = false; |
40 | mPilotId = 0; | 40 | mPilotId = 0; |
41 | mZaurusId = -1; | 41 | mZaurusId = -1; |
42 | mZaurusUid = 0; | 42 | mZaurusUid = 0; |
43 | mZaurusStat = 0; | 43 | mTempSyncStat = 0; |
44 | mSyncStatus = 0; | 44 | mSyncStatus = 0; |
45 | mAttendees.setAutoDelete( true ); | 45 | mAttendees.setAutoDelete( true ); |
46 | } | 46 | } |
47 | 47 | ||
48 | IncidenceBase::IncidenceBase(const IncidenceBase &i) : | 48 | IncidenceBase::IncidenceBase(const IncidenceBase &i) : |
49 | CustomProperties( i ) | 49 | CustomProperties( i ) |
@@ -60,13 +60,13 @@ IncidenceBase::IncidenceBase(const IncidenceBase &i) : | |||
60 | } | 60 | } |
61 | mFloats = i.mFloats; | 61 | mFloats = i.mFloats; |
62 | mLastModified = i.mLastModified; | 62 | mLastModified = i.mLastModified; |
63 | mPilotId = i.mPilotId; | 63 | mPilotId = i.mPilotId; |
64 | mZaurusId = i.mZaurusId; | 64 | mZaurusId = i.mZaurusId; |
65 | mZaurusUid = i.mZaurusUid; | 65 | mZaurusUid = i.mZaurusUid; |
66 | mZaurusStat = i.mZaurusStat; | 66 | mTempSyncStat = i.mTempSyncStat; |
67 | mSyncStatus = i.mSyncStatus; | 67 | mSyncStatus = i.mSyncStatus; |
68 | 68 | ||
69 | // The copied object is a new one, so it isn't observed by the observer | 69 | // The copied object is a new one, so it isn't observed by the observer |
70 | // of the original object. | 70 | // of the original object. |
71 | mObservers.clear(); | 71 | mObservers.clear(); |
72 | 72 | ||
@@ -359,20 +359,20 @@ int IncidenceBase::zaurusUid() const | |||
359 | void IncidenceBase::setZaurusUid( int id ) | 359 | void IncidenceBase::setZaurusUid( int id ) |
360 | { | 360 | { |
361 | if (mReadOnly) return; | 361 | if (mReadOnly) return; |
362 | mZaurusUid = id; | 362 | mZaurusUid = id; |
363 | } | 363 | } |
364 | 364 | ||
365 | int IncidenceBase::zaurusStat() const | 365 | int IncidenceBase::tempSyncStat() const |
366 | { | 366 | { |
367 | return mZaurusStat; | 367 | return mTempSyncStat; |
368 | } | 368 | } |
369 | void IncidenceBase::setZaurusStat( int id ) | 369 | void IncidenceBase::setTempSyncStat( int id ) |
370 | { | 370 | { |
371 | if (mReadOnly) return; | 371 | if (mReadOnly) return; |
372 | mZaurusStat = id; | 372 | mTempSyncStat = id; |
373 | } | 373 | } |
374 | 374 | ||
375 | void IncidenceBase::registerObserver( IncidenceBase::Observer *observer ) | 375 | void IncidenceBase::registerObserver( IncidenceBase::Observer *observer ) |
376 | { | 376 | { |
377 | if( !mObservers.contains(observer) ) mObservers.append( observer ); | 377 | if( !mObservers.contains(observer) ) mObservers.append( observer ); |
378 | } | 378 | } |
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index 0ab7eef..ce6e254 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h | |||
@@ -127,14 +127,14 @@ class IncidenceBase : public CustomProperties | |||
127 | int pilotId() const; | 127 | int pilotId() const; |
128 | 128 | ||
129 | void setZaurusId(int id); | 129 | void setZaurusId(int id); |
130 | int zaurusId() const; | 130 | int zaurusId() const; |
131 | void setZaurusUid(int id); | 131 | void setZaurusUid(int id); |
132 | int zaurusUid() const; | 132 | int zaurusUid() const; |
133 | void setZaurusStat(int id); | 133 | void setTempSyncStat(int id); |
134 | int zaurusStat() const; | 134 | int tempSyncStat() const; |
135 | 135 | ||
136 | void registerObserver( Observer * ); | 136 | void registerObserver( Observer * ); |
137 | void unRegisterObserver( Observer * ); | 137 | void unRegisterObserver( Observer * ); |
138 | void updated(); | 138 | void updated(); |
139 | 139 | ||
140 | protected: | 140 | protected: |
@@ -152,13 +152,13 @@ class IncidenceBase : public CustomProperties | |||
152 | bool mFloats; | 152 | bool mFloats; |
153 | 153 | ||
154 | int mDuration; | 154 | int mDuration; |
155 | bool mHasDuration; | 155 | bool mHasDuration; |
156 | int mZaurusId; | 156 | int mZaurusId; |
157 | int mZaurusUid; | 157 | int mZaurusUid; |
158 | int mZaurusStat; | 158 | int mTempSyncStat; |
159 | 159 | ||
160 | // PILOT SYNCHRONIZATION STUFF | 160 | // PILOT SYNCHRONIZATION STUFF |
161 | int mPilotId; // unique id for pilot sync | 161 | int mPilotId; // unique id for pilot sync |
162 | int mSyncStatus; // status (for sync) | 162 | int mSyncStatus; // status (for sync) |
163 | 163 | ||
164 | QPtrList<Observer> mObservers; | 164 | QPtrList<Observer> mObservers; |
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index 973f19d..d39d2dd 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp | |||
@@ -89,13 +89,13 @@ class SharpParser : public QObject | |||
89 | if ( event ) | 89 | if ( event ) |
90 | event = (Event*)event->clone(); | 90 | event = (Event*)event->clone(); |
91 | else | 91 | else |
92 | event = new Event; | 92 | event = new Event; |
93 | event->setZaurusId( attList[0].toInt() ); | 93 | event->setZaurusId( attList[0].toInt() ); |
94 | event->setZaurusUid( cSum ); | 94 | event->setZaurusUid( cSum ); |
95 | event->setZaurusStat(SYNC_TEMPSTATE_NEW_EXTERNAL ); | 95 | event->setTempSyncStat(SYNC_TEMPSTATE_NEW_EXTERNAL ); |
96 | 96 | ||
97 | event->setSummary( attList[2] ); | 97 | event->setSummary( attList[2] ); |
98 | event->setLocation( attList[3] ); | 98 | event->setLocation( attList[3] ); |
99 | event->setDescription( attList[4] ); | 99 | event->setDescription( attList[4] ); |
100 | if ( attList[7] == "1" ) { | 100 | if ( attList[7] == "1" ) { |
101 | event->setDtStart( QDateTime(fromString( attList[17]+"000000", false ).date(),QTime(0,0,0 ) )); | 101 | event->setDtStart( QDateTime(fromString( attList[17]+"000000", false ).date(),QTime(0,0,0 ) )); |
@@ -200,13 +200,13 @@ class SharpParser : public QObject | |||
200 | //1,,,,,1,4,Loch zumachen,"" | 200 | //1,,,,,1,4,Loch zumachen,"" |
201 | //3,Privat,20040317T000000,20040318T000000,20040319T000000,0,5,Call bbb,"notes123 bbb gggg ""bb "" " | 201 | //3,Privat,20040317T000000,20040318T000000,20040319T000000,0,5,Call bbb,"notes123 bbb gggg ""bb "" " |
202 | //2,"Familie,Freunde,Holiday",20040318T000000,20040324T000000,20040317T000000,1,2,tod2,notes | 202 | //2,"Familie,Freunde,Holiday",20040318T000000,20040324T000000,20040317T000000,1,2,tod2,notes |
203 | 203 | ||
204 | todo->setZaurusId( attList[0].toInt() ); | 204 | todo->setZaurusId( attList[0].toInt() ); |
205 | todo->setZaurusUid( cSum ); | 205 | todo->setZaurusUid( cSum ); |
206 | todo->setZaurusStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); | 206 | todo->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); |
207 | 207 | ||
208 | todo->setSummary( attList[7] ); | 208 | todo->setSummary( attList[7] ); |
209 | todo->setDescription( attList[8]); | 209 | todo->setDescription( attList[8]); |
210 | 210 | ||
211 | int priority = attList[6].toInt(); | 211 | int priority = attList[6].toInt(); |
212 | if ( priority == 0 ) priority = 3; | 212 | if ( priority == 0 ) priority = 3; |
@@ -465,13 +465,13 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc ) | |||
465 | bool ok; | 465 | bool ok; |
466 | int newnum = templist[0].toInt( &ok ); | 466 | int newnum = templist[0].toInt( &ok ); |
467 | if ( ok && newnum > 0) { | 467 | if ( ok && newnum > 0) { |
468 | retval = newnum; | 468 | retval = newnum; |
469 | inc->setZaurusId( newnum ); | 469 | inc->setZaurusId( newnum ); |
470 | inc->setZaurusUid( getCsum( templist ) ); | 470 | inc->setZaurusUid( getCsum( templist ) ); |
471 | inc->setZaurusStat( SYNC_TEMPSTATE_NEW_ID ); | 471 | inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); |
472 | } | 472 | } |
473 | } | 473 | } |
474 | } | 474 | } |
475 | //qDebug("getNumFromRecord returning : %d ", retval); | 475 | //qDebug("getNumFromRecord returning : %d ", retval); |
476 | return retval; | 476 | return retval; |
477 | } | 477 | } |
@@ -504,17 +504,17 @@ bool SharpFormat::save( Calendar *calendar) | |||
504 | bool deleteEnt = false; | 504 | bool deleteEnt = false; |
505 | bool changeEnt = false; | 505 | bool changeEnt = false; |
506 | QString message = i18n("Processing event # "); | 506 | QString message = i18n("Processing event # "); |
507 | int procCount = 0; | 507 | int procCount = 0; |
508 | while ( ev ) { | 508 | while ( ev ) { |
509 | //qDebug("i %d ", ++i); | 509 | //qDebug("i %d ", ++i); |
510 | if ( ev->zaurusStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { | 510 | if ( ev->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { |
511 | status.setText ( message + QString::number ( ++procCount ) ); | 511 | status.setText ( message + QString::number ( ++procCount ) ); |
512 | qApp->processEvents(); | 512 | qApp->processEvents(); |
513 | QString eString = getEventString( ev ); | 513 | QString eString = getEventString( ev ); |
514 | if ( ev->zaurusStat() == SYNC_TEMPSTATE_DELETE ) { // delete | 514 | if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete |
515 | // deleting empty strings does not work. | 515 | // deleting empty strings does not work. |
516 | // we write first and x and then delete the record with the x | 516 | // we write first and x and then delete the record with the x |
517 | eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); | 517 | eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); |
518 | changeString += eString + "\n"; | 518 | changeString += eString + "\n"; |
519 | deleteString += eString + "\n"; | 519 | deleteString += eString + "\n"; |
520 | deleteEnt = true; | 520 | deleteEnt = true; |
@@ -590,17 +590,17 @@ bool SharpFormat::save( Calendar *calendar) | |||
590 | QPtrList<Todo> tl = calendar->rawTodos(); | 590 | QPtrList<Todo> tl = calendar->rawTodos(); |
591 | Todo* to = tl.first(); | 591 | Todo* to = tl.first(); |
592 | i = 0; | 592 | i = 0; |
593 | message = i18n("Processing todo # "); | 593 | message = i18n("Processing todo # "); |
594 | procCount = 0; | 594 | procCount = 0; |
595 | while ( to ) { | 595 | while ( to ) { |
596 | if ( to->zaurusStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { | 596 | if ( to->tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { |
597 | status.setText ( message + QString::number ( ++procCount ) ); | 597 | status.setText ( message + QString::number ( ++procCount ) ); |
598 | qApp->processEvents(); | 598 | qApp->processEvents(); |
599 | QString eString = getTodoString( to ); | 599 | QString eString = getTodoString( to ); |
600 | if ( to->zaurusStat() == SYNC_TEMPSTATE_DELETE ) { // delete | 600 | if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { // delete |
601 | // deleting empty strings does not work. | 601 | // deleting empty strings does not work. |
602 | // we write first and x and then delete the record with the x | 602 | // we write first and x and then delete the record with the x |
603 | eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); | 603 | eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); |
604 | changeString += eString + "\n"; | 604 | changeString += eString + "\n"; |
605 | deleteString += eString + "\n"; | 605 | deleteString += eString + "\n"; |
606 | deleteEnt = true; | 606 | deleteEnt = true; |