author | zautrix <zautrix> | 2004-08-01 11:37:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-01 11:37:35 (UTC) |
commit | e954cc1e29b129982e4d07c4f490d7e881597374 (patch) (unidiff) | |
tree | 29e7bdcf20952b813637083596102f7e7b080567 /libkcal | |
parent | 8a394f316feb828954d69480553f85c9c0f4b353 (diff) | |
download | kdepimpi-e954cc1e29b129982e4d07c4f490d7e881597374.zip kdepimpi-e954cc1e29b129982e4d07c4f490d7e881597374.tar.gz kdepimpi-e954cc1e29b129982e4d07c4f490d7e881597374.tar.bz2 |
Made sync code more readable by using defines
-rw-r--r-- | libkcal/sharpformat.cpp | 15 | ||||
-rw-r--r-- | libkcal/syncdefines.h | 22 |
2 files changed, 30 insertions, 7 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index f83f72e..973f19d 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp | |||
@@ -44,2 +44,3 @@ | |||
44 | #include "sharpformat.h" | 44 | #include "sharpformat.h" |
45 | #include "syncdefines.h" | ||
45 | 46 | ||
@@ -93,3 +94,3 @@ class SharpParser : public QObject | |||
93 | event->setZaurusUid( cSum ); | 94 | event->setZaurusUid( cSum ); |
94 | event->setZaurusStat( -2 ); | 95 | event->setZaurusStat(SYNC_TEMPSTATE_NEW_EXTERNAL ); |
95 | 96 | ||
@@ -204,3 +205,3 @@ class SharpParser : public QObject | |||
204 | todo->setZaurusUid( cSum ); | 205 | todo->setZaurusUid( cSum ); |
205 | todo->setZaurusStat( -2 ); | 206 | todo->setZaurusStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); |
206 | 207 | ||
@@ -469,3 +470,3 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc ) | |||
469 | inc->setZaurusUid( getCsum( templist ) ); | 470 | inc->setZaurusUid( getCsum( templist ) ); |
470 | inc->setZaurusStat( -4 ); | 471 | inc->setZaurusStat( SYNC_TEMPSTATE_NEW_ID ); |
471 | } | 472 | } |
@@ -508,3 +509,3 @@ bool SharpFormat::save( Calendar *calendar) | |||
508 | //qDebug("i %d ", ++i); | 509 | //qDebug("i %d ", ++i); |
509 | if ( ev->zaurusStat() != -2 ) { | 510 | if ( ev->zaurusStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { |
510 | status.setText ( message + QString::number ( ++procCount ) ); | 511 | status.setText ( message + QString::number ( ++procCount ) ); |
@@ -512,3 +513,3 @@ bool SharpFormat::save( Calendar *calendar) | |||
512 | QString eString = getEventString( ev ); | 513 | QString eString = getEventString( ev ); |
513 | if ( ev->zaurusStat() == -3 ) { // delete | 514 | if ( ev->zaurusStat() == SYNC_TEMPSTATE_DELETE ) { // delete |
514 | // deleting empty strings does not work. | 515 | // deleting empty strings does not work. |
@@ -594,3 +595,3 @@ bool SharpFormat::save( Calendar *calendar) | |||
594 | while ( to ) { | 595 | while ( to ) { |
595 | if ( to->zaurusStat() != -2 ) { | 596 | if ( to->zaurusStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { |
596 | status.setText ( message + QString::number ( ++procCount ) ); | 597 | status.setText ( message + QString::number ( ++procCount ) ); |
@@ -598,3 +599,3 @@ bool SharpFormat::save( Calendar *calendar) | |||
598 | QString eString = getTodoString( to ); | 599 | QString eString = getTodoString( to ); |
599 | if ( to->zaurusStat() == -3 ) { // delete | 600 | if ( to->zaurusStat() == SYNC_TEMPSTATE_DELETE ) { // delete |
600 | // deleting empty strings does not work. | 601 | // deleting empty strings does not work. |
diff --git a/libkcal/syncdefines.h b/libkcal/syncdefines.h new file mode 100644 index 0000000..57642ec --- a/dev/null +++ b/libkcal/syncdefines.h | |||
@@ -0,0 +1,22 @@ | |||
1 | |||
2 | #ifndef _KSYNC_DEFINES_H_ | ||
3 | #define _KSYNC_DEFINES_H_ | ||
4 | |||
5 | #define SYNC_PREF_LOCAL 0 | ||
6 | #define SYNC_PREF_REMOTE 1 | ||
7 | #define SYNC_PREF_NEWEST 2 | ||
8 | #define SYNC_PREF_ASK 3 | ||
9 | #define SYNC_PREF_FORCE_LOCAL 4 | ||
10 | #define SYNC_PREF_FORCE_REMOTE 5 | ||
11 | #define SYNC_PREF_TAKE_BOTH 6 | ||
12 | |||
13 | #define SYNC_MODE_NORMAL 0 | ||
14 | #define SYNC_MODE_EXTERNAL 1 | ||
15 | |||
16 | #define SYNC_TEMPSTATE_INITIAL 0 | ||
17 | #define SYNC_TEMPSTATE_NEW_EXTERNAL -2 | ||
18 | #define SYNC_TEMPSTATE_DELETE -3 | ||
19 | #define SYNC_TEMPSTATE_NEW_ID -4 | ||
20 | |||
21 | |||
22 | #endif | ||