-rw-r--r-- | libkdepim/ksyncmanager.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 5175f94..7ee56e4 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -94,17 +94,25 @@ void KSyncManager::fillSyncMenu() mSyncMenu->insertSeparator(); KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); config.setGroup("General"); QStringList prof = config.readListEntry("SyncProfileNames"); 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 (); temp->setName( prof[0] ); temp->writeConfig(&config); temp->setName( prof[1] ); temp->writeConfig(&config); temp->setName( prof[2] ); @@ -123,19 +131,21 @@ void KSyncManager::fillSyncMenu() if ( i == 2 ) mSyncMenu->insertSeparator(); } QDir app_dir; //US do not display SharpDTM if app is pwmpi, or no sharpfiles available 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 ); } void KSyncManager::slotSyncMenu( int action ) { //qDebug("syncaction %d ", action); if ( action == 0 ) { @@ -181,17 +191,21 @@ void KSyncManager::slotSyncMenu( int action ) mWriteBackFile = temp->getWriteBackFile(); mWriteBackExistingOnly = temp->getWriteBackExisting(); mIsKapiFile = temp->getIsKapiFile(); mWriteBackInFuture = 0; if ( temp->getWriteBackFuture() ) mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); mShowSyncSummary = temp->getShowSummaryAfterSync(); if ( action == 1000 ) { +#ifdef DESKTOP_VERSION + syncKDE(); +#else syncSharp(); +#endif } else if ( action == 1001 ) { syncLocalFile(); } else if ( action == 1002 ) { mWriteBackFile = false; mAskForPreferences = false; mShowSyncSummary = false; @@ -736,16 +750,46 @@ void KSyncManager::confSync() #else sp->show(); #endif sp->exec(); mSyncProfileNames = sp->getSyncProfileNames(); 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() { if ( ! syncExternalApplication("sharp") ) qDebug("ERROR sync sharp "); } |