-rw-r--r-- | kaddressbook/kabcore.cpp | 31 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 7 |
2 files changed, 14 insertions, 24 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index d9eb391..83fede4 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1680,12 +1680,16 @@ void KABCore::initGUI() #endif //KAB_NOSPLITTER */ syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); syncManager->setBlockSave(false); + connect(syncManager , SIGNAL( save() ), this, SLOT( save() ) ); + connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); + syncManager->setDefaultFileName(locateLocal( "apps","kabc/std.vcf") ); + //connect(syncManager , SIGNAL( ), this, SLOT( ) ); #endif //KAB_EMBEDDED initActions(); #ifdef KAB_EMBEDDED addActionsManually(); @@ -2834,13 +2838,12 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) 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 ); - qDebug("KABCore::syncExternal: why do we acces here KABPrefs and not somehow KSyncProfile? "); syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); if ( syncOK ) { if ( syncManager->mWriteBackFile ) { abLocal.saveAB(); abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); } @@ -2850,27 +2853,19 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) if ( syncOK ) mViewManager->refreshView(); return syncOK; } -//called by the syncmanager to indicate that the work has to marked as dirty. -void KABCore::sync_setModified() +void KABCore::getFile( bool success ) { - setModified(); -} - -//called by the syncmanager to ask if the dirty flag is set. -bool KABCore::sync_isModified() -{ - return mModified; -} - - -//called by the syncmanager to indicate that the work has to be saved. -void KABCore::sync_save() -{ - save(); + if ( ! success ) { + setCaption( i18n("Error receiving file. Nothing changed!") ); + return; + } + //mView->watchSavedFile(); + //mView->openCalendar( defaultFileName() ); + // pending: reload received file! + setCaption( i18n("Pi-Sync successful!") ); } - diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index c9c0d38..355e828 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -339,12 +339,13 @@ class KABCore : public QWidget, public KSyncInterface signals: void contactSelected( const QString &name ); void contactSelected( const QPixmap &pixmap ); public slots: + void getFile( bool success ); void setDetailsVisible( bool visible ); void setDetailsToState(); // void slotSyncMenu( int ); private slots: void setJumpButtonBarVisible( bool visible ); void importFromOL(); @@ -458,18 +459,12 @@ class KABCore : public QWidget, public KSyncInterface #endif //KAB_EMBEDDED //this are the overwritten callbackmethods from the syncinterface virtual bool sync(KSyncManager* manager, QString filename, int mode); virtual bool syncExternal(KSyncManager* manager, QString resource); - //called by the syncmanager to indicate that the work has to marked as dirty. - virtual void sync_setModified(); - //called by the syncmanager to ask if the dirty flag is set. - virtual bool sync_isModified(); - //called by the syncmanager to indicate that the work has to be saved. - virtual void sync_save(); // LR ******************************* // sync stuff! QPopupMenu *syncMenu; KSyncManager* syncManager; int mGlobalSyncMode; |