author | zautrix <zautrix> | 2005-03-18 17:56:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-18 17:56:55 (UTC) |
commit | d6438efc4c7cff39024b65bfd1d2f810212da544 (patch) (unidiff) | |
tree | badb4c48d83477dd1027af1807cb2b6ed09db52a /libkdepim | |
parent | f9f521c487143641b2cf077d04fe1c475001bce2 (diff) | |
download | kdepimpi-d6438efc4c7cff39024b65bfd1d2f810212da544.zip kdepimpi-d6438efc4c7cff39024b65bfd1d2f810212da544.tar.gz kdepimpi-d6438efc4c7cff39024b65bfd1d2f810212da544.tar.bz2 |
kde sync fixes
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index d59f4a4..7319285 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -877,117 +877,127 @@ QString KSyncManager::getPassword( ) | |||
877 | if ( res ) | 877 | if ( res ) |
878 | retfile = lab.text(); | 878 | retfile = lab.text(); |
879 | dia.hide(); | 879 | dia.hide(); |
880 | qApp->processEvents(); | 880 | qApp->processEvents(); |
881 | return retfile; | 881 | return retfile; |
882 | 882 | ||
883 | } | 883 | } |
884 | 884 | ||
885 | 885 | ||
886 | void KSyncManager::confSync() | 886 | void KSyncManager::confSync() |
887 | { | 887 | { |
888 | static KSyncPrefsDialog* sp = 0; | 888 | static KSyncPrefsDialog* sp = 0; |
889 | if ( ! sp ) { | 889 | if ( ! sp ) { |
890 | sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); | 890 | sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); |
891 | } | 891 | } |
892 | sp->usrReadConfig(); | 892 | sp->usrReadConfig(); |
893 | #ifndef DESKTOP_VERSION | 893 | #ifndef DESKTOP_VERSION |
894 | sp->showMaximized(); | 894 | sp->showMaximized(); |
895 | #else | 895 | #else |
896 | sp->show(); | 896 | sp->show(); |
897 | #endif | 897 | #endif |
898 | sp->exec(); | 898 | sp->exec(); |
899 | QStringList oldSyncProfileNames = mSyncProfileNames; | 899 | QStringList oldSyncProfileNames = mSyncProfileNames; |
900 | mSyncProfileNames = sp->getSyncProfileNames(); | 900 | mSyncProfileNames = sp->getSyncProfileNames(); |
901 | mLocalMachineName = sp->getLocalMachineName (); | 901 | mLocalMachineName = sp->getLocalMachineName (); |
902 | int ii; | 902 | int ii; |
903 | for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) { | 903 | for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) { |
904 | if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) ) | 904 | if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) ) |
905 | mImplementation->removeSyncInfo( oldSyncProfileNames[ii] ); | 905 | mImplementation->removeSyncInfo( oldSyncProfileNames[ii] ); |
906 | } | 906 | } |
907 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 907 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
908 | } | 908 | } |
909 | void KSyncManager::syncKDE() | 909 | void KSyncManager::syncKDE() |
910 | { | 910 | { |
911 | mSyncWithDesktop = true; | 911 | mSyncWithDesktop = true; |
912 | emit save(); | 912 | emit save(); |
913 | switch(mTargetApp) | 913 | switch(mTargetApp) |
914 | { | 914 | { |
915 | case (KAPI): | 915 | case (KAPI): |
916 | { | 916 | { |
917 | #ifdef DESKTOP_VERSION | 917 | #ifdef DESKTOP_VERSION |
918 | QString command = qApp->applicationDirPath () + "/kdeabdump"; | 918 | QString command = qApp->applicationDirPath () + "/kdeabdump"; |
919 | #else | 919 | #else |
920 | QString command = "kdeabdump"; | 920 | QString command = "kdeabdump"; |
921 | #endif | 921 | #endif |
922 | if ( ! QFile::exists ( command ) ) | 922 | if ( ! QFile::exists ( command ) ) |
923 | command = "kdeabdump"; | 923 | command = "kdeabdump"; |
924 | QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf"; | 924 | QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf"; |
925 | system ( command.latin1()); | 925 | int result = system ( command.latin1()); |
926 | qDebug("AB dump command call result: %d ", result); | ||
927 | if ( result != 0 ) { | ||
928 | KMessageBox::error( 0, i18n("Error accessing KDE addressbook data.\nMake sure the file\n/opt/kdepimpi/kdeabdump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); | ||
929 | return; | ||
930 | } | ||
926 | if ( syncWithFile( fileName,true ) ) { | 931 | if ( syncWithFile( fileName,true ) ) { |
927 | if ( mWriteBackFile ) { | 932 | if ( mWriteBackFile ) { |
928 | command += " --read"; | 933 | command += " --read"; |
929 | system ( command.latin1()); | 934 | system ( command.latin1()); |
930 | } | 935 | } |
931 | } | 936 | } |
932 | 937 | ||
933 | } | 938 | } |
934 | break; | 939 | break; |
935 | case (KOPI): | 940 | case (KOPI): |
936 | { | 941 | { |
937 | #ifdef DESKTOP_VERSION | 942 | #ifdef DESKTOP_VERSION |
938 | QString command = qApp->applicationDirPath () + "/kdecaldump"; | 943 | QString command = qApp->applicationDirPath () + "/kdecaldump"; |
939 | #else | 944 | #else |
940 | QString command = "kdecaldump"; | 945 | QString command = "kdecaldump"; |
941 | #endif | 946 | #endif |
942 | if ( ! QFile::exists ( command ) ) | 947 | if ( ! QFile::exists ( command ) ) |
943 | command = "kdecaldump"; | 948 | command = "kdecaldump"; |
944 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; | 949 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; |
945 | system ( command.latin1()); | 950 | int result = system ( command.latin1()); |
951 | qDebug("Cal dump command call result result: %d ", result); | ||
952 | if ( result != 0 ) { | ||
953 | KMessageBox::error( 0, i18n("Error accessing KDE calendar data.\nMake sure the file\n/opt/kdepimpi/kdecaldump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); | ||
954 | return; | ||
955 | } | ||
946 | if ( syncWithFile( fileName,true ) ) { | 956 | if ( syncWithFile( fileName,true ) ) { |
947 | if ( mWriteBackFile ) { | 957 | if ( mWriteBackFile ) { |
948 | command += " --read"; | 958 | command += " --read"; |
949 | system ( command.latin1()); | 959 | system ( command.latin1()); |
950 | } | 960 | } |
951 | } | 961 | } |
952 | 962 | ||
953 | } | 963 | } |
954 | break; | 964 | break; |
955 | case (PWMPI): | 965 | case (PWMPI): |
956 | 966 | ||
957 | break; | 967 | break; |
958 | default: | 968 | default: |
959 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); | 969 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); |
960 | break; | 970 | break; |
961 | 971 | ||
962 | } | 972 | } |
963 | } | 973 | } |
964 | 974 | ||
965 | void KSyncManager::syncSharp() | 975 | void KSyncManager::syncSharp() |
966 | { | 976 | { |
967 | 977 | ||
968 | if ( ! syncExternalApplication("sharp") ) | 978 | if ( ! syncExternalApplication("sharp") ) |
969 | qDebug("KSM::ERROR sync sharp "); | 979 | qDebug("KSM::ERROR sync sharp "); |
970 | } | 980 | } |
971 | 981 | ||
972 | bool KSyncManager::syncExternalApplication(QString resource) | 982 | bool KSyncManager::syncExternalApplication(QString resource) |
973 | { | 983 | { |
974 | 984 | ||
975 | emit save(); | 985 | emit save(); |
976 | 986 | ||
977 | if ( mAskForPreferences ) | 987 | if ( mAskForPreferences ) |
978 | if ( !edit_sync_options()) { | 988 | if ( !edit_sync_options()) { |
979 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 989 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); |
980 | return false; | 990 | return false; |
981 | } | 991 | } |
982 | 992 | ||
983 | qDebug("KSM::Sync extern %s", resource.latin1()); | 993 | qDebug("KSM::Sync extern %s", resource.latin1()); |
984 | 994 | ||
985 | bool syncOK = mImplementation->syncExternal(this, resource); | 995 | bool syncOK = mImplementation->syncExternal(this, resource); |
986 | 996 | ||
987 | return syncOK; | 997 | return syncOK; |
988 | 998 | ||
989 | } | 999 | } |
990 | 1000 | ||
991 | void KSyncManager::syncPhone() | 1001 | void KSyncManager::syncPhone() |
992 | { | 1002 | { |
993 | 1003 | ||