-rw-r--r-- | Makefile | 30 | ||||
-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, 62 insertions, 62 deletions
@@ -28,15 +28,9 @@ SUBDIRS_MICROKDE = \ | |||
28 | SUBDIRS_QTOPIA_PLUGIN = \ | 28 | SUBDIRS_QTOPIA_PLUGIN = \ |
29 | kabc/converter/qtopia \ | 29 | kabc/plugins/qtopia |
30 | kabc/plugins/qtopia \ | ||
31 | kaddressbook/xxport/qtopia | ||
32 | 30 | ||
33 | SUBDIRS_OPIE_PLUGIN = \ | 31 | SUBDIRS_OPIE_PLUGIN = \ |
34 | kabc/converter/opie \ | 32 | kabc/plugins/opie |
35 | kabc/plugins/opie \ | ||
36 | kaddressbook/xxport/opie | ||
37 | 33 | ||
38 | SUBDIRS_SHARP_PLUGIN = \ | 34 | SUBDIRS_SHARP_PLUGIN = \ |
39 | kabc/converter/sharpdtm \ | 35 | kabc/plugins/sharpdtm |
40 | kabc/plugins/sharpdtm \ | ||
41 | kaddressbook/xxport/sharpdtm | ||
42 | 36 | ||
@@ -150,6 +144,6 @@ variable_test: variable_info | |||
150 | else | 144 | else |
151 | ifndef SHARPDTMSDK | 145 | ifndef SHARPDTMSDK |
152 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) | 146 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) |
153 | $(error SHARPDTMSDK is not defined) | 147 | $(error SHARPDTMSDK is not defined) |
154 | endif | 148 | endif |
155 | endif | 149 | endif |
@@ -198,5 +192,2 @@ tmake: objects \ | |||
198 | kabc/Makefile$(PLATFORM) \ | 192 | kabc/Makefile$(PLATFORM) \ |
199 | kabc/converter/opie/Makefile$(PLATFORM) \ | ||
200 | kabc/converter/qtopia/Makefile$(PLATFORM) \ | ||
201 | kabc/converter/sharpdtm/Makefile$(PLATFORM) \ | ||
202 | kabc/formats/binary/Makefile$(PLATFORM) \ | 193 | kabc/formats/binary/Makefile$(PLATFORM) \ |
@@ -215,3 +206,2 @@ tmake: objects \ | |||
215 | kmicromail/libmailwrapper/Makefile$(PLATFORM) | 206 | kmicromail/libmailwrapper/Makefile$(PLATFORM) |
216 | |||
217 | 207 | ||
@@ -247,12 +237,2 @@ kabc/Makefile$(PLATFORM): kabc/kabcE.pro | |||
247 | 237 | ||
248 | kabc/converter/opie/Makefile$(PLATFORM): kabc/converter/opie/opieE.pro | ||
249 | cd kabc/converter/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieE.pro -o Makefile$(PLATFORM) | ||
250 | |||
251 | kabc/converter/qtopia/Makefile$(PLATFORM): kabc/converter/qtopia/qtopiaE.pro | ||
252 | cd kabc/converter/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" qtopiaE.pro -o Makefile$(PLATFORM) | ||
253 | |||
254 | kabc/converter/sharpdtm/Makefile$(PLATFORM): kabc/converter/sharpdtm/sharpdtmE.pro | ||
255 | cd kabc/converter/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" sharpdtmE.pro -o Makefile$(PLATFORM) | ||
256 | |||
257 | |||
258 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro | 238 | 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; | |||
131 | 131 | ||
132 | #define SYNC_MODE_NORMAL 0 | 132 | |
133 | #define SYNC_MODE_SHARP 1 | ||
134 | #define SYNC_MODE_QTOPIA 2 | ||
135 | 133 | ||
@@ -729,6 +727,6 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
729 | QDateTime lastSync = mLastCalendarSync; | 727 | QDateTime lastSync = mLastCalendarSync; |
730 | if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { | 728 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
731 | bool remCh, locCh; | 729 | bool remCh, locCh; |
732 | remCh = ( remote->zaurusUid() != local->zaurusUid() ); | 730 | remCh = ( remote->zaurusUid() != local->zaurusUid() ); |
733 | locCh = ( local->zaurusStat() != local->revision() ); | 731 | locCh = ( local->lastModified() > mLastCalendarSync ); |
734 | //qDebug("locCh %d remCh %d locuid %d remuid %d", locCh, remCh,local->zaurusUid(), remote->zaurusUid() ); | 732 | //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 | |||
752 | full = true; | 750 | full = true; |
753 | if ( mode < 3 ) | 751 | if ( mode < SYNC_PREF_ASK ) |
754 | mode = 3; | 752 | mode = SYNC_PREF_ASK; |
755 | } else { | 753 | } else { |
@@ -776,6 +774,6 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
776 | //qDebug("equal "); | 774 | //qDebug("equal "); |
777 | if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { | 775 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
778 | local->setZaurusUid( remote->zaurusUid() ); | 776 | local->setZaurusUid( remote->zaurusUid() ); |
779 | } | 777 | } |
780 | if ( mode < 4 ) | 778 | if ( mode < SYNC_PREF_FORCE_LOCAL ) |
781 | return 0; | 779 | return 0; |
@@ -787,7 +785,7 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
787 | bool localIsNew; | 785 | bool localIsNew; |
788 | if ( full && mode < 2 ) | 786 | if ( full && mode < SYNC_PREF_NEWEST ) |
789 | mode = 3; | 787 | mode = SYNC_PREF_ASK; |
790 | 788 | ||
791 | switch( mode ) { | 789 | switch( mode ) { |
792 | case 0: | 790 | case SYNC_PREF_LOCAL: |
793 | if ( lastSync > remote->lastModified() ) | 791 | if ( lastSync > remote->lastModified() ) |
@@ -798,3 +796,3 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
798 | break; | 796 | break; |
799 | case 1: | 797 | case SYNC_PREF_REMOTE: |
800 | if ( lastSync > remote->lastModified() ) | 798 | if ( lastSync > remote->lastModified() ) |
@@ -805,3 +803,3 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
805 | break; | 803 | break; |
806 | case 2: | 804 | case SYNC_PREF_NEWEST: |
807 | if ( local->lastModified() > remote->lastModified() ) | 805 | if ( local->lastModified() > remote->lastModified() ) |
@@ -811,3 +809,3 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
811 | break; | 809 | break; |
812 | case 3: | 810 | case SYNC_PREF_ASK: |
813 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), local->lastModified().toString().latin1(), remote->lastModified().toString().latin1() ); | 811 | //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 | |||
837 | break; | 835 | break; |
838 | case 4: | 836 | case SYNC_PREF_FORCE_LOCAL: |
839 | return 1; | 837 | return 1; |
840 | break; | 838 | break; |
841 | case 5: | 839 | case SYNC_PREF_FORCE_REMOTE: |
842 | return 2; | 840 | return 2; |
@@ -845,2 +843,3 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b | |||
845 | default: | 843 | default: |
844 | // SYNC_PREF_TAKE_BOTH not implemented | ||
846 | break; | 845 | break; |
@@ -998,3 +997,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
998 | } else { // no conflict | 997 | } else { // no conflict |
999 | if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { | 998 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1000 | QString des = eventLSync->description(); | 999 | QString des = eventLSync->description(); |
@@ -1004,3 +1003,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1004 | if ( des.find(pref+QString::number( inR->zaurusId() ) +"," ) >= 0 && mode != 5) { // delete it | 1003 | if ( des.find(pref+QString::number( inR->zaurusId() ) +"," ) >= 0 && mode != 5) { // delete it |
1005 | inR->setZaurusStat( -3 ); | 1004 | inR->setZaurusStat( SYNC_TEMPSTATE_DELETE ); |
1006 | //remote->deleteIncidence( inR ); | 1005 | //remote->deleteIncidence( inR ); |
@@ -1047,3 +1046,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1047 | skipIncidence = true; | 1046 | skipIncidence = true; |
1048 | if ( mGlobalSyncMode == SYNC_MODE_SHARP && inL->type() == "Journal" ) | 1047 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) |
1049 | skipIncidence = true; | 1048 | skipIncidence = true; |
@@ -1052,3 +1051,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1052 | if ( ! inR ) { | 1051 | if ( ! inR ) { |
1053 | if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { | 1052 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1054 | if ( inL->zaurusId() >= 0 && mode != 4 ) { | 1053 | if ( inL->zaurusId() >= 0 && mode != 4 ) { |
@@ -1143,3 +1142,3 @@ void CalendarView::syncSharp() | |||
1143 | #ifndef DESKTOP_VERSION | 1142 | #ifndef DESKTOP_VERSION |
1144 | mGlobalSyncMode = SYNC_MODE_SHARP; | 1143 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
1145 | //mCurrentSyncDevice = "sharp-DTM"; | 1144 | //mCurrentSyncDevice = "sharp-DTM"; |
@@ -1162,2 +1161,3 @@ void CalendarView::syncSharp() | |||
1162 | Incidence* inc = iL.first(); | 1161 | Incidence* inc = iL.first(); |
1162 | /* obsolete | ||
1163 | while ( inc ) { | 1163 | while ( inc ) { |
@@ -1166,2 +1166,3 @@ void CalendarView::syncSharp() | |||
1166 | } | 1166 | } |
1167 | */ | ||
1167 | // pending: clean last sync event description | 1168 | // pending: clean last sync event description |
@@ -1172,3 +1173,3 @@ void CalendarView::syncSharp() | |||
1172 | while ( inc ) { | 1173 | while ( inc ) { |
1173 | if ( inc->zaurusStat() == -4 ) { | 1174 | if ( inc->zaurusStat() == SYNC_TEMPSTATE_NEW_ID ) { |
1174 | loc = mCalendar->incidence(inc->uid() ); | 1175 | 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 @@ | |||
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 | ||
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 @@ | |||
29 | 29 | ||
30 | #define SYNC_PREF_LOCAL 0 | 30 | #include <libkcal/syncdefines.h> |
31 | #define SYNC_PREF_REMOTE 1 | 31 | |
32 | #define SYNC_PREF_NEWEST 2 | 32 | |
33 | #define SYNC_PREF_ASK 3 | ||
34 | #define SYNC_PREF_FORCE_LOCAL 4 | ||
35 | #define SYNC_PREF_FORCE_REMOTE 5 | ||
36 | #define SYNC_PREF_TAKE_BOTH 6 | ||
37 | 33 | ||