summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 2f00a09..ea87929 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1307,20 +1307,22 @@ void KABCore::setDetailsVisible( bool visible )
1307 else 1307 else
1308 mDetails->hide(); 1308 mDetails->hide();
1309 } 1309 }
1310 else 1310 else
1311 { 1311 {
1312 if ( visible ) { 1312 if ( visible ) {
1313 mViewManager->hide(); 1313 mViewManager->hide();
1314 mDetails->show(); 1314 mDetails->show();
1315 mIncSearchWidget->setFocus();
1315 } 1316 }
1316 else { 1317 else {
1317 mViewManager->show(); 1318 mViewManager->show();
1318 mDetails->hide(); 1319 mDetails->hide();
1320 mViewManager->setFocusAV();
1319 } 1321 }
1320 setJumpButtonBarVisible( !visible ); 1322 setJumpButtonBarVisible( !visible );
1321 } 1323 }
1322 1324
1323} 1325}
1324 1326
1325void KABCore::extensionChanged( int id ) 1327void KABCore::extensionChanged( int id )
1326{ 1328{
@@ -2039,16 +2041,19 @@ void KABCore::addActionsManually()
2039 2041
2040 mActionSave->plug( tb ); 2042 mActionSave->plug( tb );
2041 mViewManager->getFilterAction()->plug ( tb); 2043 mViewManager->getFilterAction()->plug ( tb);
2042 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { 2044 if (KGlobal::getDesktopSize() == KGlobal::Desktop ) {
2043 mActionUndo->plug( tb ); 2045 mActionUndo->plug( tb );
2044 mActionDelete->plug( tb ); 2046 mActionDelete->plug( tb );
2045 mActionRedo->plug( tb ); 2047 mActionRedo->plug( tb );
2046 } 2048 }
2049 } else {
2050 if (KABPrefs::instance()->mMultipleViewsAtOnce )
2051 mActionSave->plug( tb );
2047 } 2052 }
2048 //mActionQuit->plug ( tb ); 2053 //mActionQuit->plug ( tb );
2049 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2054 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2050 2055
2051 //US link the searchwidget first to this. 2056 //US link the searchwidget first to this.
2052 // The real linkage to the toolbar happens later. 2057 // The real linkage to the toolbar happens later.
2053//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2058//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2054//US tb->insertItem( mIncSearchWidget ); 2059//US tb->insertItem( mIncSearchWidget );
@@ -2502,17 +2507,26 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2502 Addressee addresseeL; 2507 Addressee addresseeL;
2503 Addressee addresseeRSync; 2508 Addressee addresseeRSync;
2504 Addressee addresseeLSync; 2509 Addressee addresseeLSync;
2505 // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees(); 2510 // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees();
2506 //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); 2511 //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees();
2507 bool fullDateRange = false; 2512 bool fullDateRange = false;
2508 local->resetTempSyncStat(); 2513 local->resetTempSyncStat();
2509 mLastAddressbookSync = QDateTime::currentDateTime(); 2514 mLastAddressbookSync = QDateTime::currentDateTime();
2510 QDateTime modifiedCalendar = mLastAddressbookSync;; 2515 if ( syncManager->syncWithDesktop() ) {
2516 remote->removeSyncInfo( QString());//remove all info
2517 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
2518 mLastAddressbookSync = KSyncManager::mRequestedSyncEvent;
2519 qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() );
2520 } else {
2521 qDebug("ERROR: KSyncManager::mRequestedSyncEvent has invalid datatime ");
2522 }
2523 }
2524 QDateTime modifiedCalendar = mLastAddressbookSync;
2511 addresseeLSync = getLastSyncAddressee(); 2525 addresseeLSync = getLastSyncAddressee();
2512 qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1()); 2526 qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1());
2513 addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); 2527 addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName );
2514 if ( !addresseeR.isEmpty() ) { 2528 if ( !addresseeR.isEmpty() ) {
2515 addresseeRSync = addresseeR; 2529 addresseeRSync = addresseeR;
2516 remote->removeAddressee(addresseeR ); 2530 remote->removeAddressee(addresseeR );
2517 2531
2518 } else { 2532 } else {
@@ -2600,16 +2614,18 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2600 else 2614 else
2601 idS = inR.IDStr(); 2615 idS = inR.IDStr();
2602 remote->removeAddressee( inR ); 2616 remote->removeAddressee( inR );
2603 inR = inL; 2617 inR = inL;
2604 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 2618 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
2605 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2619 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2606 inR.setOriginalExternalUID( OidS ); 2620 inR.setOriginalExternalUID( OidS );
2607 inR.setExternalUID( idS ); 2621 inR.setExternalUID( idS );
2622 if ( syncManager->syncWithDesktop() )
2623 inR.setIDStr( "changed" );
2608 } else { 2624 } else {
2609 inR.setIDStr( idS ); 2625 inR.setIDStr( idS );
2610 } 2626 }
2611 inR.setResource( 0 ); 2627 inR.setResource( 0 );
2612 remote->insertAddressee( inR , false); 2628 remote->insertAddressee( inR , false);
2613 ++changedRemote; 2629 ++changedRemote;
2614 } else { // take == 2 take remote 2630 } else { // take == 2 take remote
2615 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2631 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
@@ -2893,16 +2909,19 @@ void KABCore::getFile( bool success )
2893 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); 2909 int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
2894 if ( count ) 2910 if ( count )
2895 setModified( true ); 2911 setModified( true );
2896 message( i18n("Pi-Sync successful!") ); 2912 message( i18n("Pi-Sync successful!") );
2897 mViewManager->refreshView(); 2913 mViewManager->refreshView();
2898} 2914}
2899void KABCore::syncFileRequest() 2915void KABCore::syncFileRequest()
2900{ 2916{
2917 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
2918 syncManager->slotSyncMenu( 999 );
2919 }
2901 mAddressBook->export2File( sentSyncFile() ); 2920 mAddressBook->export2File( sentSyncFile() );
2902} 2921}
2903QString KABCore::sentSyncFile() 2922QString KABCore::sentSyncFile()
2904{ 2923{
2905#ifdef DESKTOP_VERSION 2924#ifdef DESKTOP_VERSION
2906 return locateLocal( "tmp", "copysyncab.vcf" ); 2925 return locateLocal( "tmp", "copysyncab.vcf" );
2907#else 2926#else
2908 return QString( "/tmp/copysyncab.vcf" ); 2927 return QString( "/tmp/copysyncab.vcf" );