summaryrefslogtreecommitdiffabout
path: root/libkdepim
Side-by-side diff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp27
-rw-r--r--libkdepim/ksyncprefsdialog.cpp16
-rw-r--r--libkdepim/ksyncprofile.cpp2
3 files changed, 29 insertions, 16 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 719d80b..61a9899 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -325,3 +325,3 @@ void KSyncManager::slotSyncMenu( int action )
if ( temp->getIsPiSyncSpec() )
- mSpecificResources = QStringList::split( ":", temp->getResSpecKopi() );
+ mSpecificResources = QStringList::split( ":", temp->getResSpecKopi(),true );
mPassWordPiSync = temp->getRemotePw();
@@ -667,3 +667,3 @@ int KSyncManager::ringSync()
} else if ( mTargetApp == KOPI ) {
- mSpecificResources = QStringList::split( ":", temp->getResSpecKopi() );
+ mSpecificResources = QStringList::split( ":", temp->getResSpecKopi(),true );
mPassWordPiSync = temp->getRemotePw();
@@ -1143,2 +1143,8 @@ void KSyncManager::syncPi()
if ( mSpecificResources.count() ) {
+ int lastSyncRes = mSpecificResources.count()/2;
+ int ccc = mSpecificResources.count()-1;
+ while ( lastSyncRes > 0 && ccc > 0 && mSpecificResources[ ccc ].isEmpty() ) {
+ --ccc;
+ --lastSyncRes;
+ }
int startLocal = 0;
@@ -1147,3 +1153,3 @@ void KSyncManager::syncPi()
while ( startLocal < mSpecificResources.count()/2 ) {
- if ( startLocal+1 >= mSpecificResources.count()/2 )
+ if ( startLocal+1 >= lastSyncRes )
emit multiResourceSyncStart( false );
@@ -1152,8 +1158,11 @@ void KSyncManager::syncPi()
mCurrentResourceRemote = mSpecificResources[ startRemote ];
- KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote, mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
- connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
- commandSocket->readFile( syncFileName() );
- while ( !mPisyncFinished ) {
- //qDebug("waiting ");
- qApp->processEvents();
+ if ( !mCurrentResourceRemote.isEmpty() ) {
+ qDebug ( "KSM: Syncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() );
+ KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote, mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
+ connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
+ commandSocket->readFile( syncFileName() );
+ while ( !mPisyncFinished ) {
+ //qDebug("waiting ");
+ qApp->processEvents();
+ }
}
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 27f7932..744a914 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -593,10 +593,12 @@ void KSyncPrefsDialog::profileChanged( int item )
- QStringList res = QStringList::split( ":",prof->getResSpecKopi());
- int i= res.count()/2;
- for ( ;i < res.count(); ++i ) {
- mResTableKopi->setText( i, 0, res[i] );
+ QStringList res = QStringList::split( ":",prof->getResSpecKopi(), true );
+ int add = res.count()/2;
+ int i;
+ for ( i = 0;i < add ; ++i ) {
+ mResTableKopi->setText( i, 0, res[i+add] );
}
- res = QStringList::split( ":",prof->getResSpecKapi());
- for ( i = 0;i < res.count(); ++i ) {
- mResTableKapi->setText( i, 0, res[i] );
+ res = QStringList::split( ":",prof->getResSpecKapi(), true);
+ add = res.count()/2;
+ for ( i = 0;i < add; ++i ) {
+ mResTableKapi->setText( i, 0, res[i+add] );
}
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index d6620c8..b0d3efc 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -144,2 +144,4 @@ void KSyncProfile::setDefault()
mFilterOutAB = "no filter";
+ mResSpecKopi = "";
+ mResSpecKapi = "";
}