summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp2
-rw-r--r--libkdepim/ksyncmanager.cpp71
-rw-r--r--libkdepim/ksyncmanager.h3
-rw-r--r--libkdepim/libkdepim.pro15
4 files changed, 87 insertions, 4 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 59be506..f376e6c 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -838,24 +838,26 @@ bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& e
838 int i = 0; 838 int i = 0;
839 while ( i < list.count ( ) ) { 839 while ( i < list.count ( ) ) {
840 //qDebug("add%sdd ",list[i].latin1() ); 840 //qDebug("add%sdd ",list[i].latin1() );
841 proc->addArgument( list[i] ); 841 proc->addArgument( list[i] );
842 //KMessageBox::sorry( 0,list[i]); 842 //KMessageBox::sorry( 0,list[i]);
843 ++i; 843 ++i;
844 } 844 }
845 } else { 845 } else {
846 proc->addArgument(message ); 846 proc->addArgument(message );
847 847
848 } 848 }
849 parameters = translateMessage(parameters, name, emailadress); 849 parameters = translateMessage(parameters, name, emailadress);
850
851 //KMessageBox::information(0,parameters);
850 proc->addArgument( parameters ); 852 proc->addArgument( parameters );
851 proc->launch(""); 853 proc->launch("");
852#endif 854#endif
853 855
854 return true; 856 return true;
855} 857}
856 858
857/************************************************************************** 859/**************************************************************************
858 * 860 *
859 **************************************************************************/ 861 **************************************************************************/
860 862
861//calls the emailapplication and creates a mail with parameter as recipients 863//calls the emailapplication and creates a mail with parameter as recipients
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index b7929ec..5708dfc 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -103,25 +103,25 @@ void KSyncManager::fillSyncMenu()
103 mSyncMenu->insertSeparator(); 103 mSyncMenu->insertSeparator();
104 mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); 104 mSyncMenu->insertItem( i18n("Multiple sync"), 1 );
105 mSyncMenu->insertSeparator(); 105 mSyncMenu->insertSeparator();
106 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 106 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
107 config.setGroup("General"); 107 config.setGroup("General");
108 QStringList prof = config.readListEntry("SyncProfileNames"); 108 QStringList prof = config.readListEntry("SyncProfileNames");
109 mLocalMachineName = config.readEntry("LocalMachineName","undefined"); 109 mLocalMachineName = config.readEntry("LocalMachineName","undefined");
110 if ( prof.count() < 2 ) { 110 if ( prof.count() < 2 ) {
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
120 externalName = "Sharp_DTM"; 120 externalName = "Sharp_DTM";
121#endif 121#endif
122 prof << externalName; 122 prof << externalName;
123 prof << i18n("Local_file"); 123 prof << i18n("Local_file");
124 prof << i18n("Last_file"); 124 prof << i18n("Last_file");
125 KSyncProfile* temp = new KSyncProfile (); 125 KSyncProfile* temp = new KSyncProfile ();
126 temp->setName( prof[0] ); 126 temp->setName( prof[0] );
127 temp->writeConfig(&config); 127 temp->writeConfig(&config);
@@ -134,25 +134,25 @@ void KSyncManager::fillSyncMenu()
134 config.writeEntry("ExternSyncProfiles",externalName); 134 config.writeEntry("ExternSyncProfiles",externalName);
135 config.sync(); 135 config.sync();
136 delete temp; 136 delete temp;
137 } 137 }
138 mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); 138 mExternSyncProfiles = config.readListEntry("ExternSyncProfiles");
139 mSyncProfileNames = prof; 139 mSyncProfileNames = prof;
140 unsigned int i; 140 unsigned int i;
141 for ( i = 0; i < prof.count(); ++i ) { 141 for ( i = 0; i < prof.count(); ++i ) {
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
151 insertText = "Sharp_DTM"; 151 insertText = "Sharp_DTM";
152#endif 152#endif
153 } 153 }
154 mSyncMenu->insertItem( insertText, 1000+i ); 154 mSyncMenu->insertItem( insertText, 1000+i );
155 clearMenu->insertItem( insertText, 1000+i ); 155 clearMenu->insertItem( insertText, 1000+i );
156 if ( i == 2 ) 156 if ( i == 2 )
157 mSyncMenu->insertSeparator(); 157 mSyncMenu->insertSeparator();
158 } 158 }
@@ -925,26 +925,92 @@ void KSyncManager::confSync()
925#endif 925#endif
926 sp->exec(); 926 sp->exec();
927 QStringList oldSyncProfileNames = mSyncProfileNames; 927 QStringList oldSyncProfileNames = mSyncProfileNames;
928 mSyncProfileNames = sp->getSyncProfileNames(); 928 mSyncProfileNames = sp->getSyncProfileNames();
929 mLocalMachineName = sp->getLocalMachineName (); 929 mLocalMachineName = sp->getLocalMachineName ();
930 uint ii; 930 uint ii;
931 for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) { 931 for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) {
932 if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) ) 932 if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) )
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}
937void 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}
937void KSyncManager::syncKDE() 999void 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 {
943 case (KAPI): 1009 case (KAPI):
944 { 1010 {
945#ifdef DESKTOP_VERSION 1011#ifdef DESKTOP_VERSION
946 QString command = "kdeabdump33"; 1012 QString command = "kdeabdump33";
947 QString commandfile = "kdeabdump33"; 1013 QString commandfile = "kdeabdump33";
948 QString commandpath = qApp->applicationDirPath () + "/"; 1014 QString commandpath = qApp->applicationDirPath () + "/";
949#else 1015#else
950 QString command = "kdeabdump33"; 1016 QString command = "kdeabdump33";
@@ -1023,24 +1089,25 @@ void KSyncManager::syncKDE()
1023 } 1089 }
1024 1090
1025 } 1091 }
1026 break; 1092 break;
1027 case (PWMPI): 1093 case (PWMPI):
1028 1094
1029 break; 1095 break;
1030 default: 1096 default:
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
1037void KSyncManager::syncSharp() 1104void KSyncManager::syncSharp()
1038{ 1105{
1039 1106
1040 if ( ! syncExternalApplication("sharp") ) 1107 if ( ! syncExternalApplication("sharp") )
1041 qDebug("KSM::ERROR sync sharp "); 1108 qDebug("KSM::ERROR sync sharp ");
1042} 1109}
1043 1110
1044bool KSyncManager::syncExternalApplication(QString resource) 1111bool KSyncManager::syncExternalApplication(QString resource)
1045{ 1112{
1046 1113
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 04cdade..71d17e9 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -194,24 +194,25 @@ class KSyncManager : public QObject
194 void syncPi(); 194 void syncPi();
195 KServerSocket * mServerSocket; 195 KServerSocket * mServerSocket;
196 KPimPrefs* mPrefs; 196 KPimPrefs* mPrefs;
197 QString mDefFileName; 197 QString mDefFileName;
198 QString mCurrentSyncDevice; 198 QString mCurrentSyncDevice;
199 QString mCurrentSyncName; 199 QString mCurrentSyncName;
200 void quickSyncLocalFile(); 200 void quickSyncLocalFile();
201 bool syncWithFile( QString fn , bool quick ); 201 bool syncWithFile( QString fn , bool quick );
202 void syncLocalFile(); 202 void syncLocalFile();
203 void syncPhone(); 203 void syncPhone();
204 void syncSharp(); 204 void syncSharp();
205 void syncKDE(); 205 void syncKDE();
206 void syncOL();
206 bool syncExternalApplication(QString); 207 bool syncExternalApplication(QString);
207 int mCurrentSyncProfile ; 208 int mCurrentSyncProfile ;
208 void syncRemote( KSyncProfile* prof, bool ask = true); 209 void syncRemote( KSyncProfile* prof, bool ask = true);
209 bool edit_sync_options(); 210 bool edit_sync_options();
210 bool edit_pisync_options(); 211 bool edit_pisync_options();
211 int ringSync(); 212 int ringSync();
212 QString getPassword( ); 213 QString getPassword( );
213 bool mPisyncFinished; 214 bool mPisyncFinished;
214 QStringList mSpecificResources; 215 QStringList mSpecificResources;
215 QString mCurrentResourceLocal; 216 QString mCurrentResourceLocal;
216 QString mCurrentResourceRemote; 217 QString mCurrentResourceRemote;
217 bool mBlockSaveFlag; 218 bool mBlockSaveFlag;
@@ -232,18 +233,16 @@ private slots:
232 233
233class KSyncInterface 234class KSyncInterface
234{ 235{
235 public : 236 public :
236 virtual void removeSyncInfo( QString syncProfile) = 0; 237 virtual void removeSyncInfo( QString syncProfile) = 0;
237 virtual bool sync(KSyncManager* manager, QString filename, int mode, QString resource) = 0; 238 virtual bool sync(KSyncManager* manager, QString filename, int mode, QString resource) = 0;
238 virtual bool syncExternal(KSyncManager* /*manager*/, QString /*resource*/) 239 virtual bool syncExternal(KSyncManager* /*manager*/, QString /*resource*/)
239 { 240 {
240 // empty implementation, because some syncable applications do not 241 // empty implementation, because some syncable applications do not
241 // have an external(sharpdtm) syncmode, like pwmanager. 242 // have an external(sharpdtm) syncmode, like pwmanager.
242 return false; 243 return false;
243 } 244 }
244
245
246}; 245};
247 246
248 247
249#endif 248#endif
diff --git a/libkdepim/libkdepim.pro b/libkdepim/libkdepim.pro
index 84af7ad..7160d0e 100644
--- a/libkdepim/libkdepim.pro
+++ b/libkdepim/libkdepim.pro
@@ -49,13 +49,28 @@ SOURCES = \
49 kinputdialog.cpp \ 49 kinputdialog.cpp \
50 kpimprefs.cpp \ 50 kpimprefs.cpp \
51 kpimglobalprefs.cpp \ 51 kpimglobalprefs.cpp \
52 kprefsdialog.cpp \ 52 kprefsdialog.cpp \
53 kprefswidget.cpp \ 53 kprefswidget.cpp \
54 ksyncmanager.cpp \ 54 ksyncmanager.cpp \
55 ksyncprofile.cpp \ 55 ksyncprofile.cpp \
56 ksyncprefsdialog.cpp \ 56 ksyncprefsdialog.cpp \
57 kcmconfigs/kcmkdepimconfig.cpp \ 57 kcmconfigs/kcmkdepimconfig.cpp \
58 kcmconfigs/kdepimconfigwidget.cpp \ 58 kcmconfigs/kdepimconfigwidget.cpp \
59 phoneaccess.cpp 59 phoneaccess.cpp
60 60
61win32: {
61 62
63#olimport section
64importol {
65debug: {
66LIBS += mfc71ud.lib
67}
68release: {
69LIBS += mfc71u.lib
70}
71DEFINES += _OL_IMPORT_
72HEADERS += ol_access.h
73SOURCES += ol_access.cpp
74#olimport section end
75}
76}