-rw-r--r-- | korganizer/koprefs.cpp | 8 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 13 |
2 files changed, 18 insertions, 3 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 31ef338..9147af3 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -537,4 +537,12 @@ int KOPrefs::getFuzzyCalendarID( const QString & name ) kkf = mCalendars.next(); } + QString name2 = name; + name2.replace (QRegExp ("_")," " ); + kkf = mCalendars.first(); + while ( kkf ) { + if ( name2.lower() == kkf->mName.lower()) + return kkf->mCalNumber; + kkf = mCalendars.next(); + } return 0; } diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 61a9899..795cd30 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -1141,4 +1141,5 @@ void KSyncManager::syncPi() mCurrentResourceLocal = ""; mCurrentResourceRemote = ""; + qDebug ( "KSM: sync pi %d",mSpecificResources.count() ); if ( mSpecificResources.count() ) { int lastSyncRes = mSpecificResources.count()/2; @@ -1147,4 +1148,5 @@ void KSyncManager::syncPi() --ccc; --lastSyncRes; + qDebug ( "KSM: sync pi %d",ccc ); } int startLocal = 0; @@ -1156,5 +1158,6 @@ void KSyncManager::syncPi() mPisyncFinished = false; mCurrentResourceLocal = mSpecificResources[ startLocal ]; - mCurrentResourceRemote = mSpecificResources[ startRemote ]; + mCurrentResourceRemote = mSpecificResources[ startRemote ]; + qDebug ( "KSM: AAASyncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() ); if ( !mCurrentResourceRemote.isEmpty() ) { qDebug ( "KSM: Syncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() ); @@ -1167,6 +1170,8 @@ void KSyncManager::syncPi() } } + ++startRemote; ++startLocal; } + mPisyncFinished = true; } else { KCommandSocket* commandSocket = new KCommandSocket( "", mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); @@ -1517,4 +1522,6 @@ KCommandSocket::KCommandSocket ( QString remres, QString password, Q_UINT16 port if ( mRemoteResource.isEmpty() ) mRemoteResource = "ALL"; + else + mRemoteResource.replace (QRegExp (" "),"_" ); mPassWord = password; mSocket = 0; @@ -1543,5 +1550,5 @@ void KCommandSocket::sendFileRequest() QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); - os << "GET " << mPassWord << curDt << mRemoteResource << "\r\n\r\n"; + os << "GET " << mPassWord << curDt << " " << mRemoteResource << "\r\n\r\n"; } @@ -1618,5 +1625,5 @@ void KCommandSocket::writeFileToSocket() QTextStream os2( mSocket ); os2.setEncoding( QTextStream::Latin1 ); - os2 << "PUT " << mPassWord << mRemoteResource << "\r\n\r\n";; + os2 << "PUT " << mPassWord << " " << mRemoteResource << "\r\n\r\n";; int byteCount = 0; int byteMax = file2.size()/53; |