summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--libkcal/calendar.h1
-rw-r--r--libkcal/calendarlocal.cpp25
-rw-r--r--libkcal/calendarlocal.h1
-rw-r--r--libkdepim/ksyncmanager.cpp5
5 files changed, 29 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 307027a..e45240a 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1611,97 +1611,97 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1611 //QPtrList<Event> el = local->rawEvents(); 1611 //QPtrList<Event> el = local->rawEvents();
1612 Event* eventR; 1612 Event* eventR;
1613 QString uid; 1613 QString uid;
1614 int take; 1614 int take;
1615 Event* eventRSync; 1615 Event* eventRSync;
1616 Event* eventLSync; 1616 Event* eventLSync;
1617 clearAllViews(); 1617 clearAllViews();
1618 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 1618 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
1619 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 1619 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
1620 bool fullDateRange = false; 1620 bool fullDateRange = false;
1621 local->resetTempSyncStat(); 1621 local->resetTempSyncStat();
1622 mLastCalendarSync = QDateTime::currentDateTime(); 1622 mLastCalendarSync = QDateTime::currentDateTime();
1623 if ( mSyncManager->syncWithDesktop() ) { 1623 if ( mSyncManager->syncWithDesktop() ) {
1624 remote->resetPilotStat(1); 1624 remote->resetPilotStat(1);
1625 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 1625 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
1626 mLastCalendarSync = KSyncManager::mRequestedSyncEvent; 1626 mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
1627 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); 1627 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
1628 } else { 1628 } else {
1629 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); 1629 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
1630 } 1630 }
1631 } 1631 }
1632 QDateTime modifiedCalendar = mLastCalendarSync; 1632 QDateTime modifiedCalendar = mLastCalendarSync;
1633 eventLSync = getLastSyncEvent(); 1633 eventLSync = getLastSyncEvent();
1634 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 1634 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
1635 if ( eventR ) { 1635 if ( eventR ) {
1636 qDebug("last-syncEvent on remote found "); 1636 qDebug("last-syncEvent on remote found ");
1637 eventRSync = (Event*) eventR->clone(); 1637 eventRSync = (Event*) eventR->clone();
1638 remote->deleteEvent(eventR ); 1638 remote->deleteEvent(eventR );
1639 1639
1640 } else { 1640 } else {
1641 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { 1641 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
1642 eventRSync = (Event*)eventLSync->clone(); 1642 eventRSync = (Event*)eventLSync->clone();
1643 } else { 1643 } else {
1644 fullDateRange = true; 1644 fullDateRange = true;
1645 eventRSync = new Event(); 1645 eventRSync = new Event();
1646 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 1646 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
1647 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 1647 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
1648 eventRSync->setDtStart( mLastCalendarSync ); 1648 eventRSync->setDtStart( mLastCalendarSync );
1649 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1649 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1650 eventRSync->setCategories( i18n("SyncEvent") ); 1650 eventRSync->setCategories( i18n("SyncEvent") );
1651 } 1651 }
1652 } 1652 }
1653 if ( eventLSync->dtStart() == mLastCalendarSync ) 1653 if ( eventLSync->dtStart() == mLastCalendarSync )
1654 fullDateRange = true; 1654 fullDateRange = true;
1655 1655
1656 if ( ! fullDateRange ) { 1656 if ( ! fullDateRange ) {
1657 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 1657 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
1658 1658
1659 qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 1659 qDebug("KO: Sync: Set fulldate to true! Local: %s --- Remote: %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
1660 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 1660 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
1661 fullDateRange = true; 1661 fullDateRange = true;
1662 } 1662 }
1663 } 1663 }
1664 if ( mSyncManager->syncWithDesktop() ) { 1664 if ( mSyncManager->syncWithDesktop() ) {
1665 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); 1665 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync );
1666 } 1666 }
1667 if ( fullDateRange ) 1667 if ( fullDateRange )
1668 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 1668 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
1669 else 1669 else
1670 mLastCalendarSync = eventLSync->dtStart(); 1670 mLastCalendarSync = eventLSync->dtStart();
1671 // for resyncing if own file has changed 1671 // for resyncing if own file has changed
1672 if ( mCurrentSyncDevice == "deleteaftersync" ) { 1672 if ( mCurrentSyncDevice == "deleteaftersync" ) {
1673 mLastCalendarSync = loadedFileVersion; 1673 mLastCalendarSync = loadedFileVersion;
1674 //qDebug("setting mLastCalendarSync "); 1674 //qDebug("setting mLastCalendarSync ");
1675 } 1675 }
1676 //qDebug("*************************** "); 1676 //qDebug("*************************** ");
1677 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 1677 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
1678 QPtrList<Incidence> er = remote->rawIncidences(); 1678 QPtrList<Incidence> er = remote->rawIncidences();
1679 Incidence* inR = er.first(); 1679 Incidence* inR = er.first();
1680 Incidence* inL; 1680 Incidence* inL;
1681 QProgressBar bar( er.count(),0 ); 1681 QProgressBar bar( er.count(),0 );
1682 bar.setCaption (i18n("Syncing - close to abort!") ); 1682 bar.setCaption (i18n("Syncing - close to abort!") );
1683 1683
1684 // ************** setting up filter ************* 1684 // ************** setting up filter *************
1685 CalFilter *filterIN = 0; 1685 CalFilter *filterIN = 0;
1686 CalFilter *filterOUT = 0; 1686 CalFilter *filterOUT = 0;
1687 CalFilter *filter = mFilters.first(); 1687 CalFilter *filter = mFilters.first();
1688 while(filter) { 1688 while(filter) {
1689 if ( filter->name() == mSyncManager->mFilterInCal ) 1689 if ( filter->name() == mSyncManager->mFilterInCal )
1690 filterIN = filter; 1690 filterIN = filter;
1691 if ( filter->name() == mSyncManager->mFilterOutCal ) 1691 if ( filter->name() == mSyncManager->mFilterOutCal )
1692 filterOUT = filter; 1692 filterOUT = filter;
1693 filter = mFilters.next(); 1693 filter = mFilters.next();
1694 } 1694 }
1695 int w = 300; 1695 int w = 300;
1696 if ( QApplication::desktop()->width() < 320 ) 1696 if ( QApplication::desktop()->width() < 320 )
1697 w = 220; 1697 w = 220;
1698 int h = bar.sizeHint().height() ; 1698 int h = bar.sizeHint().height() ;
1699 int dw = QApplication::desktop()->width(); 1699 int dw = QApplication::desktop()->width();
1700 int dh = QApplication::desktop()->height(); 1700 int dh = QApplication::desktop()->height();
1701 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1701 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1702 bar.show(); 1702 bar.show();
1703 int modulo = (er.count()/10)+1; 1703 int modulo = (er.count()/10)+1;
1704 int incCounter = 0; 1704 int incCounter = 0;
1705 while ( inR ) { 1705 while ( inR ) {
1706 if ( ! bar.isVisible() ) 1706 if ( ! bar.isVisible() )
1707 return false; 1707 return false;
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 0a94914..66836a1 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -271,96 +271,97 @@ public:
271 Remove all relations to an incidence 271 Remove all relations to an incidence
272 */ 272 */
273 virtual void removeRelations( Incidence * ); 273 virtual void removeRelations( Incidence * );
274 274
275 /** 275 /**
276 Set calendar filter, which filters events for the events() functions. 276 Set calendar filter, which filters events for the events() functions.
277 The Filter object is owned by the caller. 277 The Filter object is owned by the caller.
278 */ 278 */
279 void setFilter( CalFilter * ); 279 void setFilter( CalFilter * );
280 /** 280 /**
281 Return calendar filter. 281 Return calendar filter.
282 */ 282 */
283 CalFilter *filter(); 283 CalFilter *filter();
284 virtual QDateTime nextAlarm( int daysTo ) = 0; 284 virtual QDateTime nextAlarm( int daysTo ) = 0;
285 virtual QString nextSummary( ) const = 0; 285 virtual QString nextSummary( ) const = 0;
286 virtual void reInitAlarmSettings() = 0; 286 virtual void reInitAlarmSettings() = 0;
287 virtual QDateTime nextAlarmEventDateTime() const = 0; 287 virtual QDateTime nextAlarmEventDateTime() const = 0;
288 virtual void checkAlarmForIncidence( Incidence *, bool ) = 0; 288 virtual void checkAlarmForIncidence( Incidence *, bool ) = 0;
289 /** 289 /**
290 Return all alarms, which ocur in the given time interval. 290 Return all alarms, which ocur in the given time interval.
291 */ 291 */
292 virtual Alarm::List alarms( const QDateTime &from, 292 virtual Alarm::List alarms( const QDateTime &from,
293 const QDateTime &to ) = 0; 293 const QDateTime &to ) = 0;
294 294
295 class Observer { 295 class Observer {
296 public: 296 public:
297 virtual void calendarModified( bool, Calendar * ) = 0; 297 virtual void calendarModified( bool, Calendar * ) = 0;
298 }; 298 };
299 299
300 void registerObserver( Observer * ); 300 void registerObserver( Observer * );
301 301
302 void setModified( bool ); 302 void setModified( bool );
303 303
304 /** 304 /**
305 Set product id returned by loadedProductId(). This function is only 305 Set product id returned by loadedProductId(). This function is only
306 useful for the calendar loading code. 306 useful for the calendar loading code.
307 */ 307 */
308 void setLoadedProductId( const QString & ); 308 void setLoadedProductId( const QString & );
309 /** 309 /**
310 Return product id taken from file that has been loaded. Returns 310 Return product id taken from file that has been loaded. Returns
311 QString::null, if no calendar has been loaded. 311 QString::null, if no calendar has been loaded.
312 */ 312 */
313 QString loadedProductId(); 313 QString loadedProductId();
314 int defaultCalendar(); 314 int defaultCalendar();
315 void setDontDeleteIncidencesOnClose (); 315 void setDontDeleteIncidencesOnClose ();
316 public slots: 316 public slots:
317 void setDefaultCalendar( int ); 317 void setDefaultCalendar( int );
318 virtual void setCalendarEnabled( int id, bool enable ) = 0; 318 virtual void setCalendarEnabled( int id, bool enable ) = 0;
319 virtual void setAllCalendarEnabled( bool enable ) = 0;
319 virtual void setAlarmEnabled( int id, bool enable ) = 0; 320 virtual void setAlarmEnabled( int id, bool enable ) = 0;
320 virtual void setReadOnly( int id, bool enable ) = 0; 321 virtual void setReadOnly( int id, bool enable ) = 0;
321 virtual void setDefaultCalendarEnabledOnly() = 0; 322 virtual void setDefaultCalendarEnabledOnly() = 0;
322 virtual void setCalendarRemove( int id ) = 0; 323 virtual void setCalendarRemove( int id ) = 0;
323 virtual void getIncidenceCount( int calId, int& events, int & todos, int & journals) = 0; 324 virtual void getIncidenceCount( int calId, int& events, int & todos, int & journals) = 0;
324 325
325 signals: 326 signals:
326 void calendarChanged(); 327 void calendarChanged();
327 void calendarSaved(); 328 void calendarSaved();
328 void calendarLoaded(); 329 void calendarLoaded();
329 void addAlarm(const QDateTime &qdt, const QString &noti ); 330 void addAlarm(const QDateTime &qdt, const QString &noti );
330 void removeAlarm(const QDateTime &qdt, const QString &noti ); 331 void removeAlarm(const QDateTime &qdt, const QString &noti );
331 332
332 protected: 333 protected:
333 /** 334 /**
334 Get unfiltered events, which occur on the given date. 335 Get unfiltered events, which occur on the given date.
335 */ 336 */
336 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0; 337 virtual QPtrList<Event> rawEventsForDate( const QDateTime &qdt ) = 0;
337 /** 338 /**
338 Get unfiltered events, which occur on the given date. 339 Get unfiltered events, which occur on the given date.
339 */ 340 */
340 virtual QPtrList<Event> rawEventsForDate( const QDate &date, 341 virtual QPtrList<Event> rawEventsForDate( const QDate &date,
341 bool sorted = false ) = 0; 342 bool sorted = false ) = 0;
342 /** 343 /**
343 Get events in a range of dates. If inclusive is set to true, only events 344 Get events in a range of dates. If inclusive is set to true, only events
344 are returned, which are completely included in the range. 345 are returned, which are completely included in the range.
345 */ 346 */
346 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end, 347 virtual QPtrList<Event> rawEvents( const QDate &start, const QDate &end,
347 bool inclusive = false ) = 0; 348 bool inclusive = false ) = 0;
348 349
349 Incidence *mNextAlarmIncidence; 350 Incidence *mNextAlarmIncidence;
350 Incidence *mUndoIncidence; 351 Incidence *mUndoIncidence;
351 int mDefaultCalendar; 352 int mDefaultCalendar;
352 bool mDeleteIncidencesOnClose; 353 bool mDeleteIncidencesOnClose;
353 354
354private: 355private:
355 void init(); 356 void init();
356 357
357 QString mOwner; // who the calendar belongs to 358 QString mOwner; // who the calendar belongs to
358 QString mOwnerEmail; // email address of the owner 359 QString mOwnerEmail; // email address of the owner
359 int mTimeZone; // timezone OFFSET from GMT (MINUTES) 360 int mTimeZone; // timezone OFFSET from GMT (MINUTES)
360 bool mLocalTime; // use local time, not UTC or a time zone 361 bool mLocalTime; // use local time, not UTC or a time zone
361 362
362 363
363 CalFilter *mFilter; 364 CalFilter *mFilter;
364 CalFilter *mDefaultFilter; 365 CalFilter *mDefaultFilter;
365 366
366 367
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 45e3128..2a57724 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -145,113 +145,123 @@ bool CalendarLocal::mergeCalendar( Calendar* remote )
145 while ( inR ) { 145 while ( inR ) {
146 inL = incidenceForUid( inR->uid(),false ); 146 inL = incidenceForUid( inR->uid(),false );
147 if ( inL ) { 147 if ( inL ) {
148 if ( ! inL->isReadOnly () || inL->uid().left(15) == QString("last-syncEvent-") ) { 148 if ( ! inL->isReadOnly () || inL->uid().left(15) == QString("last-syncEvent-") ) {
149 int calID = inL->calID(); 149 int calID = inL->calID();
150 deleteIncidence( inL ); 150 deleteIncidence( inL );
151 inL = inR->clone(); 151 inL = inR->clone();
152 inL->setCalID( calID ); 152 inL->setCalID( calID );
153 addIncidence( inL ); 153 addIncidence( inL );
154 } 154 }
155 } else { 155 } else {
156 inL = inR->clone(); 156 inL = inR->clone();
157 inL->setCalID( 0 );// add to default cal 157 inL->setCalID( 0 );// add to default cal
158 addIncidence( inL ); 158 addIncidence( inL );
159 } 159 }
160 inR = er.next(); 160 inR = er.next();
161 } 161 }
162 return true; 162 return true;
163} 163}
164 164
165 165
166bool CalendarLocal::addCalendarFile( QString name, int id ) 166bool CalendarLocal::addCalendarFile( QString name, int id )
167{ 167{
168 CalendarLocal calendar( timeZoneId() ); 168 CalendarLocal calendar( timeZoneId() );
169 calendar.setDefaultCalendar( id ); 169 calendar.setDefaultCalendar( id );
170 if ( calendar.load( name ) ) { 170 if ( calendar.load( name ) ) {
171 addCalendar( &calendar ); 171 addCalendar( &calendar );
172 return true; 172 return true;
173 } 173 }
174 return false; 174 return false;
175} 175}
176void CalendarLocal::setSyncEventsEnabled() 176void CalendarLocal::setSyncEventsEnabled()
177{ 177{
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 ev->setCalID( 1 );
194 } 193 }
195 ev = mEventList.next(); 194 ev = mEventList.next();
196 } 195 }
197} 196}
197
198void CalendarLocal::addCalendar( Calendar* cal ) 198void CalendarLocal::addCalendar( Calendar* cal )
199{ 199{
200 cal->setDontDeleteIncidencesOnClose(); 200 cal->setDontDeleteIncidencesOnClose();
201 setSyncEventsEnabled();
201 { 202 {
202 QPtrList<Event> EventList = cal->rawEvents(); 203 QPtrList<Event> EventList = cal->rawEvents();
204 QPtrList<Event> el;
203 Event * ev = EventList.first(); 205 Event * ev = EventList.first();
204 while ( ev ) { 206 while ( ev ) {
207 if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
208 Event * se = event( ev->uid() );
209 if ( se )
210 el.append( se );
211 }
205 ev->unRegisterObserver( cal ); 212 ev->unRegisterObserver( cal );
206 ev->registerObserver( this ); 213 ev->registerObserver( this );
207 mEventList.append( ev ); 214 mEventList.append( ev );
208 ev = EventList.next(); 215 ev = EventList.next();
209 } 216 }
217 for ( ev = el.first(); ev; ev = el.next() ) {
218 deleteIncidence ( ev );
219 }
210 } 220 }
211 { 221 {
212 222
213 QPtrList<Todo> TodoList = cal->rawTodos(); 223 QPtrList<Todo> TodoList = cal->rawTodos();
214 Todo * ev = TodoList.first(); 224 Todo * ev = TodoList.first();
215 while ( ev ) { 225 while ( ev ) {
216 QString rel = ev->relatedToUid(); 226 QString rel = ev->relatedToUid();
217 if ( !rel.isEmpty() ){ 227 if ( !rel.isEmpty() ){
218 ev->setRelatedTo ( 0 ); 228 ev->setRelatedTo ( 0 );
219 ev->setRelatedToUid( rel ); 229 ev->setRelatedToUid( rel );
220 } 230 }
221 ev = TodoList.next(); 231 ev = TodoList.next();
222 } 232 }
223 //TodoList = cal->rawTodos(); 233 //TodoList = cal->rawTodos();
224 ev = TodoList.first(); 234 ev = TodoList.first();
225 while ( ev ) { 235 while ( ev ) {
226 ev->unRegisterObserver( cal ); 236 ev->unRegisterObserver( cal );
227 ev->registerObserver( this ); 237 ev->registerObserver( this );
228 mTodoList.append( ev ); 238 mTodoList.append( ev );
229 setupRelations( ev ); 239 setupRelations( ev );
230 ev = TodoList.next(); 240 ev = TodoList.next();
231 } 241 }
232 } 242 }
233 { 243 {
234 QPtrList<Journal> JournalList = cal->journals(); 244 QPtrList<Journal> JournalList = cal->journals();
235 Journal * ev = JournalList.first(); 245 Journal * ev = JournalList.first();
236 while ( ev ) { 246 while ( ev ) {
237 ev->unRegisterObserver( cal ); 247 ev->unRegisterObserver( cal );
238 ev->registerObserver( this ); 248 ev->registerObserver( this );
239 mJournalList.append( ev ); 249 mJournalList.append( ev );
240 ev = JournalList.next(); 250 ev = JournalList.next();
241 } 251 }
242 } 252 }
243 setModified( true ); 253 setModified( true );
244} 254}
245bool CalendarLocal::load( const QString &fileName ) 255bool CalendarLocal::load( const QString &fileName )
246{ 256{
247 FileStorage storage( this, fileName ); 257 FileStorage storage( this, fileName );
248 return storage.load(); 258 return storage.load();
249} 259}
250 260
251bool CalendarLocal::save( const QString &fileName, CalFormat *format ) 261bool CalendarLocal::save( const QString &fileName, CalFormat *format )
252{ 262{
253 FileStorage storage( this, fileName, format ); 263 FileStorage storage( this, fileName, format );
254 return storage.save(); 264 return storage.save();
255} 265}
256 266
257void CalendarLocal::stopAllTodos() 267void CalendarLocal::stopAllTodos()
@@ -958,96 +968,109 @@ Journal *CalendarLocal::journal( const QString &uid )
958 } 968 }
959 } 969 }
960 return retVal; 970 return retVal;
961} 971}
962 972
963QPtrList<Journal> CalendarLocal::journals() 973QPtrList<Journal> CalendarLocal::journals()
964{ 974{
965 QPtrList<Journal> el; 975 QPtrList<Journal> el;
966 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 976 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
967 if ( it->calEnabled() ) el.append( it ); 977 if ( it->calEnabled() ) el.append( it );
968 return el; 978 return el;
969} 979}
970void CalendarLocal::setCalendarRemove( int id ) 980void CalendarLocal::setCalendarRemove( int id )
971{ 981{
972 982
973 { 983 {
974 QPtrList<Event> EventList = mEventList; 984 QPtrList<Event> EventList = mEventList;
975 Event * ev = EventList.first(); 985 Event * ev = EventList.first();
976 while ( ev ) { 986 while ( ev ) {
977 if ( ev->calID() == id ) 987 if ( ev->calID() == id )
978 deleteEvent( ev ); 988 deleteEvent( ev );
979 ev = EventList.next(); 989 ev = EventList.next();
980 } 990 }
981 } 991 }
982 { 992 {
983 993
984 QPtrList<Todo> TodoList = mTodoList; 994 QPtrList<Todo> TodoList = mTodoList;
985 Todo * ev = TodoList.first(); 995 Todo * ev = TodoList.first();
986 while ( ev ) { 996 while ( ev ) {
987 if ( ev->calID() == id ) 997 if ( ev->calID() == id )
988 deleteTodo( ev ); 998 deleteTodo( ev );
989 ev = TodoList.next(); 999 ev = TodoList.next();
990 } 1000 }
991 } 1001 }
992 { 1002 {
993 QPtrList<Journal> JournalList = mJournalList; 1003 QPtrList<Journal> JournalList = mJournalList;
994 Journal * ev = JournalList.first(); 1004 Journal * ev = JournalList.first();
995 while ( ev ) { 1005 while ( ev ) {
996 if ( ev->calID() == id ) 1006 if ( ev->calID() == id )
997 deleteJournal( ev ); 1007 deleteJournal( ev );
998 ev = JournalList.next(); 1008 ev = JournalList.next();
999 } 1009 }
1000 } 1010 }
1001 1011
1002 clearUndo(0); 1012 clearUndo(0);
1003 1013
1004} 1014}
1005 1015
1016void CalendarLocal::setAllCalendarEnabled( bool enable )
1017{
1018 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1019 it->setCalEnabled( enable );
1020
1021 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1022 it->setCalEnabled( enable );
1023
1024 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
1025 it->setCalEnabled( enable );
1026
1027
1028}
1006void CalendarLocal::setCalendarEnabled( int id, bool enable ) 1029void CalendarLocal::setCalendarEnabled( int id, bool enable )
1007{ 1030{
1008 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1031 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1009 if ( it->calID() == id ) it->setCalEnabled( enable ); 1032 if ( it->calID() == id ) it->setCalEnabled( enable );
1010 1033
1011 for ( Event *it = mEventList.first(); it; it = mEventList.next() ) 1034 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1012 if ( it->calID() == id ) it->setCalEnabled( enable ); 1035 if ( it->calID() == id ) it->setCalEnabled( enable );
1013 1036
1014 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 1037 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
1015 if ( it->calID() == id ) it->setCalEnabled( enable ); 1038 if ( it->calID() == id ) it->setCalEnabled( enable );
1016 1039
1017} 1040}
1018 1041
1019void CalendarLocal::setReadOnly( int id, bool enable ) 1042void CalendarLocal::setReadOnly( int id, bool enable )
1020{ 1043{
1021 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1044 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1022 if ( it->calID() == id ) it->setReadOnly( enable ); 1045 if ( it->calID() == id ) it->setReadOnly( enable );
1023 1046
1024 for ( Event *it = mEventList.first(); it; it = mEventList.next() ) 1047 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1025 if ( it->calID() == id ) it->setReadOnly( enable ); 1048 if ( it->calID() == id ) it->setReadOnly( enable );
1026 1049
1027 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 1050 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
1028 if ( it->calID() == id ) it->setReadOnly( enable ); 1051 if ( it->calID() == id ) it->setReadOnly( enable );
1029 1052
1030} 1053}
1031 1054
1032void CalendarLocal::setAlarmEnabled( int id, bool enable ) 1055void CalendarLocal::setAlarmEnabled( int id, bool enable )
1033{ 1056{
1034 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1057 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1035 if ( it->calID() == id ) it->setAlarmEnabled( enable ); 1058 if ( it->calID() == id ) it->setAlarmEnabled( enable );
1036 1059
1037 for ( Event *it = mEventList.first(); it; it = mEventList.next() ) 1060 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1038 if ( it->calID() == id ) it->setAlarmEnabled( enable ); 1061 if ( it->calID() == id ) it->setAlarmEnabled( enable );
1039 1062
1040 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 1063 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
1041 if ( it->calID() == id ) it->setAlarmEnabled( enable ); 1064 if ( it->calID() == id ) it->setAlarmEnabled( enable );
1042 reInitAlarmSettings(); 1065 reInitAlarmSettings();
1043 1066
1044} 1067}
1045void CalendarLocal::setDefaultCalendarEnabledOnly() 1068void CalendarLocal::setDefaultCalendarEnabledOnly()
1046{ 1069{
1047 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1070 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1048 it->setCalEnabled( it->calID() == mDefaultCalendar ); 1071 it->setCalEnabled( it->calID() == mDefaultCalendar );
1049 1072
1050 for ( Event *it = mEventList.first(); it; it = mEventList.next() ) 1073 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1051 it->setCalEnabled( it->calID() == mDefaultCalendar); 1074 it->setCalEnabled( it->calID() == mDefaultCalendar);
1052 1075
1053 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 1076 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index eb7bf34..b70f0c9 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -149,84 +149,85 @@ class CalendarLocal : public Calendar
149 Return all alarms, which ocur in the given time interval. 149 Return all alarms, which ocur in the given time interval.
150 */ 150 */
151 Alarm::List alarms( const QDateTime &from, const QDateTime &to ); 151 Alarm::List alarms( const QDateTime &from, const QDateTime &to );
152 152
153 /** 153 /**
154 Return all alarms, which ocur before given date. 154 Return all alarms, which ocur before given date.
155 */ 155 */
156 Alarm::List alarmsTo( const QDateTime &to ); 156 Alarm::List alarmsTo( const QDateTime &to );
157 157
158 QDateTime nextAlarm( int daysTo ) ; 158 QDateTime nextAlarm( int daysTo ) ;
159 QDateTime nextAlarmEventDateTime() const; 159 QDateTime nextAlarmEventDateTime() const;
160 void checkAlarmForIncidence( Incidence *, bool deleted ) ; 160 void checkAlarmForIncidence( Incidence *, bool deleted ) ;
161 void registerAlarm(); 161 void registerAlarm();
162 void deRegisterAlarm(); 162 void deRegisterAlarm();
163 QString getAlarmNotification(); 163 QString getAlarmNotification();
164 QString nextSummary() const ; 164 QString nextSummary() const ;
165 /** 165 /**
166 This method should be called whenever a Event is modified directly 166 This method should be called whenever a Event is modified directly
167 via it's pointer. It makes sure that the calendar is internally 167 via it's pointer. It makes sure that the calendar is internally
168 consistent. 168 consistent.
169 */ 169 */
170 void update( IncidenceBase *incidence ); 170 void update( IncidenceBase *incidence );
171 171
172 /** 172 /**
173 Builds and then returns a list of all events that match for the 173 Builds and then returns a list of all events that match for the
174 date specified. useful for dayView, etc. etc. 174 date specified. useful for dayView, etc. etc.
175 */ 175 */
176 QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false ); 176 QPtrList<Event> rawEventsForDate( const QDate &date, bool sorted = false );
177 /** 177 /**
178 Get unfiltered events for date \a qdt. 178 Get unfiltered events for date \a qdt.
179 */ 179 */
180 QPtrList<Event> rawEventsForDate( const QDateTime &qdt ); 180 QPtrList<Event> rawEventsForDate( const QDateTime &qdt );
181 /** 181 /**
182 Get unfiltered events in a range of dates. If inclusive is set to true, 182 Get unfiltered events in a range of dates. If inclusive is set to true,
183 only events are returned, which are completely included in the range. 183 only events are returned, which are completely included in the range.
184 */ 184 */
185 QPtrList<Event> rawEvents( const QDate &start, const QDate &end, 185 QPtrList<Event> rawEvents( const QDate &start, const QDate &end,
186 bool inclusive = false ); 186 bool inclusive = false );
187 Todo *todo( QString, QString ); 187 Todo *todo( QString, QString );
188 Event *event( QString, QString ); 188 Event *event( QString, QString );
189 void getIncidenceCount( int calId, int& events, int & todos, int & journals); 189 void getIncidenceCount( int calId, int& events, int & todos, int & journals);
190 190
191public slots: 191public slots:
192 void setCalendarEnabled( int id, bool enable ); 192 void setCalendarEnabled( int id, bool enable );
193 void setAlarmEnabled( int id, bool enable ); 193 void setAlarmEnabled( int id, bool enable );
194 void setReadOnly( int id, bool enable ); 194 void setReadOnly( int id, bool enable );
195 void setDefaultCalendarEnabledOnly(); 195 void setDefaultCalendarEnabledOnly();
196 void setCalendarRemove( int id ); 196 void setCalendarRemove( int id );
197 void setAllCalendarEnabled( bool enable );
197 198
198 protected: 199 protected:
199 200
200 // Event* mNextAlarmEvent; 201 // Event* mNextAlarmEvent;
201 QString mNextSummary; 202 QString mNextSummary;
202 QString mNextAlarmEventDateTimeString; 203 QString mNextAlarmEventDateTimeString;
203 QString mLastAlarmNotificationString; 204 QString mLastAlarmNotificationString;
204 QDateTime mNextAlarmEventDateTime; 205 QDateTime mNextAlarmEventDateTime;
205 QDateTime mNextAlarmDateTime; 206 QDateTime mNextAlarmDateTime;
206 void reInitAlarmSettings(); 207 void reInitAlarmSettings();
207 208
208 /** Notification function of IncidenceBase::Observer. */ 209 /** Notification function of IncidenceBase::Observer. */
209 void incidenceUpdated( IncidenceBase *i ) { update( i ); } 210 void incidenceUpdated( IncidenceBase *i ) { update( i ); }
210 211
211 /** inserts an event into its "proper place" in the calendar. */ 212 /** inserts an event into its "proper place" in the calendar. */
212 void insertEvent( Event *event ); 213 void insertEvent( Event *event );
213 214
214 /** Append alarms of incidence in interval to list of alarms. */ 215 /** Append alarms of incidence in interval to list of alarms. */
215 void appendAlarms( Alarm::List &alarms, Incidence *incidence, 216 void appendAlarms( Alarm::List &alarms, Incidence *incidence,
216 const QDateTime &from, const QDateTime &to ); 217 const QDateTime &from, const QDateTime &to );
217 218
218 /** Append alarms of recurring events in interval to list of alarms. */ 219 /** Append alarms of recurring events in interval to list of alarms. */
219 void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence, 220 void appendRecurringAlarms( Alarm::List &alarms, Incidence *incidence,
220 const QDateTime &from, const QDateTime &to ); 221 const QDateTime &from, const QDateTime &to );
221 222
222 private: 223 private:
223 void init(); 224 void init();
224 225
225 QPtrList<Event> mEventList; 226 QPtrList<Event> mEventList;
226 QPtrList<Todo> mTodoList; 227 QPtrList<Todo> mTodoList;
227 QPtrList<Journal> mJournalList; 228 QPtrList<Journal> mJournalList;
228}; 229};
229 230
230} 231}
231 232
232#endif 233#endif
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 795cd30..d2cb71b 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1095,115 +1095,114 @@ bool KSyncManager::isProgressBarCanceled()
1095 return !bar->isVisible(); 1095 return !bar->isVisible();
1096} 1096}
1097 1097
1098QString KSyncManager::syncFileName() 1098QString KSyncManager::syncFileName()
1099{ 1099{
1100 1100
1101 QString fn = "tempfile"; 1101 QString fn = "tempfile";
1102 switch(mTargetApp) 1102 switch(mTargetApp)
1103 { 1103 {
1104 case (KAPI): 1104 case (KAPI):
1105 fn = "tempsyncab.vcf"; 1105 fn = "tempsyncab.vcf";
1106 break; 1106 break;
1107 case (KOPI): 1107 case (KOPI):
1108 fn = "tempsynccal.ics"; 1108 fn = "tempsynccal.ics";
1109 break; 1109 break;
1110 case (PWMPI): 1110 case (PWMPI):
1111 fn = "tempsyncpw.pwm"; 1111 fn = "tempsyncpw.pwm";
1112 break; 1112 break;
1113 default: 1113 default:
1114 break; 1114 break;
1115 } 1115 }
1116#ifdef DESKTOP_VERSION 1116#ifdef DESKTOP_VERSION
1117 return locateLocal( "tmp", fn ); 1117 return locateLocal( "tmp", fn );
1118#else 1118#else
1119 return (QString( "/tmp/" )+ fn ); 1119 return (QString( "/tmp/" )+ fn );
1120#endif 1120#endif
1121} 1121}
1122 1122
1123void KSyncManager::syncPi() 1123void KSyncManager::syncPi()
1124{ 1124{
1125 mIsKapiFile = true; 1125 mIsKapiFile = true;
1126 mPisyncFinished = false; 1126 mPisyncFinished = false;
1127 qApp->processEvents(); 1127 qApp->processEvents();
1128 if ( mAskForPreferences ) 1128 if ( mAskForPreferences )
1129 if ( !edit_pisync_options()) { 1129 if ( !edit_pisync_options()) {
1130 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); 1130 mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") );
1131 mPisyncFinished = true; 1131 mPisyncFinished = true;
1132 return; 1132 return;
1133 } 1133 }
1134 bool ok; 1134 bool ok;
1135 Q_UINT16 port = mActiveSyncPort.toUInt(&ok); 1135 Q_UINT16 port = mActiveSyncPort.toUInt(&ok);
1136 if ( ! ok ) { 1136 if ( ! ok ) {
1137 mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") ); 1137 mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") );
1138 mPisyncFinished = true; 1138 mPisyncFinished = true;
1139 return; 1139 return;
1140 } 1140 }
1141 mCurrentResourceLocal = ""; 1141 mCurrentResourceLocal = "";
1142 mCurrentResourceRemote = ""; 1142 mCurrentResourceRemote = "";
1143 qDebug ( "KSM: sync pi %d",mSpecificResources.count() );
1144 if ( mSpecificResources.count() ) { 1143 if ( mSpecificResources.count() ) {
1145 int lastSyncRes = mSpecificResources.count()/2; 1144 int lastSyncRes = mSpecificResources.count()/2;
1146 int ccc = mSpecificResources.count()-1; 1145 int ccc = mSpecificResources.count()-1;
1147 while ( lastSyncRes > 0 && ccc > 0 && mSpecificResources[ ccc ].isEmpty() ) { 1146 while ( lastSyncRes > 0 && ccc > 0 && mSpecificResources[ ccc ].isEmpty() ) {
1148 --ccc; 1147 --ccc;
1149 --lastSyncRes; 1148 --lastSyncRes;
1150 qDebug ( "KSM: sync pi %d",ccc ); 1149 //qDebug ( "KSM: sync pi %d",ccc );
1151 } 1150 }
1152 int startLocal = 0; 1151 int startLocal = 0;
1153 int startRemote = mSpecificResources.count()/2; 1152 int startRemote = mSpecificResources.count()/2;
1154 emit multiResourceSyncStart( true ); 1153 emit multiResourceSyncStart( true );
1155 while ( startLocal < mSpecificResources.count()/2 ) { 1154 while ( startLocal < mSpecificResources.count()/2 ) {
1156 if ( startLocal+1 >= lastSyncRes ) 1155 if ( startLocal+1 >= lastSyncRes )
1157 emit multiResourceSyncStart( false ); 1156 emit multiResourceSyncStart( false );
1158 mPisyncFinished = false; 1157 mPisyncFinished = false;
1159 mCurrentResourceLocal = mSpecificResources[ startLocal ]; 1158 mCurrentResourceLocal = mSpecificResources[ startLocal ];
1160 mCurrentResourceRemote = mSpecificResources[ startRemote ]; 1159 mCurrentResourceRemote = mSpecificResources[ startRemote ];
1161 qDebug ( "KSM: AAASyncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() ); 1160 //qDebug ( "KSM: AAASyncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() );
1162 if ( !mCurrentResourceRemote.isEmpty() ) { 1161 if ( !mCurrentResourceRemote.isEmpty() ) {
1163 qDebug ( "KSM: Syncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() ); 1162 qDebug ( "KSM: Syncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() );
1164 KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote, mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); 1163 KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote, mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
1165 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); 1164 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
1166 commandSocket->readFile( syncFileName() ); 1165 commandSocket->readFile( syncFileName() );
1167 while ( !mPisyncFinished ) { 1166 while ( !mPisyncFinished ) {
1168 //qDebug("waiting "); 1167 //qDebug("waiting ");
1169 qApp->processEvents(); 1168 qApp->processEvents();
1170 } 1169 }
1171 } 1170 }
1172 ++startRemote; 1171 ++startRemote;
1173 ++startLocal; 1172 ++startLocal;
1174 } 1173 }
1175 mPisyncFinished = true; 1174 mPisyncFinished = true;
1176 } else { 1175 } else {
1177 KCommandSocket* commandSocket = new KCommandSocket( "", mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); 1176 KCommandSocket* commandSocket = new KCommandSocket( "", mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
1178 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); 1177 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
1179 commandSocket->readFile( syncFileName() ); 1178 commandSocket->readFile( syncFileName() );
1180 } 1179 }
1181} 1180}
1182 1181
1183void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) 1182void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
1184{ 1183{
1185 //enum { success, errorW, errorR, quiet }; 1184 //enum { success, errorW, errorR, quiet };
1186 1185
1187 1186
1188 1187
1189 if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW || 1188 if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW ||
1190 state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) { 1189 state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) {
1191 if ( state == KCommandSocket::errorPW ) 1190 if ( state == KCommandSocket::errorPW )
1192 mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") ); 1191 mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") );
1193 else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) 1192 else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO )
1194 mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") ); 1193 mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") );
1195 else if ( state == KCommandSocket::errorCA ) 1194 else if ( state == KCommandSocket::errorCA )
1196 mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") ); 1195 mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") );
1197 else if ( state == KCommandSocket::errorFI ) 1196 else if ( state == KCommandSocket::errorFI )
1198 mParent->topLevelWidget()->setCaption( i18n("File error on remote.") ); 1197 mParent->topLevelWidget()->setCaption( i18n("File error on remote.") );
1199 else if ( state == KCommandSocket::errorED ) 1198 else if ( state == KCommandSocket::errorED )
1200 mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") ); 1199 mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") );
1201 else if ( state == KCommandSocket::errorUN ) 1200 else if ( state == KCommandSocket::errorUN )
1202 mParent->topLevelWidget()->setCaption( i18n("Unknown error on remote.") ); 1201 mParent->topLevelWidget()->setCaption( i18n("Unknown error on remote.") );
1203 delete s; 1202 delete s;
1204 if ( state == KCommandSocket::errorR ) { 1203 if ( state == KCommandSocket::errorR ) {
1205 KCommandSocket* commandSocket = new KCommandSocket( "",mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget()); 1204 KCommandSocket* commandSocket = new KCommandSocket( "",mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget());
1206 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); 1205 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) );
1207 commandSocket->sendStop(); 1206 commandSocket->sendStop();
1208 } 1207 }
1209 mPisyncFinished = true; 1208 mPisyncFinished = true;