summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile30
-rw-r--r--korganizer/calendarview.cpp47
-rw-r--r--libkcal/sharpformat.cpp15
-rw-r--r--libkcal/syncdefines.h22
-rw-r--r--libkdepim/ksyncprofile.h10
5 files changed, 62 insertions, 62 deletions
diff --git a/Makefile b/Makefile
index 826e70e..19c57e5 100644
--- a/Makefile
+++ b/Makefile
@@ -21,29 +21,23 @@ SUBDIRS_MICROKDE = \
kabc/formats/binary \
kabc/plugins/file \
kabc/plugins/dir \
korganizer \
kalarmd \
kaddressbook
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
SUBDIRS_LDAP_PLUGIN = \
kabc/plugins/ldap
SUBDIRS_MICROMAIL = \
kmicromail/libetpan \
kmicromail/libmailwrapper \
kmicromail
@@ -143,20 +137,20 @@ variable_test: variable_info
@echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN)
endif
ifdef BUILD_NO_MICROMAIL
@echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL)
endif
ifdef BUILD_NO_SHARP_PLUGIN
@echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN)
else
- ifndef SHARPDTMSDK
+ ifndef SHARPDTMSDK
@echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK)
$(error SHARPDTMSDK is not defined)
- endif
+ endif
endif
@echo --------------------------------------
objects:
for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done
for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done
mkdir -p libical/lib/$(PLATFORM)
@@ -191,34 +185,30 @@ tmake: objects \
microkde/Makefile$(PLATFORM) \
libkcal/Makefile$(PLATFORM) \
libkdepim/Makefile$(PLATFORM) \
korganizer/Makefile$(PLATFORM) \
kalarmd/Makefile$(PLATFORM) \
libical/src/libical/Makefile$(PLATFORM) \
libical/src/libicalss/Makefile$(PLATFORM) \
kabc/Makefile$(PLATFORM) \
- kabc/converter/opie/Makefile$(PLATFORM) \
- kabc/converter/qtopia/Makefile$(PLATFORM) \
- kabc/converter/sharpdtm/Makefile$(PLATFORM) \
kabc/formats/binary/Makefile$(PLATFORM) \
kabc/plugins/file/Makefile$(PLATFORM) \
kabc/plugins/dir/Makefile$(PLATFORM) \
kabc/plugins/ldap/Makefile$(PLATFORM) \
kabc/plugins/opie/Makefile$(PLATFORM) \
kabc/plugins/qtopia/Makefile$(PLATFORM) \
kabc/plugins/sharpdtm/Makefile$(PLATFORM) \
kaddressbook/xxport/opie/Makefile$(PLATFORM) \
kaddressbook/xxport/qtopia/Makefile$(PLATFORM) \
kaddressbook/xxport/sharpdtm/Makefile$(PLATFORM) \
kaddressbook/Makefile$(PLATFORM) \
kmicromail/Makefile$(PLATFORM) \
kmicromail/libetpan/Makefile$(PLATFORM) \
kmicromail/libmailwrapper/Makefile$(PLATFORM)
-
qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro
cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" qtcompat.pro -o Makefile$(PLATFORM)
microkde/Makefile$(PLATFORM): microkde/microkdeE.pro
cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" microkdeE.pro -o Makefile$(PLATFORM)
@@ -240,26 +230,16 @@ libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro
cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" libicalE.pro -o Makefile$(PLATFORM)
libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro
cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" libicalssE.pro -o Makefile$(PLATFORM)
kabc/Makefile$(PLATFORM): kabc/kabcE.pro
cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcE.pro -o Makefile$(PLATFORM)
-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
cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcformat_binaryE.pro -o Makefile$(PLATFORM)
kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro
cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" fileE.pro -o Makefile$(PLATFORM)
kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro
cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" dirE.pro -o Makefile$(PLATFORM)
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 58b3d70..fd68dc4 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -124,19 +124,17 @@
#else
#include <qprocess.h>
#endif
using namespace KOrg;
using namespace KCal;
extern int globalFlagBlockAgenda;
extern int globalFlagBlockStartup;
-#define SYNC_MODE_NORMAL 0
-#define SYNC_MODE_SHARP 1
-#define SYNC_MODE_QTOPIA 2
+
class KOBeamPrefs : public QDialog
{
public:
KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
QDialog( parent, name, true )
{
setCaption( i18n("Beam Options") );
@@ -722,20 +720,20 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b
// int zaurusUid() const;
// void setZaurusStat(int id);
// int zaurusStat() const;
// 0 equal
// 1 take local
// 2 take remote
// 3 cancel
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() );
if ( !remCh && ! locCh ) {
//qDebug("both not changed ");
lastSync = local->lastModified().addDays(1);
} else {
if ( locCh ) {
//qDebug("loc changed %d %d", local->zaurusStat(), local->revision() );
lastSync = local->lastModified().addDays( -1 );
@@ -745,18 +743,18 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b
//qDebug(" not loc changed ");
lastSync = local->lastModified().addDays( 1 );
if ( remCh )
remote->setLastModified( lastSync.addDays( 1 ) );
}
}
full = true;
- if ( mode < 3 )
- mode = 3;
+ if ( mode < SYNC_PREF_ASK )
+ mode = SYNC_PREF_ASK;
} else {
if ( local->lastModified() == remote->lastModified() )
if ( local->revision() == remote->revision() )
return 0;
}
// qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() );
@@ -769,52 +767,52 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b
equ = (*((Event*) local) == *((Event*) remote));
}
else if ( local->type() =="Todo" )
equ = (*((Todo*) local) == (*(Todo*) remote));
else if ( local->type() =="Journal" )
equ = (*((Journal*) local) == *((Journal*) remote));
if ( equ ) {
//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;
}//else //debug only
//qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
}
int result;
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() )
return 1;
if ( lastSync > local->lastModified() )
return 2;
return 1;
break;
- case 1:
+ case SYNC_PREF_REMOTE:
if ( lastSync > remote->lastModified() )
return 1;
if ( lastSync > local->lastModified() )
return 2;
return 2;
break;
- case 2:
+ case SYNC_PREF_NEWEST:
if ( local->lastModified() > remote->lastModified() )
return 1;
else
return 2;
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() );
if ( lastSync > remote->lastModified() )
return 1;
if ( lastSync > local->lastModified() )
return 2;
//qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), local->lastModified().toString().latin1(), remote->lastModified().toString().latin1() );
localIsNew = local->lastModified() > remote->lastModified();
if ( localIsNew )
@@ -830,24 +828,25 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b
getEventViewerDialog()->setColorMode( 0 );
//qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() );
getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!"));
getEventViewerDialog()->showMe();
result = getEventViewerDialog()->executeS( localIsNew );
return result;
break;
- case 4:
+ case SYNC_PREF_FORCE_LOCAL:
return 1;
break;
- case 5:
+ case SYNC_PREF_FORCE_REMOTE:
return 2;
break;
default:
+ // SYNC_PREF_TAKE_BOTH not implemented
break;
}
return 0;
}
Event* CalendarView::getLastSyncEvent()
{
Event* lse;
//qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
@@ -991,23 +990,23 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
if ( inR->revision() < maxrev )
inR->setRevision( maxrev );
local->deleteIncidence( inL );
local->addIncidence( inR->clone() );
++changedLocal;
}
}
} else { // no conflict
- if ( mGlobalSyncMode == SYNC_MODE_SHARP ) {
+ if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
QString des = eventLSync->description();
QString pref = "e";
if ( inR->type() == "Todo" )
pref = "t";
if ( des.find(pref+QString::number( inR->zaurusId() ) +"," ) >= 0 && mode != 5) { // delete it
- inR->setZaurusStat( -3 );
+ inR->setZaurusStat( SYNC_TEMPSTATE_DELETE );
//remote->deleteIncidence( inR );
++deletedEventR;
} else {
inR->setLastModified( modifiedCalendar );
local->addIncidence( inR->clone() );
++addedEvent;
}
} else {
@@ -1040,22 +1039,22 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
return false;
if ( incCounter % modulo == 0 )
bar.setProgress( incCounter );
++incCounter;
uid = inL->uid();
bool skipIncidence = false;
if ( uid.left(21) == QString("last-syncEvent-device") )
skipIncidence = true;
- if ( mGlobalSyncMode == SYNC_MODE_SHARP && inL->type() == "Journal" )
+ if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" )
skipIncidence = true;
if ( !skipIncidence ) {
inR = remote->incidence( uid );
if ( ! inR ) {
- if ( mGlobalSyncMode == SYNC_MODE_SHARP ) {
+ if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
if ( inL->zaurusId() >= 0 && mode != 4 ) {
local->deleteIncidence( inL );
++deletedEventL;
} else {
if ( ! KOPrefs::instance()->mWriteBackExistingOnly ) {
inL->setZaurusId( -1 );
++addedEventR;
inL->setLastModified( modifiedCalendar );
@@ -1136,17 +1135,17 @@ bool CalendarView::syncCalendar(QString filename, int mode)
delete calendar;
if ( syncOK )
updateView();
return syncOK;
}
void CalendarView::syncSharp()
{
#ifndef DESKTOP_VERSION
- mGlobalSyncMode = SYNC_MODE_SHARP;
+ mGlobalSyncMode = SYNC_MODE_EXTERNAL;
//mCurrentSyncDevice = "sharp-DTM";
if ( KOPrefs::instance()->mAskForPreferences )
edit_sync_options();
qApp->processEvents();
CalendarLocal* calendar = new CalendarLocal();
calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
bool syncOK = false;
SharpFormat sharpFormat;
@@ -1155,27 +1154,29 @@ void CalendarView::syncSharp()
syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs );
getEventViewerDialog()->setSyncMode( false );
qApp->processEvents();
if ( syncOK ) {
if ( KOPrefs::instance()->mWriteBackFile )
{
QPtrList<Incidence> iL = mCalendar->rawIncidences();
Incidence* inc = iL.first();
+ /* obsolete
while ( inc ) {
inc->setZaurusStat( inc->revision () );
inc = iL.next();
}
+ */
// pending: clean last sync event description
sharpFormat.save(calendar);
iL = calendar->rawIncidences();
inc = iL.first();
Incidence* loc;
while ( inc ) {
- if ( inc->zaurusStat() == -4 ) {
+ if ( inc->zaurusStat() == SYNC_TEMPSTATE_NEW_ID ) {
loc = mCalendar->incidence(inc->uid() );
if ( loc ) {
loc->setZaurusId( inc->zaurusId() );
loc->setZaurusUid( inc->zaurusUid() );
}
}
inc = iL.next();
}
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index f83f72e..973f19d 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -37,16 +37,17 @@
#include <kglobal.h>
#include "calendar.h"
#include "alarm.h"
#include "recurrence.h"
#include "calendarlocal.h"
#include "sharpformat.h"
+#include "syncdefines.h"
using namespace KCal;
//CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//ARSD silentalarm = 0
// 11 RTYP 225 no /0 dialy/ 1 weekly/ 3 month by date/ 2 month by day(pos)/ yearly
@@ -86,17 +87,17 @@ class SharpParser : public QObject
Event *event;
event = existingCalendar->event( attList[0].toInt() );
if ( event )
event = (Event*)event->clone();
else
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] );
event->setDescription( attList[4] );
if ( attList[7] == "1" ) {
event->setDtStart( QDateTime(fromString( attList[17]+"000000", false ).date(),QTime(0,0,0 ) ));
event->setDtEnd( QDateTime(fromString( attList[18]+"000000", false ).date(),QTime(0,0,0 )));
event->setFloats( true );
@@ -197,17 +198,17 @@ class SharpParser : public QObject
//CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1
// 0 1 2 3 4 5 6 7 8
//1,,,,,1,4,Loch zumachen,""
//3,Privat,20040317T000000,20040318T000000,20040319T000000,0,5,Call bbb,"notes123 bbb gggg ""bb "" "
//2,"Familie,Freunde,Holiday",20040318T000000,20040324T000000,20040317T000000,1,2,tod2,notes
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]);
int priority = attList[6].toInt();
if ( priority == 0 ) priority = 3;
todo->setPriority( priority );
@@ -462,17 +463,17 @@ int SharpFormat::getNumFromRecord( QString answer, Incidence* inc )
if ( ccc == 2 && loopCount < 25 ) {
start = 0;
bool ok;
int newnum = templist[0].toInt( &ok );
if ( ok && newnum > 0) {
retval = newnum;
inc->setZaurusId( newnum );
inc->setZaurusUid( getCsum( templist ) );
- inc->setZaurusStat( -4 );
+ inc->setZaurusStat( SYNC_TEMPSTATE_NEW_ID );
}
}
}
//qDebug("getNumFromRecord returning : %d ", retval);
return retval;
}
bool SharpFormat::save( Calendar *calendar)
{
@@ -501,21 +502,21 @@ bool SharpFormat::save( Calendar *calendar)
QString changeString = ePrefix;
QString deleteString = ePrefix;
bool deleteEnt = false;
bool changeEnt = false;
QString message = i18n("Processing event # ");
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\"" );
changeString += eString + "\n";
deleteString += eString + "\n";
deleteEnt = true;
changeEnt = true;
}
@@ -587,21 +588,21 @@ bool SharpFormat::save( Calendar *calendar)
status.setText ( i18n("Processing todos ...") );
qApp->processEvents();
QPtrList<Todo> tl = calendar->rawTodos();
Todo* to = tl.first();
i = 0;
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\"" );
changeString += eString + "\n";
deleteString += eString + "\n";
deleteEnt = true;
changeEnt = true;
}
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
@@ -22,23 +22,19 @@
#include <qptrlist.h>
#include <qcolor.h>
#include <qfont.h>
#include <qstringlist.h>
#include <qobject.h>
#include <qstring.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
+#include <libkcal/syncdefines.h>
+
+
class KConfig;
/**
@short Class for storing a preferences setting
@author Cornelius Schumacher
@see KPref