summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-10-07 07:28:54 (UTC)
committer zautrix <zautrix>2004-10-07 07:28:54 (UTC)
commit77280f6a176a15b60004f312e6cacdfbbd3909c1 (patch) (side-by-side diff)
treee074d4abedc2f4cc575e5655575e038b9d460106 /kaddressbook
parentf1eb5b74c962909851607c4b4cb05ee18a347d37 (diff)
downloadkdepimpi-77280f6a176a15b60004f312e6cacdfbbd3909c1.zip
kdepimpi-77280f6a176a15b60004f312e6cacdfbbd3909c1.tar.gz
kdepimpi-77280f6a176a15b60004f312e6cacdfbbd3909c1.tar.bz2
sync changes
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp29
-rw-r--r--kaddressbook/kabcore.h7
2 files changed, 13 insertions, 23 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;
+ if ( ! success ) {
+ setCaption( i18n("Error receiving file. Nothing changed!") );
+ return;
}
-
-
-//called by the syncmanager to indicate that the work has to be saved.
-void KABCore::sync_save()
-{
- save();
+ //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;