summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
authorzautrix <zautrix>2005-12-02 09:42:53 (UTC)
committer zautrix <zautrix>2005-12-02 09:42:53 (UTC)
commita75d2c26aba6cffae8c3f61e173940240042427b (patch) (unidiff)
tree68f4b61c150bc263a98c78fdf8671bbbc17cdaf8 /kaddressbook/kabcore.cpp
parent64be8d64fc26d1025a24150d065197ba5d608f3d (diff)
downloadkdepimpi-a75d2c26aba6cffae8c3f61e173940240042427b.zip
kdepimpi-a75d2c26aba6cffae8c3f61e173940240042427b.tar.gz
kdepimpi-a75d2c26aba6cffae8c3f61e173940240042427b.tar.bz2
more sync
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 5d377bf..7d8586a 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1916,49 +1916,49 @@ void KABCore::initGUI()
1916#else //KAB_NOSPLITTER 1916#else //KAB_NOSPLITTER
1917 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1917 QHBoxLayout *topLayout = new QHBoxLayout( this );
1918//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1918//US topLayout->setSpacing( KDialogBase::spacingHint() );
1919 topLayout->setSpacing( 10 ); 1919 topLayout->setSpacing( 10 );
1920 1920
1921// mDetailsSplitter = new QSplitter( this ); 1921// mDetailsSplitter = new QSplitter( this );
1922 1922
1923 QVBox *viewSpace = new QVBox( this ); 1923 QVBox *viewSpace = new QVBox( this );
1924 1924
1925 mViewManager = new ViewManager( this, viewSpace ); 1925 mViewManager = new ViewManager( this, viewSpace );
1926 viewSpace->setStretchFactor( mViewManager, 1 ); 1926 viewSpace->setStretchFactor( mViewManager, 1 );
1927 1927
1928 mDetails = new ViewContainer( this ); 1928 mDetails = new ViewContainer( this );
1929 1929
1930 topLayout->addWidget( viewSpace ); 1930 topLayout->addWidget( viewSpace );
1931// topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1931// topLayout->setStretchFactor( mDetailsSplitter, 100 );
1932 topLayout->addWidget( mDetails ); 1932 topLayout->addWidget( mDetails );
1933#endif //KAB_NOSPLITTER 1933#endif //KAB_NOSPLITTER
1934*/ 1934*/
1935 1935
1936 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 1936 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
1937 syncManager->setBlockSave(false); 1937 syncManager->setBlockSave(false);
1938 1938
1939 connect(syncManager , SIGNAL( request_file(const QString &) ), this, SLOT( syncFileRequest(const QString &) ) ); 1939 connect(syncManager , SIGNAL( request_file(const QString &) ), this, SLOT( syncFileRequest(const QString &) ) );
1940 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 1940 connect(syncManager , SIGNAL( getFile( bool ,const QString &)), this, SLOT(getFile( bool ,const QString &) ) );
1941 QString sync_file = sentSyncFile(); 1941 QString sync_file = sentSyncFile();
1942 //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1()); 1942 //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1());
1943 syncManager->setDefaultFileName( sync_file ); 1943 syncManager->setDefaultFileName( sync_file );
1944 //connect(syncManager , SIGNAL( ), this, SLOT( ) ); 1944 //connect(syncManager , SIGNAL( ), this, SLOT( ) );
1945 1945
1946#endif //KAB_EMBEDDED 1946#endif //KAB_EMBEDDED
1947 initActions(); 1947 initActions();
1948 1948
1949#ifdef KAB_EMBEDDED 1949#ifdef KAB_EMBEDDED
1950 addActionsManually(); 1950 addActionsManually();
1951 //US make sure the export and import menues are initialized before creating the xxPortManager. 1951 //US make sure the export and import menues are initialized before creating the xxPortManager.
1952 mXXPortManager = new XXPortManager( this, this ); 1952 mXXPortManager = new XXPortManager( this, this );
1953 1953
1954 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); 1954 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
1955 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); 1955 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
1956 // mActionQuit->plug ( mMainWindow->toolBar()); 1956 // mActionQuit->plug ( mMainWindow->toolBar());
1957 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); 1957 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
1958 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); 1958 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
1959 // mIncSearchWidget->hide(); 1959 // mIncSearchWidget->hide();
1960 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1960 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1961 SLOT( incrementalSearch( const QString& ) ) ); 1961 SLOT( incrementalSearch( const QString& ) ) );
1962 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); 1962 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) );
1963 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); 1963 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) );
1964 1964
@@ -3439,55 +3439,55 @@ bool KABCore::syncPhone()
3439 { 3439 {
3440 abLocal.importFromFile( fileName ); 3440 abLocal.importFromFile( fileName );
3441 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3441 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
3442 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3442 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3443 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 3443 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
3444 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3444 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3445 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3445 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3446 syncManager->hideProgressBar(); 3446 syncManager->hideProgressBar();
3447 if ( syncOK ) { 3447 if ( syncOK ) {
3448 if ( syncManager->mWriteBackFile ) { 3448 if ( syncManager->mWriteBackFile ) {
3449 abLocal.removeSyncAddressees( true ); 3449 abLocal.removeSyncAddressees( true );
3450 abLocal.saveABphone( fileName ); 3450 abLocal.saveABphone( fileName );
3451 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 3451 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
3452 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 3452 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
3453 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3453 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3454 } 3454 }
3455 } 3455 }
3456 setModified(); 3456 setModified();
3457 } 3457 }
3458 abLocal.removeResources(); 3458 abLocal.removeResources();
3459 if ( syncOK ) 3459 if ( syncOK )
3460 mViewManager->refreshView(); 3460 mViewManager->refreshView();
3461 return syncOK; 3461 return syncOK;
3462} 3462}
3463void KABCore::getFile( bool success ) 3463void KABCore::getFile( bool success ,const QString & resource)
3464{ 3464{
3465 if ( ! success ) { 3465 if ( ! success ) {
3466 message( i18n("Error receiving file. Nothing changed!") ); 3466 message( i18n("Error receiving file. Nothing changed!") );
3467 return; 3467 return;
3468 } 3468 }
3469 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); 3469 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ,resource);
3470 if ( count ) 3470 if ( count )
3471 setModified( true ); 3471 setModified( true );
3472 message( i18n("Pi-Sync successful!") ); 3472 message( i18n("Pi-Sync successful!") );
3473 mViewManager->refreshView(); 3473 mViewManager->refreshView();
3474} 3474}
3475void KABCore::syncFileRequest(const QString & resource) 3475void KABCore::syncFileRequest(const QString & resource)
3476{ 3476{
3477 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { 3477 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
3478 syncManager->slotSyncMenu( 999 ); 3478 syncManager->slotSyncMenu( 999 );
3479 } 3479 }
3480 3480
3481 if ( resource == "ALL" ) { 3481 if ( resource == "ALL" ) {
3482 mAddressBook->export2File( sentSyncFile() ); 3482 mAddressBook->export2File( sentSyncFile() );
3483 } 3483 }
3484 else 3484 else
3485 mAddressBook->export2File( sentSyncFile(), resource); 3485 mAddressBook->export2File( sentSyncFile(), resource);
3486} 3486}
3487QString KABCore::sentSyncFile() 3487QString KABCore::sentSyncFile()
3488{ 3488{
3489#ifdef DESKTOP_VERSION 3489#ifdef DESKTOP_VERSION
3490 return locateLocal( "tmp", "copysyncab.vcf" ); 3490 return locateLocal( "tmp", "copysyncab.vcf" );
3491#else 3491#else
3492 return QString( "/tmp/copysyncab.vcf" ); 3492 return QString( "/tmp/copysyncab.vcf" );
3493#endif 3493#endif