-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 @@ -42,6 +42,7 @@ #include "calendarlocal.h" #include "sharpformat.h" +#include "syncdefines.h" using namespace KCal; @@ -91,7 +92,7 @@ class SharpParser : public QObject event = new Event; event->setZaurusId( attList[0].toInt() ); event->setZaurusUid( cSum ); - event->setZaurusStat( -2 ); + event->setZaurusStat(SYNC_TEMPSTATE_NEW_EXTERNAL ); event->setSummary( attList[2] ); event->setLocation( attList[3] ); @@ -202,7 +203,7 @@ class SharpParser : public QObject todo->setZaurusId( attList[0].toInt() ); todo->setZaurusUid( cSum ); - todo->setZaurusStat( -2 ); + todo->setZaurusStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); todo->setSummary( attList[7] ); todo->setDescription( attList[8]); @@ -467,7 +468,7 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc ) retval = newnum; inc->setZaurusId( newnum ); inc->setZaurusUid( getCsum( templist ) ); - inc->setZaurusStat( -4 ); + inc->setZaurusStat( SYNC_TEMPSTATE_NEW_ID ); } } } @@ -506,11 +507,11 @@ bool SharpFormat::save( Calendar *calendar) int procCount = 0; while ( ev ) { //qDebug("i %d ", ++i); - if ( ev->zaurusStat() != -2 ) { + if ( ev->zaurusStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { status.setText ( message + QString::number ( ++procCount ) ); qApp->processEvents(); QString eString = getEventString( ev ); - if ( ev->zaurusStat() == -3 ) { // delete + if ( ev->zaurusStat() == SYNC_TEMPSTATE_DELETE ) { // delete // deleting empty strings does not work. // we write first and x and then delete the record with the x eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); @@ -592,11 +593,11 @@ bool SharpFormat::save( Calendar *calendar) message = i18n("Processing todo # "); procCount = 0; while ( to ) { - if ( to->zaurusStat() != -2 ) { + if ( to->zaurusStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { status.setText ( message + QString::number ( ++procCount ) ); qApp->processEvents(); QString eString = getTodoString( to ); - if ( to->zaurusStat() == -3 ) { // delete + if ( to->zaurusStat() == SYNC_TEMPSTATE_DELETE ) { // delete // deleting empty strings does not work. // we write first and x and then delete the record with the x eString = eString.replace( QRegExp(",\"\""),",\"x\"" ); 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 @@ + +#ifndef _KSYNC_DEFINES_H_ +#define _KSYNC_DEFINES_H_ + +#define SYNC_PREF_LOCAL 0 +#define SYNC_PREF_REMOTE 1 +#define SYNC_PREF_NEWEST 2 +#define SYNC_PREF_ASK 3 +#define SYNC_PREF_FORCE_LOCAL 4 +#define SYNC_PREF_FORCE_REMOTE 5 +#define SYNC_PREF_TAKE_BOTH 6 + +#define SYNC_MODE_NORMAL 0 +#define SYNC_MODE_EXTERNAL 1 + +#define SYNC_TEMPSTATE_INITIAL 0 +#define SYNC_TEMPSTATE_NEW_EXTERNAL -2 +#define SYNC_TEMPSTATE_DELETE -3 +#define SYNC_TEMPSTATE_NEW_ID -4 + + +#endif |