-rw-r--r-- | Makefile | 26 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 47 | ||||
-rw-r--r-- | libkcal/sharpformat.cpp | 15 | ||||
-rw-r--r-- | libkcal/syncdefines.h | 22 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 10 |
5 files changed, 60 insertions, 60 deletions
@@ -28,15 +28,9 @@ SUBDIRS_MICROKDE = \ SUBDIRS_QTOPIA_PLUGIN = \ - kabc/converter/qtopia \ - kabc/plugins/qtopia \ - kaddressbook/xxport/qtopia + kabc/plugins/qtopia SUBDIRS_OPIE_PLUGIN = \ - kabc/converter/opie \ - kabc/plugins/opie \ - kaddressbook/xxport/opie + kabc/plugins/opie SUBDIRS_SHARP_PLUGIN = \ - kabc/converter/sharpdtm \ - kabc/plugins/sharpdtm \ - kaddressbook/xxport/sharpdtm + kabc/plugins/sharpdtm @@ -198,5 +192,2 @@ tmake: objects \ kabc/Makefile$(PLATFORM) \ - kabc/converter/opie/Makefile$(PLATFORM) \ - kabc/converter/qtopia/Makefile$(PLATFORM) \ - kabc/converter/sharpdtm/Makefile$(PLATFORM) \ kabc/formats/binary/Makefile$(PLATFORM) \ @@ -218,3 +209,2 @@ tmake: objects \ - qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro @@ -247,12 +237,2 @@ kabc/Makefile$(PLATFORM): kabc/kabcE.pro -kabc/converter/opie/Makefile$(PLATFORM): kabc/converter/opie/opieE.pro - cd kabc/converter/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieE.pro -o Makefile$(PLATFORM) - -kabc/converter/qtopia/Makefile$(PLATFORM): kabc/converter/qtopia/qtopiaE.pro - cd kabc/converter/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" qtopiaE.pro -o Makefile$(PLATFORM) - -kabc/converter/sharpdtm/Makefile$(PLATFORM): kabc/converter/sharpdtm/sharpdtmE.pro - cd kabc/converter/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" sharpdtmE.pro -o Makefile$(PLATFORM) - - kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 58b3d70..fd68dc4 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -131,5 +131,3 @@ extern int globalFlagBlockStartup; -#define SYNC_MODE_NORMAL 0 -#define SYNC_MODE_SHARP 1 -#define SYNC_MODE_QTOPIA 2 + @@ -729,6 +727,6 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b QDateTime lastSync = mLastCalendarSync; - if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { + if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { bool remCh, locCh; remCh = ( remote->zaurusUid() != local->zaurusUid() ); - locCh = ( local->zaurusStat() != local->revision() ); + locCh = ( local->lastModified() > mLastCalendarSync ); //qDebug("locCh %d remCh %d locuid %d remuid %d", locCh, remCh,local->zaurusUid(), remote->zaurusUid() ); @@ -752,4 +750,4 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b full = true; - if ( mode < 3 ) - mode = 3; + if ( mode < SYNC_PREF_ASK ) + mode = SYNC_PREF_ASK; } else { @@ -776,6 +774,6 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b //qDebug("equal "); - if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { + if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { local->setZaurusUid( remote->zaurusUid() ); } - if ( mode < 4 ) + if ( mode < SYNC_PREF_FORCE_LOCAL ) return 0; @@ -787,7 +785,7 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b bool localIsNew; - if ( full && mode < 2 ) - mode = 3; + if ( full && mode < SYNC_PREF_NEWEST ) + mode = SYNC_PREF_ASK; switch( mode ) { - case 0: + case SYNC_PREF_LOCAL: if ( lastSync > remote->lastModified() ) @@ -798,3 +796,3 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b break; - case 1: + case SYNC_PREF_REMOTE: if ( lastSync > remote->lastModified() ) @@ -805,3 +803,3 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b break; - case 2: + case SYNC_PREF_NEWEST: if ( local->lastModified() > remote->lastModified() ) @@ -811,3 +809,3 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b break; - case 3: + case SYNC_PREF_ASK: //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), local->lastModified().toString().latin1(), remote->lastModified().toString().latin1() ); @@ -837,6 +835,6 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b break; - case 4: + case SYNC_PREF_FORCE_LOCAL: return 1; break; - case 5: + case SYNC_PREF_FORCE_REMOTE: return 2; @@ -845,2 +843,3 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b default: + // SYNC_PREF_TAKE_BOTH not implemented break; @@ -998,3 +997,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int } else { // no conflict - if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { + if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { QString des = eventLSync->description(); @@ -1004,3 +1003,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int if ( des.find(pref+QString::number( inR->zaurusId() ) +"," ) >= 0 && mode != 5) { // delete it - inR->setZaurusStat( -3 ); + inR->setZaurusStat( SYNC_TEMPSTATE_DELETE ); //remote->deleteIncidence( inR ); @@ -1047,3 +1046,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int skipIncidence = true; - if ( mGlobalSyncMode == SYNC_MODE_SHARP && inL->type() == "Journal" ) + if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) skipIncidence = true; @@ -1052,3 +1051,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int if ( ! inR ) { - if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { + if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { if ( inL->zaurusId() >= 0 && mode != 4 ) { @@ -1143,3 +1142,3 @@ void CalendarView::syncSharp() #ifndef DESKTOP_VERSION - mGlobalSyncMode = SYNC_MODE_SHARP; + mGlobalSyncMode = SYNC_MODE_EXTERNAL; //mCurrentSyncDevice = "sharp-DTM"; @@ -1162,2 +1161,3 @@ void CalendarView::syncSharp() Incidence* inc = iL.first(); + /* obsolete while ( inc ) { @@ -1166,2 +1166,3 @@ void CalendarView::syncSharp() } + */ // pending: clean last sync event description @@ -1172,3 +1173,3 @@ void CalendarView::syncSharp() while ( inc ) { - if ( inc->zaurusStat() == -4 ) { + if ( inc->zaurusStat() == SYNC_TEMPSTATE_NEW_ID ) { loc = mCalendar->incidence(inc->uid() ); 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 @@ #include "sharpformat.h" +#include "syncdefines.h" @@ -93,3 +94,3 @@ class SharpParser : public QObject event->setZaurusUid( cSum ); - event->setZaurusStat( -2 ); + event->setZaurusStat(SYNC_TEMPSTATE_NEW_EXTERNAL ); @@ -204,3 +205,3 @@ class SharpParser : public QObject todo->setZaurusUid( cSum ); - todo->setZaurusStat( -2 ); + todo->setZaurusStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); @@ -469,3 +470,3 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc ) inc->setZaurusUid( getCsum( templist ) ); - inc->setZaurusStat( -4 ); + inc->setZaurusStat( SYNC_TEMPSTATE_NEW_ID ); } @@ -508,3 +509,3 @@ bool SharpFormat::save( Calendar *calendar) //qDebug("i %d ", ++i); - if ( ev->zaurusStat() != -2 ) { + if ( ev->zaurusStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { status.setText ( message + QString::number ( ++procCount ) ); @@ -512,3 +513,3 @@ bool SharpFormat::save( Calendar *calendar) QString eString = getEventString( ev ); - if ( ev->zaurusStat() == -3 ) { // delete + if ( ev->zaurusStat() == SYNC_TEMPSTATE_DELETE ) { // delete // deleting empty strings does not work. @@ -594,3 +595,3 @@ bool SharpFormat::save( Calendar *calendar) while ( to ) { - if ( to->zaurusStat() != -2 ) { + if ( to->zaurusStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { status.setText ( message + QString::number ( ++procCount ) ); @@ -598,3 +599,3 @@ bool SharpFormat::save( Calendar *calendar) QString eString = getTodoString( to ); - if ( to->zaurusStat() == -3 ) { // delete + if ( to->zaurusStat() == SYNC_TEMPSTATE_DELETE ) { // delete // 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 @@ + +#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 diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index 238ffad..3f7f1ac 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h @@ -29,9 +29,5 @@ -#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 +#include <libkcal/syncdefines.h> + + |