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
@@ -1674,27 +1674,27 @@ void KABCore::initGUI()
mDetails = new ViewContainer( this );
topLayout->addWidget( viewSpace );
// topLayout->setStretchFactor( mDetailsSplitter, 100 );
topLayout->addWidget( mDetails );
#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( 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
initActions();
#ifdef KAB_EMBEDDED
addActionsManually();
//US make sure the export and import menues are initialized before creating the xxPortManager.
mXXPortManager = new XXPortManager( this, this );
// LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
//mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
@@ -2853,19 +2853,29 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
if ( syncOK )
mViewManager->refreshView();
return syncOK;
}
void KABCore::getFile( bool success )
{
if ( ! 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
+}