summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp3
-rw-r--r--libkdepim/ksyncmanager.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 2a57724..c33581c 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -178,65 +178,66 @@ void CalendarLocal::setSyncEventsEnabled()
178 Event * ev; 178 Event * ev;
179 ev = mEventList.first(); 179 ev = mEventList.first();
180 while ( ev ) { 180 while ( ev ) {
181 if ( ev->uid().left(15) == QString("last-syncEvent-") ) 181 if ( ev->uid().left(15) == QString("last-syncEvent-") )
182 ev->setCalEnabled( true ); 182 ev->setCalEnabled( true );
183 ev = mEventList.next(); 183 ev = mEventList.next();
184 } 184 }
185} 185}
186void CalendarLocal::setSyncEventsReadOnly() 186void CalendarLocal::setSyncEventsReadOnly()
187{ 187{
188 Event * ev; 188 Event * ev;
189 ev = mEventList.first(); 189 ev = mEventList.first();
190 while ( ev ) { 190 while ( ev ) {
191 if ( ev->uid().left(15) == QString("last-syncEvent-") ) { 191 if ( ev->uid().left(15) == QString("last-syncEvent-") ) {
192 ev->setReadOnly( true ); 192 ev->setReadOnly( true );
193 } 193 }
194 ev = mEventList.next(); 194 ev = mEventList.next();
195 } 195 }
196} 196}
197 197
198void CalendarLocal::addCalendar( Calendar* cal ) 198void CalendarLocal::addCalendar( Calendar* cal )
199{ 199{
200 cal->setDontDeleteIncidencesOnClose(); 200 cal->setDontDeleteIncidencesOnClose();
201 setSyncEventsEnabled(); 201 setSyncEventsEnabled();
202 { 202 {
203 QPtrList<Event> EventList = cal->rawEvents(); 203 QPtrList<Event> EventList = cal->rawEvents();
204 QPtrList<Event> el; 204 QPtrList<Event> el;
205 Event * ev = EventList.first(); 205 Event * ev = EventList.first();
206 while ( ev ) { 206 while ( ev ) {
207 if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) { 207 if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
208 Event * se = event( ev->uid() ); 208 Event * se = event( ev->uid() );
209 if ( se ) 209 if ( se )
210 el.append( se ); 210 el.append( se );
211 ev->setCalID( 1 );
211 } 212 }
212 ev->unRegisterObserver( cal ); 213 ev->unRegisterObserver( cal );
213 ev->registerObserver( this ); 214 ev->registerObserver( this );
214 mEventList.append( ev ); 215 mEventList.append( ev );
215 ev = EventList.next(); 216 ev = EventList.next();
216 } 217 }
217 for ( ev = el.first(); ev; ev = el.next() ) { 218 for ( ev = el.first(); ev; ev = el.next() ) {
218 deleteIncidence ( ev ); 219 deleteIncidence ( ev );
219 } 220 }
220 } 221 }
221 { 222 {
222 223
223 QPtrList<Todo> TodoList = cal->rawTodos(); 224 QPtrList<Todo> TodoList = cal->rawTodos();
224 Todo * ev = TodoList.first(); 225 Todo * ev = TodoList.first();
225 while ( ev ) { 226 while ( ev ) {
226 QString rel = ev->relatedToUid(); 227 QString rel = ev->relatedToUid();
227 if ( !rel.isEmpty() ){ 228 if ( !rel.isEmpty() ){
228 ev->setRelatedTo ( 0 ); 229 ev->setRelatedTo ( 0 );
229 ev->setRelatedToUid( rel ); 230 ev->setRelatedToUid( rel );
230 } 231 }
231 ev = TodoList.next(); 232 ev = TodoList.next();
232 } 233 }
233 //TodoList = cal->rawTodos(); 234 //TodoList = cal->rawTodos();
234 ev = TodoList.first(); 235 ev = TodoList.first();
235 while ( ev ) { 236 while ( ev ) {
236 ev->unRegisterObserver( cal ); 237 ev->unRegisterObserver( cal );
237 ev->registerObserver( this ); 238 ev->registerObserver( this );
238 mTodoList.append( ev ); 239 mTodoList.append( ev );
239 setupRelations( ev ); 240 setupRelations( ev );
240 ev = TodoList.next(); 241 ev = TodoList.next();
241 } 242 }
242 } 243 }
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index d2cb71b..e1b15d2 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1744,35 +1744,35 @@ void KCommandSocket::readFileFromSocket()
1744 // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1744 // connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1745 if ( mSocket->state() == QSocket::Idle ) 1745 if ( mSocket->state() == QSocket::Idle )
1746 deleteSocket(); 1746 deleteSocket();
1747} 1747}
1748 1748
1749void KCommandSocket::deleteSocket() 1749void KCommandSocket::deleteSocket()
1750{ 1750{
1751 //qDebug("KCommandSocket::deleteSocket() "); 1751 //qDebug("KCommandSocket::deleteSocket() ");
1752 mConnectProgress.hide(); 1752 mConnectProgress.hide();
1753 1753
1754 if ( mConnectCount >= 0 ) { 1754 if ( mConnectCount >= 0 ) {
1755 mTimerSocket->stop(); 1755 mTimerSocket->stop();
1756 mRetVal = errorTO; 1756 mRetVal = errorTO;
1757 qDebug("KCS::Connection to remote host timed out"); 1757 qDebug("KCS::Connection to remote host timed out");
1758 if ( mSocket ) { 1758 if ( mSocket ) {
1759 mSocket->close(); 1759 mSocket->close();
1760 //if ( mSocket->state() == QSocket::Idle ) 1760 //if ( mSocket->state() == QSocket::Idle )
1761 // deleteSocket(); 1761 // deleteSocket();
1762 delete mSocket; 1762 delete mSocket;
1763 mSocket = 0; 1763 mSocket = 0;
1764 } 1764 }
1765 if ( mConnectCount == 0 ) 1765 if ( mConnectCount == 0 )
1766 KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?")); 1766 KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?"));
1767 else if ( tlw ) 1767 else if ( tlw )
1768 tlw->setCaption( i18n("Connection to remote host cancelled!") ); 1768 tlw->setCaption( i18n("Connection to remote host cancelled!") );
1769 emit commandFinished( this, mRetVal ); 1769 emit commandFinished( this, mRetVal );
1770 return; 1770 return;
1771 } 1771 }
1772 //qDebug("KCommandSocket::deleteSocket() %d", mRetVal ); 1772 //qDebug("KCommandSocket::deleteSocket() %d", mRetVal );
1773 if ( mSocket) 1773 if ( mSocket)
1774 delete mSocket; 1774 delete mSocket;
1775 mSocket = 0; 1775 mSocket = 0;
1776 qDebug("commandFinished "); 1776 //qDebug("commandFinished ");
1777 emit commandFinished( this, mRetVal ); 1777 emit commandFinished( this, mRetVal );
1778} 1778}