summaryrefslogtreecommitdiffabout
Side-by-side diff
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
@@ -162,97 +162,98 @@ bool CalendarLocal::mergeCalendar( Calendar* remote )
return true;
}
bool CalendarLocal::addCalendarFile( QString name, int id )
{
CalendarLocal calendar( timeZoneId() );
calendar.setDefaultCalendar( id );
if ( calendar.load( name ) ) {
addCalendar( &calendar );
return true;
}
return false;
}
void CalendarLocal::setSyncEventsEnabled()
{
Event * ev;
ev = mEventList.first();
while ( ev ) {
if ( ev->uid().left(15) == QString("last-syncEvent-") )
ev->setCalEnabled( true );
ev = mEventList.next();
}
}
void CalendarLocal::setSyncEventsReadOnly()
{
Event * ev;
ev = mEventList.first();
while ( ev ) {
if ( ev->uid().left(15) == QString("last-syncEvent-") ) {
ev->setReadOnly( true );
}
ev = mEventList.next();
}
}
void CalendarLocal::addCalendar( Calendar* cal )
{
cal->setDontDeleteIncidencesOnClose();
setSyncEventsEnabled();
{
QPtrList<Event> EventList = cal->rawEvents();
QPtrList<Event> el;
Event * ev = EventList.first();
while ( ev ) {
if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
Event * se = event( ev->uid() );
if ( se )
- el.append( se );
+ el.append( se );
+ ev->setCalID( 1 );
}
ev->unRegisterObserver( cal );
ev->registerObserver( this );
mEventList.append( ev );
ev = EventList.next();
}
for ( ev = el.first(); ev; ev = el.next() ) {
deleteIncidence ( ev );
}
}
{
QPtrList<Todo> TodoList = cal->rawTodos();
Todo * ev = TodoList.first();
while ( ev ) {
QString rel = ev->relatedToUid();
if ( !rel.isEmpty() ){
ev->setRelatedTo ( 0 );
ev->setRelatedToUid( rel );
}
ev = TodoList.next();
}
//TodoList = cal->rawTodos();
ev = TodoList.first();
while ( ev ) {
ev->unRegisterObserver( cal );
ev->registerObserver( this );
mTodoList.append( ev );
setupRelations( ev );
ev = TodoList.next();
}
}
{
QPtrList<Journal> JournalList = cal->journals();
Journal * ev = JournalList.first();
while ( ev ) {
ev->unRegisterObserver( cal );
ev->registerObserver( this );
mJournalList.append( ev );
ev = JournalList.next();
}
}
setModified( true );
}
bool CalendarLocal::load( const QString &fileName )
{
FileStorage storage( this, fileName );
return storage.load();
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index d2cb71b..e1b15d2 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1728,51 +1728,51 @@ void KCommandSocket::readFileFromSocket()
mFileString = "";
mRetVal = errorR;
qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() );
deleteSocket();
return ;
}
// mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1));
QTextStream ts ( &file );
ts.setEncoding( QTextStream::Latin1 );
ts << mFileString;
file.close();
mFileString = "";
mRetVal = successR;
mSocket->close();
// if state is not idle, deleteSocket(); is called via
// connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
if ( mSocket->state() == QSocket::Idle )
deleteSocket();
}
void KCommandSocket::deleteSocket()
{
//qDebug("KCommandSocket::deleteSocket() ");
mConnectProgress.hide();
if ( mConnectCount >= 0 ) {
mTimerSocket->stop();
mRetVal = errorTO;
qDebug("KCS::Connection to remote host timed out");
if ( mSocket ) {
mSocket->close();
//if ( mSocket->state() == QSocket::Idle )
// deleteSocket();
delete mSocket;
mSocket = 0;
}
if ( mConnectCount == 0 )
KMessageBox::error( 0, i18n("Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?"));
else if ( tlw )
tlw->setCaption( i18n("Connection to remote host cancelled!") );
emit commandFinished( this, mRetVal );
return;
}
//qDebug("KCommandSocket::deleteSocket() %d", mRetVal );
if ( mSocket)
delete mSocket;
mSocket = 0;
- qDebug("commandFinished ");
+ //qDebug("commandFinished ");
emit commandFinished( this, mRetVal );
}