summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp8
-rw-r--r--libkdepim/ksyncmanager.cpp4
2 files changed, 9 insertions, 3 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 15cab73..b7edccd 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1785,25 +1785,27 @@ void KABCore::initGUI()
topLayout->addWidget( viewSpace );
// topLayout->setStretchFactor( mDetailsSplitter, 100 );
topLayout->addWidget( mDetails );
#endif //KAB_NOSPLITTER
*/
syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
syncManager->setBlockSave(false);
connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
- syncManager->setDefaultFileName( sentSyncFile());
+ QString sync_file = sentSyncFile();
+ qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1());
+ syncManager->setDefaultFileName( sync_file );
//connect(syncManager , SIGNAL( ), this, SLOT( ) );
#endif //KAB_EMBEDDED
initActions();
#ifdef KAB_EMBEDDED
addActionsManually();
//US make sure the export and import menues are initialized before creating the xxPortManager.
mXXPortManager = new XXPortManager( this, this );
// LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
//mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
@@ -2997,24 +2999,26 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
}
return syncOK;
}
//this is a overwritten callbackmethods from the syncinterface
bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
{
//pending prepare addresseeview for output
//pending detect, if remote file has REV field. if not switch to external sync
mGlobalSyncMode = SYNC_MODE_NORMAL;
+ if ( manager != syncManager )
+ qDebug("KABCore::sync:: ERROR! :: manager != syncManager ");
QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
AddressBook abLocal(filename,"syncContact");
bool syncOK = false;
if ( abLocal.load() ) {
qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode );
bool external = false;
bool isXML = false;
if ( filename.right(4) == ".xml") {
mGlobalSyncMode = SYNC_MODE_EXTERNAL;
isXML = true;
abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
@@ -3064,24 +3068,26 @@ void KABCore::removeSyncInfo( QString syncProfile)
qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1());
mAddressBook->removeSyncInfo( syncProfile );
setModified();
}
//this is a overwritten callbackmethods from the syncinterface
bool KABCore::syncExternal(KSyncManager* manager, QString resource)
{
if ( resource == "phone" )
return syncPhone();
disableBR( true );
+ if ( manager != syncManager )
+ qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager ");
QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
AddressBook abLocal( resource,"syncContact");
bool syncOK = false;
if ( abLocal.load() ) {
qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
mGlobalSyncMode = SYNC_MODE_EXTERNAL;
abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
if ( syncOK ) {
if ( syncManager->mWriteBackFile ) {
abLocal.removeSyncAddressees( false );
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index c12ba1c..7c53948 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -391,25 +391,25 @@ void KSyncManager::enableQuick( bool ask )
autoStart = mPrefs->mPassiveSyncAutoStart;
if ( autoStart != mPrefs->mPassiveSyncAutoStart )
changed = true;
bool ok;
mPrefs->mPassiveSyncAutoStart = false;
Q_UINT16 port = mPrefs->mPassiveSyncPort.toUInt(&ok);
if ( ! ok ) {
KMessageBox::information( 0, i18n("No valid port"));
return;
}
//qDebug("port %d ", port);
mServerSocket = new KServerSocket ( mPrefs->mPassiveSyncPw, port ,1 );
- mServerSocket->setFileName( defaultFileName() );
+ mServerSocket->setFileName( defaultFileName() );//bbb
//qDebug("connected ");
if ( !mServerSocket->ok() ) {
KMessageBox::information( 0, i18n("Failed to bind or\nlisten to the port!"));
delete mServerSocket;
mServerSocket = 0;
return;
}
mPrefs->mPassiveSyncAutoStart = autoStart;
if ( changed ) {
mPrefs->writeConfig();
}
connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) );
@@ -1228,25 +1228,25 @@ void KServerSocket::send_file()
}
} else
mSyncActionDialog->setFixedSize( 230, 120);
mSyncActionDialog->show();
mSyncActionDialog->raise();
emit request_file();
qApp->processEvents();
QString fileName = mFileName;
QFile file( fileName );
if (!file.open( IO_ReadOnly ) ) {
delete mSyncActionDialog;
mSyncActionDialog = 0;
- qDebug("KSS::error open file ");
+ qDebug("KSS::error open sync file: %s ", fileName.latin1());
mSocket->close();
if ( mSocket->state() == QSocket::Idle )
QTimer::singleShot( 10, this , SLOT ( discardClient()));
return ;
}
mSyncActionDialog->setCaption( i18n("Sending file...") );
QTextStream ts( &file );
ts.setEncoding( QTextStream::Latin1 );
QTextStream os( mSocket );
os.setEncoding( QTextStream::Latin1 );