From edd36b813763c304b104f276437c2c60ee9bd1f1 Mon Sep 17 00:00:00 2001 From: zautrix Date: Thu, 07 Oct 2004 09:56:31 +0000 Subject: sync fixes --- (limited to 'kaddressbook') diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 83fede4..6404410 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1683,9 +1683,9 @@ void KABCore::initGUI() 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( request_file() ), this, SLOT( syncFileRequest() ) ); connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); - syncManager->setDefaultFileName(locateLocal( "apps","kabc/std.vcf") ); + syncManager->setDefaultFileName( sentSyncFile()); //connect(syncManager , SIGNAL( ), this, SLOT( ) ); #endif //KAB_EMBEDDED @@ -2862,10 +2862,20 @@ void KABCore::getFile( bool success ) setCaption( i18n("Error receiving file. Nothing changed!") ); return; } - //mView->watchSavedFile(); - //mView->openCalendar( defaultFileName() ); - // pending: reload received file! + mAddressBook->importFromFile( sentSyncFile() ); setCaption( i18n("Pi-Sync successful!") ); } +void KABCore::syncFileRequest() +{ + mAddressBook->export2File( sentSyncFile() ); +} +QString KABCore::sentSyncFile() +{ +#ifdef _WIN32_ + return locateLocal( "tmp", "syncab.ics" ); +#else + return QString( "/tmp/kapitempfile.vcf" ); +#endif +} diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 355e828..987369d 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -343,6 +343,7 @@ class KABCore : public QWidget, public KSyncInterface void contactSelected( const QPixmap &pixmap ); public slots: void getFile( bool success ); + void syncFileRequest(); void setDetailsVisible( bool visible ); void setDetailsToState(); // void slotSyncMenu( int ); @@ -465,6 +466,7 @@ class KABCore : public QWidget, public KSyncInterface // LR ******************************* // sync stuff! + QString sentSyncFile(); QPopupMenu *syncMenu; KSyncManager* syncManager; int mGlobalSyncMode; diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp index acf6419..3079d42 100644 --- a/kaddressbook/xxport/vcard_xxport.cpp +++ b/kaddressbook/xxport/vcard_xxport.cpp @@ -121,6 +121,7 @@ bool VCardXXPort::exportContacts( const KABC::AddresseeList &list, const QString else version = KABC::VCardConverter::v3_0; + version = KABC::VCardConverter::v2_1; converter.addresseeToVCard( *it, vcard, version ); t << vcard << "\r\n\r\n"; } -- cgit v0.9.0.2