summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/ksyncmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp71
1 files changed, 69 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index b7929ec..5708dfc 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -109,13 +109,13 @@ void KSyncManager::fillSyncMenu()
mLocalMachineName = config.readEntry("LocalMachineName","undefined");
if ( prof.count() < 2 ) {
prof.clear();
QString externalName;
#ifdef DESKTOP_VERSION
#ifdef _WIN32_
- externalName = "OutLook(not_implemented)";
+ externalName = "OutLook";
#else
externalName = "KDE_Desktop";
#endif
#else
externalName = "Sharp_DTM";
#endif
@@ -140,13 +140,13 @@ void KSyncManager::fillSyncMenu()
unsigned int i;
for ( i = 0; i < prof.count(); ++i ) {
QString insertText = prof[i];
if ( i == 0 ) {
#ifdef DESKTOP_VERSION
#ifdef _WIN32_
- insertText = "OutLook(not_implemented)";
+ insertText = "OutLook";
#else
insertText = "KDE_Desktop";
#endif
#else
insertText = "Sharp_DTM";
#endif
@@ -931,14 +931,80 @@ void KSyncManager::confSync()
for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) {
if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) )
mImplementation->removeSyncInfo( oldSyncProfileNames[ii] );
}
QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
}
+void KSyncManager::syncOL()
+{
+ mSyncWithDesktop = true;
+ emit save();
+ switch(mTargetApp)
+ {
+ case (KAPI):
+ {
+ syncExternalApplication("ol");
+ }
+ break;
+ case (KOPI):
+ {
+#ifdef DESKTOP_VERSION
+ QString command = "kdecaldump33";
+ QString commandfile = "kdecaldump33";
+ QString commandpath = qApp->applicationDirPath () + "/";
+#else
+ QString command = "kdecaldump33";
+ QString commandfile = "kdecaldump33";
+ QString commandpath = QDir::homeDirPath ()+"/";
+#endif
+ if ( ! QFile::exists ( commandpath+commandfile ) )
+ command = commandfile;
+ else
+ command = commandpath+commandfile;
+
+ QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics";
+ int result = system ( command.latin1());
+ qDebug("Cal dump 33 command call result result: %d ", result);
+ if ( result != 0 ) {
+ qDebug("Calling CAL dump version 33 failed. Trying 34... ");
+ commandfile = "kdecaldump34";
+ if ( ! QFile::exists ( commandpath+commandfile ) )
+ command = commandfile;
+ else
+ command = commandpath+commandfile;
+ result = system ( command.latin1());
+ qDebug("Cal dump 34 command call result result: %d ", result);
+ if ( result != 0 ) {
+ KMessageBox::error( 0, i18n("Error accessing KDE calendar data.\nMake sure the file\n%1kdecaldump3x\nexists ( x = 3 or 4 ).\nSupported KDE versions are 3.3 and 3.4.\nUsed version should be auto detected.\n").arg( commandpath ));
+ return;
+ }
+ }
+ if ( syncWithFile( fileName,true ) ) {
+ if ( mWriteBackFile ) {
+ command += " --read";
+ system ( command.latin1());
+ }
+ }
+
+ }
+ break;
+ case (PWMPI):
+
+ break;
+ default:
+ qDebug("KSM::slotSyncMenu: invalid apptype selected");
+ break;
+
+ }
+}
void KSyncManager::syncKDE()
{
+#ifdef _WIN32_
+ syncOL();
+#else
+
mSyncWithDesktop = true;
emit save();
switch(mTargetApp)
{
case (KAPI):
{
@@ -1029,12 +1095,13 @@ void KSyncManager::syncKDE()
break;
default:
qDebug("KSM::slotSyncMenu: invalid apptype selected");
break;
}
+#endif
}
void KSyncManager::syncSharp()
{
if ( ! syncExternalApplication("sharp") )