-rw-r--r-- | libkdepim/ksyncmanager.cpp | 71 |
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 | |||
@@ -111,9 +111,9 @@ void KSyncManager::fillSyncMenu() | |||
111 | prof.clear(); | 111 | prof.clear(); |
112 | QString externalName; | 112 | QString externalName; |
113 | #ifdef DESKTOP_VERSION | 113 | #ifdef DESKTOP_VERSION |
114 | #ifdef _WIN32_ | 114 | #ifdef _WIN32_ |
115 | externalName = "OutLook(not_implemented)"; | 115 | externalName = "OutLook"; |
116 | #else | 116 | #else |
117 | externalName = "KDE_Desktop"; | 117 | externalName = "KDE_Desktop"; |
118 | #endif | 118 | #endif |
119 | #else | 119 | #else |
@@ -142,9 +142,9 @@ void KSyncManager::fillSyncMenu() | |||
142 | QString insertText = prof[i]; | 142 | QString insertText = prof[i]; |
143 | if ( i == 0 ) { | 143 | if ( i == 0 ) { |
144 | #ifdef DESKTOP_VERSION | 144 | #ifdef DESKTOP_VERSION |
145 | #ifdef _WIN32_ | 145 | #ifdef _WIN32_ |
146 | insertText = "OutLook(not_implemented)"; | 146 | insertText = "OutLook"; |
147 | #else | 147 | #else |
148 | insertText = "KDE_Desktop"; | 148 | insertText = "KDE_Desktop"; |
149 | #endif | 149 | #endif |
150 | #else | 150 | #else |
@@ -933,10 +933,76 @@ void KSyncManager::confSync() | |||
933 | mImplementation->removeSyncInfo( oldSyncProfileNames[ii] ); | 933 | mImplementation->removeSyncInfo( oldSyncProfileNames[ii] ); |
934 | } | 934 | } |
935 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 935 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
936 | } | 936 | } |
937 | void KSyncManager::syncOL() | ||
938 | { | ||
939 | mSyncWithDesktop = true; | ||
940 | emit save(); | ||
941 | switch(mTargetApp) | ||
942 | { | ||
943 | case (KAPI): | ||
944 | { | ||
945 | syncExternalApplication("ol"); | ||
946 | } | ||
947 | break; | ||
948 | case (KOPI): | ||
949 | { | ||
950 | #ifdef DESKTOP_VERSION | ||
951 | QString command = "kdecaldump33"; | ||
952 | QString commandfile = "kdecaldump33"; | ||
953 | QString commandpath = qApp->applicationDirPath () + "/"; | ||
954 | #else | ||
955 | QString command = "kdecaldump33"; | ||
956 | QString commandfile = "kdecaldump33"; | ||
957 | QString commandpath = QDir::homeDirPath ()+"/"; | ||
958 | #endif | ||
959 | if ( ! QFile::exists ( commandpath+commandfile ) ) | ||
960 | command = commandfile; | ||
961 | else | ||
962 | command = commandpath+commandfile; | ||
963 | |||
964 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; | ||
965 | int result = system ( command.latin1()); | ||
966 | qDebug("Cal dump 33 command call result result: %d ", result); | ||
967 | if ( result != 0 ) { | ||
968 | qDebug("Calling CAL dump version 33 failed. Trying 34... "); | ||
969 | commandfile = "kdecaldump34"; | ||
970 | if ( ! QFile::exists ( commandpath+commandfile ) ) | ||
971 | command = commandfile; | ||
972 | else | ||
973 | command = commandpath+commandfile; | ||
974 | result = system ( command.latin1()); | ||
975 | qDebug("Cal dump 34 command call result result: %d ", result); | ||
976 | if ( result != 0 ) { | ||
977 | 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 )); | ||
978 | return; | ||
979 | } | ||
980 | } | ||
981 | if ( syncWithFile( fileName,true ) ) { | ||
982 | if ( mWriteBackFile ) { | ||
983 | command += " --read"; | ||
984 | system ( command.latin1()); | ||
985 | } | ||
986 | } | ||
987 | |||
988 | } | ||
989 | break; | ||
990 | case (PWMPI): | ||
991 | |||
992 | break; | ||
993 | default: | ||
994 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); | ||
995 | break; | ||
996 | |||
997 | } | ||
998 | } | ||
937 | void KSyncManager::syncKDE() | 999 | void KSyncManager::syncKDE() |
938 | { | 1000 | { |
1001 | #ifdef _WIN32_ | ||
1002 | syncOL(); | ||
1003 | #else | ||
1004 | |||
939 | mSyncWithDesktop = true; | 1005 | mSyncWithDesktop = true; |
940 | emit save(); | 1006 | emit save(); |
941 | switch(mTargetApp) | 1007 | switch(mTargetApp) |
942 | { | 1008 | { |
@@ -1031,8 +1097,9 @@ void KSyncManager::syncKDE() | |||
1031 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); | 1097 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); |
1032 | break; | 1098 | break; |
1033 | 1099 | ||
1034 | } | 1100 | } |
1101 | #endif | ||
1035 | } | 1102 | } |
1036 | 1103 | ||
1037 | void KSyncManager::syncSharp() | 1104 | void KSyncManager::syncSharp() |
1038 | { | 1105 | { |