summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp3
-rw-r--r--korganizer/calendarview.cpp15
-rw-r--r--libkcal/incidence.cpp2
3 files changed, 14 insertions, 6 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 547d208..771bec9 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -64,31 +64,30 @@ int main( int argc, char **argv )
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
else
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
#else
QString fileName ;
fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
QApplication::addLibraryPath ( qApp->applicationDirPath () );
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
// init language
- KABPrefs::instance();
+ KPimGlobalPrefs::instance()->setGlobalConfig();
KAddressBookMain m ;
//US MainWindow m;
QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
- KPimGlobalPrefs::instance()->setGlobalConfig();
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
#endif
a.exec();
dumpMissing();
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();
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 55ac6d4..5a9ef0e 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -172,25 +172,25 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
i1.priority() == i2.priority() &&
stringCompare( i1.location(), i2.location() );
}
void Incidence::recreate()
{
setCreated(QDateTime::currentDateTime());
setUid(CalFormat::createUniqueId());
setRevision(0);
-
+ setIDStr( ":" );
setLastModified(QDateTime::currentDateTime());
}
void Incidence::setReadOnly( bool readOnly )
{
IncidenceBase::setReadOnly( readOnly );
recurrence()->setRecurReadOnly( readOnly);
}
void Incidence::setCreated(QDateTime created)
{
if (mReadOnly) return;