summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 2f00a09..ea87929 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1303,28 +1303,30 @@ void KABCore::setDetailsVisible( bool visible )
if (mMultipleViewsAtOnce)
{
if ( visible )
mDetails->show();
else
mDetails->hide();
}
else
{
if ( visible ) {
mViewManager->hide();
mDetails->show();
+ mIncSearchWidget->setFocus();
}
else {
mViewManager->show();
mDetails->hide();
+ mViewManager->setFocusAV();
}
setJumpButtonBarVisible( !visible );
}
}
void KABCore::extensionChanged( int id )
{
//change the details view only for non desktop systems
#ifndef DESKTOP_VERSION
if (id == 0)
@@ -2035,24 +2037,27 @@ void KABCore::addActionsManually()
mActionFaq->plug( helpMenu );
mActionAboutKAddressbook->plug( helpMenu );
if (KGlobal::getDesktopSize() > KGlobal::Small ) {
mActionSave->plug( tb );
mViewManager->getFilterAction()->plug ( tb);
if (KGlobal::getDesktopSize() == KGlobal::Desktop ) {
mActionUndo->plug( tb );
mActionDelete->plug( tb );
mActionRedo->plug( tb );
}
+ } else {
+ if (KABPrefs::instance()->mMultipleViewsAtOnce )
+ mActionSave->plug( tb );
}
//mActionQuit->plug ( tb );
// tb->insertWidget(-1, 0, mIncSearchWidget, 6);
//US link the searchwidget first to this.
// The real linkage to the toolbar happens later.
//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
//US tb->insertItem( mIncSearchWidget );
/*US
mIncSearchWidget = new IncSearchWidget( tb );
connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
SLOT( incrementalSearch( const QString& ) ) );
@@ -2498,25 +2503,34 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
//QPtrList<Addressee> el = local->rawAddressees();
Addressee addresseeR;
QString uid;
int take;
Addressee addresseeL;
Addressee addresseeRSync;
Addressee addresseeLSync;
// KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees();
//KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees();
bool fullDateRange = false;
local->resetTempSyncStat();
mLastAddressbookSync = QDateTime::currentDateTime();
- QDateTime modifiedCalendar = mLastAddressbookSync;;
+ if ( syncManager->syncWithDesktop() ) {
+ remote->removeSyncInfo( QString());//remove all info
+ if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
+ mLastAddressbookSync = KSyncManager::mRequestedSyncEvent;
+ qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() );
+ } else {
+ qDebug("ERROR: KSyncManager::mRequestedSyncEvent has invalid datatime ");
+ }
+ }
+ QDateTime modifiedCalendar = mLastAddressbookSync;
addresseeLSync = getLastSyncAddressee();
qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1());
addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName );
if ( !addresseeR.isEmpty() ) {
addresseeRSync = addresseeR;
remote->removeAddressee(addresseeR );
} else {
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
addresseeRSync = addresseeLSync ;
} else {
qDebug("FULLDATE 1");
@@ -2596,24 +2610,26 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
local->insertAddressee( inL, false );
idS = inR.externalUID();
OidS = inR.originalExternalUID();
}
else
idS = inR.IDStr();
remote->removeAddressee( inR );
inR = inL;
inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
inR.setOriginalExternalUID( OidS );
inR.setExternalUID( idS );
+ if ( syncManager->syncWithDesktop() )
+ inR.setIDStr( "changed" );
} else {
inR.setIDStr( idS );
}
inR.setResource( 0 );
remote->insertAddressee( inR , false);
++changedRemote;
} else { // take == 2 take remote
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
if ( inR.revision().date().year() < 2004 )
inR.setRevision( modifiedCalendar );
}
idS = inL.IDStr();
@@ -2888,25 +2904,28 @@ void KABCore::getFile( bool success )
{
if ( ! success ) {
message( i18n("Error receiving file. Nothing changed!") );
return;
}
int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
if ( count )
setModified( true );
message( i18n("Pi-Sync successful!") );
mViewManager->refreshView();
}
void KABCore::syncFileRequest()
-{
+{
+ if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
+ syncManager->slotSyncMenu( 999 );
+ }
mAddressBook->export2File( sentSyncFile() );
}
QString KABCore::sentSyncFile()
{
#ifdef DESKTOP_VERSION
return locateLocal( "tmp", "copysyncab.vcf" );
#else
return QString( "/tmp/copysyncab.vcf" );
#endif
}
void KABCore::setCaptionBack()