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.cpp20
1 files changed, 15 insertions, 5 deletions
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
+}