From 6564856660d583425a5f5d51bf77bc52c01da444 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 16 Oct 2004 23:24:31 +0000 Subject: added KDE sync --- (limited to 'libkdepim/ksyncmanager.cpp') diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 5175f94..7ee56e4 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -99,7 +99,15 @@ void KSyncManager::fillSyncMenu() mLocalMachineName = config.readEntry("LocalMachineName","undefined"); if ( prof.count() < 2 ) { prof.clear(); +#ifdef DESKTOP_VERSION +#ifdef _WIN32_ + prof << i18n("OutLook(not_implemented)"); +#else + prof << i18n("KDE_Desktop"); +#endif +#else prof << i18n("Sharp_DTM"); +#endif prof << i18n("Local_file"); prof << i18n("Last_file"); KSyncProfile* temp = new KSyncProfile (); @@ -128,9 +136,11 @@ void KSyncManager::fillSyncMenu() if ( mTargetApp == PWMPI) { mSyncMenu->removeItem( 1000 ); } +#ifndef DESKTOP_VERSION else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { mSyncMenu->removeItem( 1000 ); } +#endif mSyncMenu->removeItem( 1002 ); } @@ -186,7 +196,11 @@ void KSyncManager::slotSyncMenu( int action ) mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); mShowSyncSummary = temp->getShowSummaryAfterSync(); if ( action == 1000 ) { +#ifdef DESKTOP_VERSION + syncKDE(); +#else syncSharp(); +#endif } else if ( action == 1001 ) { syncLocalFile(); @@ -741,6 +755,36 @@ void KSyncManager::confSync() mLocalMachineName = sp->getLocalMachineName (); QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); } +void KSyncManager::syncKDE() +{ + emit save(); + switch(mTargetApp) + { + case (KAPI): + + break; + case (KOPI): + { + QString command ="./kdecaldump"; + system ( command.latin1()); + if ( syncWithFile( "/tmp/kdedumpall.ics",true ) ) { + if ( mWriteBackFile ) { + command += " --read"; + system ( command.latin1()); + } + } + + } + break; + case (PWMPI): + + break; + default: + qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); + break; + + } +} void KSyncManager::syncSharp() { -- cgit v0.9.0.2