summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2004-10-26 20:04:29 (UTC)
committer zautrix <zautrix>2004-10-26 20:04:29 (UTC)
commit8b111ae30fc51a4a580b8d485bef8ad28b0dde84 (patch) (side-by-side diff)
treefb4cf20f5675e5ff2221ed6eea51785bdd65616c /korganizer
parent62e91b888de607fa5a9f9c0fba807287e57d5d5c (diff)
downloadkdepimpi-8b111ae30fc51a4a580b8d485bef8ad28b0dde84.zip
kdepimpi-8b111ae30fc51a4a580b8d485bef8ad28b0dde84.tar.gz
kdepimpi-8b111ae30fc51a4a580b8d485bef8ad28b0dde84.tar.bz2
fix in kapi translation call, clone fix and kde first sync fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 284ddbf..2ccccfa 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -951,25 +951,28 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
}
if ( eventLSync->dtStart() == mLastCalendarSync )
fullDateRange = true;
if ( ! fullDateRange ) {
if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
// qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
//qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
fullDateRange = true;
}
}
- if ( fullDateRange && !mSyncKDE )
+ if ( mSyncKDE ) {
+ fullDateRange = ( eventLSync->dtStart() == mLastCalendarSync );
+ }
+ if ( fullDateRange )
mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
else
mLastCalendarSync = eventLSync->dtStart();
// for resyncing if own file has changed
if ( mCurrentSyncDevice == "deleteaftersync" ) {
mLastCalendarSync = loadedFileVersion;
//qDebug("setting mLastCalendarSync ");
}
//qDebug("*************************** ");
qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
QPtrList<Incidence> er = remote->rawIncidences();
Incidence* inR = er.first();
@@ -1040,31 +1043,34 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
QString des = eventLSync->description();
QString pref = "e";
if ( inR->type() == "Todo" )
pref = "t";
if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
//remote->deleteIncidence( inR );
++deletedEventR;
} else {
inR->setLastModified( modifiedCalendar );
inL = inR->clone();
+ inL->setIDStr( ":" );
local->addIncidence( inL );
++addedEvent;
}
} else {
if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
inR->setLastModified( modifiedCalendar );
- local->addIncidence( inR->clone() );
+ inL = inR->clone();
+ inL->setIDStr( ":" );
+ local->addIncidence( inL );
++addedEvent;
} else {
checkExternSyncEvent(eventRSyncSharp, inR);
remote->deleteIncidence( inR );
++deletedEventR;
}
}
}
}
inR = er.next();
}
QPtrList<Incidence> el = local->rawIncidences();
@@ -1095,38 +1101,41 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
checkExternSyncEvent(eventLSyncSharp, inL);
local->deleteIncidence( inL );
++deletedEventL;
} else {
if ( ! mSyncManager->mWriteBackExistingOnly ) {
inL->removeID(mCurrentSyncDevice );
++addedEventR;
//qDebug("remote added Incidence %s ", inL->summary().latin1());
inL->setLastModified( modifiedCalendar );
inR = inL->clone();
+ inR->setIDStr( ":" );
inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
remote->addIncidence( inR );
}
}
} else {
if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
checkExternSyncEvent(eventLSyncSharp, inL);
local->deleteIncidence( inL );
++deletedEventL;
} else {
if ( ! mSyncManager->mWriteBackExistingOnly ) {
++addedEventR;
inL->setLastModified( modifiedCalendar );
- remote->addIncidence( inL->clone() );
+ inR = inL->clone();
+ inR->setIDStr( ":" );
+ remote->addIncidence( inR );
}
}
}
}
}
inL = el.next();
}
int delFut = 0;
int remRem = 0;
if ( mSyncManager->mWriteBackInFuture ) {
er = remote->rawIncidences();
remRem = er.count();