summaryrefslogtreecommitdiffabout
Unidiff
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 )
64 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 64 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
65 else 65 else
66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
67#else 67#else
68 QString fileName ; 68 QString fileName ;
69 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 69 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
70 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 70 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
71 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 71 QApplication::addLibraryPath ( qApp->applicationDirPath () );
72 72
73#endif 73#endif
74 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 74 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
75 // init language 75 // init language
76 KABPrefs::instance(); 76 KPimGlobalPrefs::instance()->setGlobalConfig();
77 KAddressBookMain m ; 77 KAddressBookMain m ;
78//US MainWindow m; 78//US MainWindow m;
79 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 79 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
80 80
81 81
82 KPimGlobalPrefs::instance()->setGlobalConfig();
83 82
84#ifndef DESKTOP_VERSION 83#ifndef DESKTOP_VERSION
85 a.showMainWidget( &m ); 84 a.showMainWidget( &m );
86 85
87#else 86#else
88 a.setMainWidget( &m ); 87 a.setMainWidget( &m );
89 m.resize (640, 480 ); 88 m.resize (640, 480 );
90 m.show(); 89 m.show();
91#endif 90#endif
92 a.exec(); 91 a.exec();
93 92
94 dumpMissing(); 93 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
951 } 951 }
952 if ( eventLSync->dtStart() == mLastCalendarSync ) 952 if ( eventLSync->dtStart() == mLastCalendarSync )
953 fullDateRange = true; 953 fullDateRange = true;
954 954
955 if ( ! fullDateRange ) { 955 if ( ! fullDateRange ) {
956 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 956 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
957 957
958 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 958 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
959 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 959 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
960 fullDateRange = true; 960 fullDateRange = true;
961 } 961 }
962 } 962 }
963 if ( fullDateRange && !mSyncKDE ) 963 if ( mSyncKDE ) {
964 fullDateRange = ( eventLSync->dtStart() == mLastCalendarSync );
965 }
966 if ( fullDateRange )
964 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 967 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
965 else 968 else
966 mLastCalendarSync = eventLSync->dtStart(); 969 mLastCalendarSync = eventLSync->dtStart();
967 // for resyncing if own file has changed 970 // for resyncing if own file has changed
968 if ( mCurrentSyncDevice == "deleteaftersync" ) { 971 if ( mCurrentSyncDevice == "deleteaftersync" ) {
969 mLastCalendarSync = loadedFileVersion; 972 mLastCalendarSync = loadedFileVersion;
970 //qDebug("setting mLastCalendarSync "); 973 //qDebug("setting mLastCalendarSync ");
971 } 974 }
972 //qDebug("*************************** "); 975 //qDebug("*************************** ");
973 qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 976 qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
974 QPtrList<Incidence> er = remote->rawIncidences(); 977 QPtrList<Incidence> er = remote->rawIncidences();
975 Incidence* inR = er.first(); 978 Incidence* inR = er.first();
@@ -1040,31 +1043,34 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1040 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1043 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1041 QString des = eventLSync->description(); 1044 QString des = eventLSync->description();
1042 QString pref = "e"; 1045 QString pref = "e";
1043 if ( inR->type() == "Todo" ) 1046 if ( inR->type() == "Todo" )
1044 pref = "t"; 1047 pref = "t";
1045 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1048 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1046 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1049 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1047 //remote->deleteIncidence( inR ); 1050 //remote->deleteIncidence( inR );
1048 ++deletedEventR; 1051 ++deletedEventR;
1049 } else { 1052 } else {
1050 inR->setLastModified( modifiedCalendar ); 1053 inR->setLastModified( modifiedCalendar );
1051 inL = inR->clone(); 1054 inL = inR->clone();
1055 inL->setIDStr( ":" );
1052 local->addIncidence( inL ); 1056 local->addIncidence( inL );
1053 ++addedEvent; 1057 ++addedEvent;
1054 } 1058 }
1055 } else { 1059 } else {
1056 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1060 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1057 inR->setLastModified( modifiedCalendar ); 1061 inR->setLastModified( modifiedCalendar );
1058 local->addIncidence( inR->clone() ); 1062 inL = inR->clone();
1063 inL->setIDStr( ":" );
1064 local->addIncidence( inL );
1059 ++addedEvent; 1065 ++addedEvent;
1060 } else { 1066 } else {
1061 checkExternSyncEvent(eventRSyncSharp, inR); 1067 checkExternSyncEvent(eventRSyncSharp, inR);
1062 remote->deleteIncidence( inR ); 1068 remote->deleteIncidence( inR );
1063 ++deletedEventR; 1069 ++deletedEventR;
1064 } 1070 }
1065 } 1071 }
1066 } 1072 }
1067 } 1073 }
1068 inR = er.next(); 1074 inR = er.next();
1069 } 1075 }
1070 QPtrList<Incidence> el = local->rawIncidences(); 1076 QPtrList<Incidence> el = local->rawIncidences();
@@ -1095,38 +1101,41 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1095 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1101 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1096 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1102 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1097 checkExternSyncEvent(eventLSyncSharp, inL); 1103 checkExternSyncEvent(eventLSyncSharp, inL);
1098 local->deleteIncidence( inL ); 1104 local->deleteIncidence( inL );
1099 ++deletedEventL; 1105 ++deletedEventL;
1100 } else { 1106 } else {
1101 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1107 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1102 inL->removeID(mCurrentSyncDevice ); 1108 inL->removeID(mCurrentSyncDevice );
1103 ++addedEventR; 1109 ++addedEventR;
1104 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1110 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1105 inL->setLastModified( modifiedCalendar ); 1111 inL->setLastModified( modifiedCalendar );
1106 inR = inL->clone(); 1112 inR = inL->clone();
1113 inR->setIDStr( ":" );
1107 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1114 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1108 remote->addIncidence( inR ); 1115 remote->addIncidence( inR );
1109 } 1116 }
1110 } 1117 }
1111 } else { 1118 } else {
1112 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1119 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1113 checkExternSyncEvent(eventLSyncSharp, inL); 1120 checkExternSyncEvent(eventLSyncSharp, inL);
1114 local->deleteIncidence( inL ); 1121 local->deleteIncidence( inL );
1115 ++deletedEventL; 1122 ++deletedEventL;
1116 } else { 1123 } else {
1117 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1124 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1118 ++addedEventR; 1125 ++addedEventR;
1119 inL->setLastModified( modifiedCalendar ); 1126 inL->setLastModified( modifiedCalendar );
1120 remote->addIncidence( inL->clone() ); 1127 inR = inL->clone();
1128 inR->setIDStr( ":" );
1129 remote->addIncidence( inR );
1121 } 1130 }
1122 } 1131 }
1123 } 1132 }
1124 } 1133 }
1125 } 1134 }
1126 inL = el.next(); 1135 inL = el.next();
1127 } 1136 }
1128 int delFut = 0; 1137 int delFut = 0;
1129 int remRem = 0; 1138 int remRem = 0;
1130 if ( mSyncManager->mWriteBackInFuture ) { 1139 if ( mSyncManager->mWriteBackInFuture ) {
1131 er = remote->rawIncidences(); 1140 er = remote->rawIncidences();
1132 remRem = er.count(); 1141 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 )
172 i1.priority() == i2.priority() && 172 i1.priority() == i2.priority() &&
173 stringCompare( i1.location(), i2.location() ); 173 stringCompare( i1.location(), i2.location() );
174} 174}
175 175
176 176
177void Incidence::recreate() 177void Incidence::recreate()
178{ 178{
179 setCreated(QDateTime::currentDateTime()); 179 setCreated(QDateTime::currentDateTime());
180 180
181 setUid(CalFormat::createUniqueId()); 181 setUid(CalFormat::createUniqueId());
182 182
183 setRevision(0); 183 setRevision(0);
184 184 setIDStr( ":" );
185 setLastModified(QDateTime::currentDateTime()); 185 setLastModified(QDateTime::currentDateTime());
186} 186}
187 187
188void Incidence::setReadOnly( bool readOnly ) 188void Incidence::setReadOnly( bool readOnly )
189{ 189{
190 IncidenceBase::setReadOnly( readOnly ); 190 IncidenceBase::setReadOnly( readOnly );
191 recurrence()->setRecurReadOnly( readOnly); 191 recurrence()->setRecurReadOnly( readOnly);
192} 192}
193 193
194void Incidence::setCreated(QDateTime created) 194void Incidence::setCreated(QDateTime created)
195{ 195{
196 if (mReadOnly) return; 196 if (mReadOnly) return;