author | zautrix <zautrix> | 2005-06-29 16:14:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-29 16:14:46 (UTC) |
commit | 77aa480c9891a90c9b492618ebfd2b20f2d0727a (patch) (unidiff) | |
tree | 4f2c278d016fe21f280f8ee6abbca34685aada96 /libkdepim | |
parent | e0fa858c284dddf0d47146e666c4ece7158487be (diff) | |
download | kdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.zip kdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.tar.gz kdepimpi-77aa480c9891a90c9b492618ebfd2b20f2d0727a.tar.bz2 |
many sync fixes
-rw-r--r-- | libkdepim/externalapphandler.cpp | 12 | ||||
-rw-r--r-- | libkdepim/externalapphandler.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 18 |
3 files changed, 20 insertions, 11 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 0e9c5e5..2ce6926 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -17,32 +17,33 @@ | |||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | #include <stdlib.h> | 30 | #include <stdlib.h> |
31 | 31 | ||
32 | #include <qfile.h> | 32 | #include <qfile.h> |
33 | #include <qtimer.h> | ||
33 | #include <qmap.h> | 34 | #include <qmap.h> |
34 | #include <qregexp.h> | 35 | #include <qregexp.h> |
35 | 36 | ||
36 | #ifndef DESKTOP_VERSION | 37 | #ifndef DESKTOP_VERSION |
37 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
38 | #include <qtopia/qcopenvelope_qws.h> | 39 | #include <qtopia/qcopenvelope_qws.h> |
39 | #else | 40 | #else |
40 | #include <qapplication.h> | 41 | #include <qapplication.h> |
41 | #endif | 42 | #endif |
42 | 43 | ||
43 | #include <kstaticdeleter.h> | 44 | #include <kstaticdeleter.h> |
44 | #include <kmessagebox.h> | 45 | #include <kmessagebox.h> |
45 | 46 | ||
46 | 47 | ||
47 | #include "externalapphandler.h" | 48 | #include "externalapphandler.h" |
48 | 49 | ||
@@ -1116,41 +1117,46 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete | |||
1116 | 1117 | ||
1117 | if (useValMap == true) | 1118 | if (useValMap == true) |
1118 | (*e) << valmap; | 1119 | (*e) << valmap; |
1119 | 1120 | ||
1120 | #endif | 1121 | #endif |
1121 | 1122 | ||
1122 | } | 1123 | } |
1123 | 1124 | ||
1124 | 1125 | ||
1125 | 1126 | ||
1126 | /************************************************************************** | 1127 | /************************************************************************** |
1127 | * | 1128 | * |
1128 | **************************************************************************/ | 1129 | **************************************************************************/ |
1129 | 1130 | ||
1130 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) | 1131 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) |
1131 | { | 1132 | { |
1132 | 1133 | qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this); | |
1133 | if ( cmsg == "nextView()" ) { | 1134 | if ( cmsg == "nextView()" ) { |
1134 | qDebug("nextView()"); | 1135 | qDebug("nextView()"); |
1135 | emit nextView(); | 1136 | QTimer::singleShot( 0, this, SIGNAL ( nextView() )); |
1136 | return; | 1137 | return; |
1137 | } | 1138 | } |
1138 | if ( cmsg == "callContactdialog()" ) { | 1139 | if ( cmsg == "callContactdialog()" ) { |
1139 | qDebug("callContactdialog()"); | 1140 | qDebug("callContactdialog()"); |
1140 | emit callContactdialog(); | 1141 | QTimer::singleShot( 0, this, SIGNAL ( callContactdialog() )); |
1142 | return; | ||
1143 | } | ||
1144 | if ( cmsg == "doRingSync" ) { | ||
1145 | qDebug("doRingSync"); | ||
1146 | QTimer::singleShot( 0, this, SIGNAL ( doRingSync() )); | ||
1141 | return; | 1147 | return; |
1142 | } | 1148 | } |
1143 | 1149 | ||
1144 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1150 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1145 | if (!res) | 1151 | if (!res) |
1146 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); | 1152 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); |
1147 | 1153 | ||
1148 | if (!res) | 1154 | if (!res) |
1149 | res = mDisplayDetails->appMessage( cmsg, data ); | 1155 | res = mDisplayDetails->appMessage( cmsg, data ); |
1150 | 1156 | ||
1151 | // if (!res) | 1157 | // if (!res) |
1152 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1158 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1153 | } | 1159 | } |
1154 | 1160 | ||
1155 | 1161 | ||
1156 | 1162 | ||
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index 097f306..b899ad7 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h | |||
@@ -222,32 +222,33 @@ class ExternalAppHandler : public QObject | |||
222 | const QStringList& assembledNameList, const QStringList& uidList); | 222 | const QStringList& assembledNameList, const QStringList& uidList); |
223 | 223 | ||
224 | 224 | ||
225 | //loadConfig clears the cache and checks again if the applications are available or not | 225 | //loadConfig clears the cache and checks again if the applications are available or not |
226 | void loadConfig(); | 226 | void loadConfig(); |
227 | 227 | ||
228 | QList<DefaultAppItem> getAvailableDefaultItems(Types); | 228 | QList<DefaultAppItem> getAvailableDefaultItems(Types); |
229 | DefaultAppItem* getDefaultItem(Types, int); | 229 | DefaultAppItem* getDefaultItem(Types, int); |
230 | 230 | ||
231 | public slots: | 231 | public slots: |
232 | void appMessage( const QCString& msg, const QByteArray& data ); | 232 | void appMessage( const QCString& msg, const QByteArray& data ); |
233 | 233 | ||
234 | 234 | ||
235 | signals: | 235 | signals: |
236 | void callContactdialog(); | 236 | void callContactdialog(); |
237 | void nextView(); | 237 | void nextView(); |
238 | void doRingSync(); | ||
238 | // Emmitted when the target app receives a request from the source app | 239 | // Emmitted when the target app receives a request from the source app |
239 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); | 240 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); |
240 | 241 | ||
241 | // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi | 242 | // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi |
242 | // The first parameter is a uniqueid. It can be used to identify the event | 243 | // The first parameter is a uniqueid. It can be used to identify the event |
243 | void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); | 244 | void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); |
244 | 245 | ||
245 | void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email); | 246 | void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email); |
246 | void receivedFindByEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); | 247 | void receivedFindByEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); |
247 | 248 | ||
248 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | 249 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); |
249 | 250 | ||
250 | 251 | ||
251 | // Emmitted when the target app receives a request from the source app | 252 | // Emmitted when the target app receives a request from the source app |
252 | void requestForBirthdayList(const QString& sourceChannel, const QString& uid); | 253 | void requestForBirthdayList(const QString& sourceChannel, const QString& uid); |
253 | 254 | ||
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index db815d6..038e032 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -508,40 +508,42 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) | |||
508 | } | 508 | } |
509 | 509 | ||
510 | void KSyncManager::quickSyncLocalFile() | 510 | void KSyncManager::quickSyncLocalFile() |
511 | { | 511 | { |
512 | 512 | ||
513 | if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) { | 513 | if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) { |
514 | qDebug("KSM::quick syncLocalFile() successful "); | 514 | qDebug("KSM::quick syncLocalFile() successful "); |
515 | 515 | ||
516 | } | 516 | } |
517 | } | 517 | } |
518 | 518 | ||
519 | void KSyncManager::multiSync( bool askforPrefs ) | 519 | void KSyncManager::multiSync( bool askforPrefs ) |
520 | { | 520 | { |
521 | if (blockSave()) | 521 | if (blockSave()) |
522 | return; | 522 | return; |
523 | setBlockSave(true); | 523 | setBlockSave(true); |
524 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 524 | if ( askforPrefs ) { |
525 | if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"), | 525 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
526 | question, | 526 | if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"), |
527 | i18n("Yes"), i18n("No"), | 527 | question, |
528 | 0, 0 ) != 0 ) { | 528 | i18n("Yes"), i18n("No"), |
529 | setBlockSave(false); | 529 | 0, 0 ) != 0 ) { |
530 | mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!")); | 530 | setBlockSave(false); |
531 | return; | 531 | mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!")); |
532 | return; | ||
533 | } | ||
532 | } | 534 | } |
533 | mCurrentSyncDevice = i18n("Multiple profiles") ; | 535 | mCurrentSyncDevice = i18n("Multiple profiles") ; |
534 | mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; | 536 | mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; |
535 | if ( askforPrefs ) { | 537 | if ( askforPrefs ) { |
536 | if ( !edit_sync_options()) { | 538 | if ( !edit_sync_options()) { |
537 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") ); | 539 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") ); |
538 | return; | 540 | return; |
539 | } | 541 | } |
540 | mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; | 542 | mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; |
541 | } | 543 | } |
542 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); | 544 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); |
543 | qApp->processEvents(); | 545 | qApp->processEvents(); |
544 | int num = ringSync() ; | 546 | int num = ringSync() ; |
545 | if ( num > 1 ) | 547 | if ( num > 1 ) |
546 | ringSync(); | 548 | ringSync(); |
547 | setBlockSave(false); | 549 | setBlockSave(false); |