-rw-r--r-- | kaddressbook/kabcore.cpp | 5 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 1 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 6 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 1 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 6 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.h | 3 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 5 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.h | 1 |
9 files changed, 27 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2a3334e..efae874 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2789,48 +2789,53 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
2789 | //} | 2789 | //} |
2790 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); | 2790 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); |
2791 | if ( syncOK ) { | 2791 | if ( syncOK ) { |
2792 | if ( syncManager->mWriteBackFile ) | 2792 | if ( syncManager->mWriteBackFile ) |
2793 | { | 2793 | { |
2794 | if ( external ) | 2794 | if ( external ) |
2795 | abLocal.removeSyncAddressees( !isXML); | 2795 | abLocal.removeSyncAddressees( !isXML); |
2796 | qDebug("Saving remote AB "); | 2796 | qDebug("Saving remote AB "); |
2797 | if ( ! abLocal.saveAB()) | 2797 | if ( ! abLocal.saveAB()) |
2798 | qDebug("Error writing back AB to file "); | 2798 | qDebug("Error writing back AB to file "); |
2799 | if ( isXML ) { | 2799 | if ( isXML ) { |
2800 | // afterwrite processing | 2800 | // afterwrite processing |
2801 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2801 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); |
2802 | } | 2802 | } |
2803 | } | 2803 | } |
2804 | } | 2804 | } |
2805 | setModified(); | 2805 | setModified(); |
2806 | 2806 | ||
2807 | } | 2807 | } |
2808 | if ( syncOK ) | 2808 | if ( syncOK ) |
2809 | mViewManager->refreshView(); | 2809 | mViewManager->refreshView(); |
2810 | return syncOK; | 2810 | return syncOK; |
2811 | 2811 | ||
2812 | } | 2812 | } |
2813 | void KABCore::removeSyncInfo( QString syncProfile) | ||
2814 | { | ||
2815 | qDebug("removeSyncInfo for profile %s ", syncProfile.latin1()); | ||
2816 | |||
2817 | } | ||
2813 | 2818 | ||
2814 | 2819 | ||
2815 | //this is a overwritten callbackmethods from the syncinterface | 2820 | //this is a overwritten callbackmethods from the syncinterface |
2816 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) | 2821 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) |
2817 | { | 2822 | { |
2818 | if ( resource == "phone" ) | 2823 | if ( resource == "phone" ) |
2819 | return syncPhone(); | 2824 | return syncPhone(); |
2820 | disableBR( true ); | 2825 | disableBR( true ); |
2821 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2826 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2822 | 2827 | ||
2823 | AddressBook abLocal( resource,"syncContact"); | 2828 | AddressBook abLocal( resource,"syncContact"); |
2824 | bool syncOK = false; | 2829 | bool syncOK = false; |
2825 | if ( abLocal.load() ) { | 2830 | if ( abLocal.load() ) { |
2826 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2831 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2827 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2832 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2828 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); | 2833 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); |
2829 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2834 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2830 | if ( syncOK ) { | 2835 | if ( syncOK ) { |
2831 | if ( syncManager->mWriteBackFile ) { | 2836 | if ( syncManager->mWriteBackFile ) { |
2832 | abLocal.removeSyncAddressees( false ); | 2837 | abLocal.removeSyncAddressees( false ); |
2833 | abLocal.saveAB(); | 2838 | abLocal.saveAB(); |
2834 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2839 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); |
2835 | } | 2840 | } |
2836 | } | 2841 | } |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index fcbe1e8..a288505 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -461,42 +461,43 @@ class KABCore : public QWidget, public KSyncInterface | |||
461 | QPopupMenu *settingsMenu; | 461 | QPopupMenu *settingsMenu; |
462 | QPopupMenu *changeMenu; | 462 | QPopupMenu *changeMenu; |
463 | //US QAction *mActionSave; | 463 | //US QAction *mActionSave; |
464 | QPopupMenu *ImportMenu; | 464 | QPopupMenu *ImportMenu; |
465 | QPopupMenu *ExportMenu; | 465 | QPopupMenu *ExportMenu; |
466 | //LR additional methods | 466 | //LR additional methods |
467 | KAction *mActionRemoveVoice; | 467 | KAction *mActionRemoveVoice; |
468 | KAction * mActionImportOL; | 468 | KAction * mActionImportOL; |
469 | 469 | ||
470 | #ifndef KAB_EMBEDDED | 470 | #ifndef KAB_EMBEDDED |
471 | KAddressBookService *mAddressBookService; | 471 | KAddressBookService *mAddressBookService; |
472 | #endif //KAB_EMBEDDED | 472 | #endif //KAB_EMBEDDED |
473 | 473 | ||
474 | class KABCorePrivate; | 474 | class KABCorePrivate; |
475 | KABCorePrivate *d; | 475 | KABCorePrivate *d; |
476 | //US bool mBlockSaveFlag; | 476 | //US bool mBlockSaveFlag; |
477 | 477 | ||
478 | #ifdef KAB_EMBEDDED | 478 | #ifdef KAB_EMBEDDED |
479 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient | 479 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient |
480 | #endif //KAB_EMBEDDED | 480 | #endif //KAB_EMBEDDED |
481 | 481 | ||
482 | //this are the overwritten callbackmethods from the syncinterface | 482 | //this are the overwritten callbackmethods from the syncinterface |
483 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 483 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
484 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 484 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
485 | virtual void removeSyncInfo( QString syncProfile); | ||
485 | bool syncPhone(); | 486 | bool syncPhone(); |
486 | void message( QString m ); | 487 | void message( QString m ); |
487 | 488 | ||
488 | // LR ******************************* | 489 | // LR ******************************* |
489 | // sync stuff! | 490 | // sync stuff! |
490 | QString sentSyncFile(); | 491 | QString sentSyncFile(); |
491 | QPopupMenu *syncMenu; | 492 | QPopupMenu *syncMenu; |
492 | KSyncManager* syncManager; | 493 | KSyncManager* syncManager; |
493 | int mGlobalSyncMode; | 494 | int mGlobalSyncMode; |
494 | bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); | 495 | bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); |
495 | KABC::Addressee getLastSyncAddressee(); | 496 | KABC::Addressee getLastSyncAddressee(); |
496 | QDateTime mLastAddressbookSync; | 497 | QDateTime mLastAddressbookSync; |
497 | int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); | 498 | int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); |
498 | // ********************* | 499 | // ********************* |
499 | 500 | ||
500 | }; | 501 | }; |
501 | 502 | ||
502 | #endif | 503 | #endif |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 2ccccfa..af01625 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -3743,24 +3743,30 @@ bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | |||
3743 | qDebug("SyncKDE request detected!"); | 3743 | qDebug("SyncKDE request detected!"); |
3744 | mSyncKDE = true; | 3744 | mSyncKDE = true; |
3745 | } | 3745 | } |
3746 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3746 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
3747 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 3747 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
3748 | return syncCalendar( filename, mode ); | 3748 | return syncCalendar( filename, mode ); |
3749 | } | 3749 | } |
3750 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 3750 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
3751 | { | 3751 | { |
3752 | mSyncKDE = false; | 3752 | mSyncKDE = false; |
3753 | //mSyncManager = manager; | 3753 | //mSyncManager = manager; |
3754 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3754 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
3755 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 3755 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
3756 | if ( resource == "sharp" ) | 3756 | if ( resource == "sharp" ) |
3757 | syncExternal( 0 ); | 3757 | syncExternal( 0 ); |
3758 | if ( resource == "phone" ) | 3758 | if ( resource == "phone" ) |
3759 | syncExternal( 1 ); | 3759 | syncExternal( 1 ); |
3760 | // pending setmodified | 3760 | // pending setmodified |
3761 | return true; | 3761 | return true; |
3762 | } | 3762 | } |
3763 | void CalendarView::setSyncManager(KSyncManager* manager) | 3763 | void CalendarView::setSyncManager(KSyncManager* manager) |
3764 | { | 3764 | { |
3765 | mSyncManager = manager; | 3765 | mSyncManager = manager; |
3766 | } | 3766 | } |
3767 | |||
3768 | void CalendarView::removeSyncInfo( QString syncProfile) | ||
3769 | { | ||
3770 | qDebug("removeSyncInfo for profile %s ", syncProfile.latin1()); | ||
3771 | |||
3772 | } | ||
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 2818ee9..acc20d6 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -444,48 +444,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
444 | void beamIncidence(Incidence *) ; | 444 | void beamIncidence(Incidence *) ; |
445 | void beamCalendar() ; | 445 | void beamCalendar() ; |
446 | void beamFilteredCalendar() ; | 446 | void beamFilteredCalendar() ; |
447 | void beamIncidenceList(QPtrList<Incidence>) ; | 447 | void beamIncidenceList(QPtrList<Incidence>) ; |
448 | void manageCategories(); | 448 | void manageCategories(); |
449 | int addCategories(); | 449 | int addCategories(); |
450 | void removeCategories(); | 450 | void removeCategories(); |
451 | void setSyncDevice( QString ); | 451 | void setSyncDevice( QString ); |
452 | void setSyncName( QString ); | 452 | void setSyncName( QString ); |
453 | protected slots: | 453 | protected slots: |
454 | void timerAlarm(); | 454 | void timerAlarm(); |
455 | void suspendAlarm(); | 455 | void suspendAlarm(); |
456 | void beamDone( Ir *ir ); | 456 | void beamDone( Ir *ir ); |
457 | /** Select a view or adapt the current view to display the specified dates. */ | 457 | /** Select a view or adapt the current view to display the specified dates. */ |
458 | void showDates( const KCal::DateList & ); | 458 | void showDates( const KCal::DateList & ); |
459 | void selectWeekNum ( int ); | 459 | void selectWeekNum ( int ); |
460 | 460 | ||
461 | public: | 461 | public: |
462 | // show a standard warning | 462 | // show a standard warning |
463 | // returns KMsgBox::yesNoCancel() | 463 | // returns KMsgBox::yesNoCancel() |
464 | int msgCalModified(); | 464 | int msgCalModified(); |
465 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 465 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
466 | 466 | ||
467 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 467 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
468 | virtual void removeSyncInfo( QString syncProfile); | ||
468 | void setSyncManager(KSyncManager* manager); | 469 | void setSyncManager(KSyncManager* manager); |
469 | void setLoadedFileVersion(QDateTime); | 470 | void setLoadedFileVersion(QDateTime); |
470 | bool checkFileVersion(QString fn); | 471 | bool checkFileVersion(QString fn); |
471 | bool checkFileChanged(QString fn); | 472 | bool checkFileChanged(QString fn); |
472 | Event* getLastSyncEvent(); | 473 | Event* getLastSyncEvent(); |
473 | /** Adapt navigation units correpsonding to step size of navigation of the | 474 | /** Adapt navigation units correpsonding to step size of navigation of the |
474 | * current view. | 475 | * current view. |
475 | */ | 476 | */ |
476 | void adaptNavigationUnits(); | 477 | void adaptNavigationUnits(); |
477 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); | 478 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); |
478 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); | 479 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); |
479 | //Attendee* getYourAttendee(Event *event); | 480 | //Attendee* getYourAttendee(Event *event); |
480 | protected: | 481 | protected: |
481 | void schedule(Scheduler::Method, Incidence *incidence = 0); | 482 | void schedule(Scheduler::Method, Incidence *incidence = 0); |
482 | 483 | ||
483 | // returns KMsgBox::OKCandel() | 484 | // returns KMsgBox::OKCandel() |
484 | int msgItemDelete(); | 485 | int msgItemDelete(); |
485 | void showEventEditor(); | 486 | void showEventEditor(); |
486 | void showTodoEditor(); | 487 | void showTodoEditor(); |
487 | void writeLocale(); | 488 | void writeLocale(); |
488 | Todo *selectedTodo(); | 489 | Todo *selectedTodo(); |
489 | 490 | ||
490 | private: | 491 | private: |
491 | bool mSyncKDE; | 492 | bool mSyncKDE; |
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 4a610fa..af4f1ab 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -175,37 +175,38 @@ class KSyncManager : public QObject | |||
175 | int mCurrentSyncProfile ; | 175 | int mCurrentSyncProfile ; |
176 | void syncRemote( KSyncProfile* prof, bool ask = true); | 176 | void syncRemote( KSyncProfile* prof, bool ask = true); |
177 | bool edit_sync_options(); | 177 | bool edit_sync_options(); |
178 | bool edit_pisync_options(); | 178 | bool edit_pisync_options(); |
179 | int ringSync(); | 179 | int ringSync(); |
180 | QString getPassword( ); | 180 | QString getPassword( ); |
181 | bool mPisyncFinished; | 181 | bool mPisyncFinished; |
182 | bool mBlockSaveFlag; | 182 | bool mBlockSaveFlag; |
183 | QWidget* mParent; | 183 | QWidget* mParent; |
184 | KSyncInterface* mImplementation; | 184 | KSyncInterface* mImplementation; |
185 | TargetApp mTargetApp; | 185 | TargetApp mTargetApp; |
186 | QPopupMenu* mSyncMenu; | 186 | QPopupMenu* mSyncMenu; |
187 | QProgressBar* bar; | 187 | QProgressBar* bar; |
188 | 188 | ||
189 | private slots: | 189 | private slots: |
190 | void confSync(); | 190 | void confSync(); |
191 | 191 | ||
192 | 192 | ||
193 | }; | 193 | }; |
194 | 194 | ||
195 | 195 | ||
196 | class KSyncInterface | 196 | class KSyncInterface |
197 | { | 197 | { |
198 | public : | 198 | public : |
199 | virtual void removeSyncInfo( QString syncProfile) = 0; | ||
199 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; | 200 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; |
200 | virtual bool syncExternal(KSyncManager* manager, QString resource) | 201 | virtual bool syncExternal(KSyncManager* manager, QString resource) |
201 | { | 202 | { |
202 | // empty implementation, because some syncable applications do not | 203 | // empty implementation, because some syncable applications do not |
203 | // have an external(sharpdtm) syncmode, like pwmanager. | 204 | // have an external(sharpdtm) syncmode, like pwmanager. |
204 | return false; | 205 | return false; |
205 | } | 206 | } |
206 | 207 | ||
207 | 208 | ||
208 | }; | 209 | }; |
209 | 210 | ||
210 | 211 | ||
211 | #endif | 212 | #endif |
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index 2b8f2fa..6ae6e28 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp | |||
@@ -1443,30 +1443,36 @@ void PwM::createAboutData_slot() | |||
1443 | "Ian MacGregor - original documentation author.\n" | 1443 | "Ian MacGregor - original documentation author.\n" |
1444 | ); | 1444 | ); |
1445 | } | 1445 | } |
1446 | 1446 | ||
1447 | 1447 | ||
1448 | //this are the overwritten callbackmethods from the syncinterface | 1448 | //this are the overwritten callbackmethods from the syncinterface |
1449 | bool PwM::sync(KSyncManager* manager, QString filename, int mode) | 1449 | bool PwM::sync(KSyncManager* manager, QString filename, int mode) |
1450 | { | 1450 | { |
1451 | PWM_ASSERT(curDoc()); | 1451 | PWM_ASSERT(curDoc()); |
1452 | 1452 | ||
1453 | bool ret = curDoc()->sync(manager, filename, mode); | 1453 | bool ret = curDoc()->sync(manager, filename, mode); |
1454 | 1454 | ||
1455 | qDebug("PwM::sync save now: ret=%i", ret); | 1455 | qDebug("PwM::sync save now: ret=%i", ret); |
1456 | 1456 | ||
1457 | if (ret == true) { | 1457 | if (ret == true) { |
1458 | //US BUG: what can we call here to update the view of the current doc? | 1458 | //US BUG: what can we call here to update the view of the current doc? |
1459 | //mViewManager->refreshView(); | 1459 | //mViewManager->refreshView(); |
1460 | 1460 | ||
1461 | //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. | 1461 | //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. |
1462 | save(); | 1462 | save(); |
1463 | } | 1463 | } |
1464 | 1464 | ||
1465 | return ret; | 1465 | return ret; |
1466 | } | 1466 | } |
1467 | |||
1468 | void PwM::removeSyncInfo( QString syncProfile) | ||
1469 | { | ||
1470 | qDebug("PWM::not implemented: removeSyncInfo for profile %s ", syncProfile.latin1()); | ||
1471 | } | ||
1472 | |||
1467 | #endif | 1473 | #endif |
1468 | 1474 | ||
1469 | 1475 | ||
1470 | #ifndef PWM_EMBEDDED | 1476 | #ifndef PWM_EMBEDDED |
1471 | #include "pwm.moc" | 1477 | #include "pwm.moc" |
1472 | #endif | 1478 | #endif |
diff --git a/pwmanager/pwmanager/pwm.h b/pwmanager/pwmanager/pwm.h index 5822d59..fb34bca 100644 --- a/pwmanager/pwmanager/pwm.h +++ b/pwmanager/pwmanager/pwm.h | |||
@@ -256,42 +256,43 @@ protected: | |||
256 | /** "chipcard" popup-menu */ | 256 | /** "chipcard" popup-menu */ |
257 | KPopupMenu *chipcardPopup; | 257 | KPopupMenu *chipcardPopup; |
258 | #endif // CONFIG_KEYCARD | 258 | #endif // CONFIG_KEYCARD |
259 | /** "view" popup-menu */ | 259 | /** "view" popup-menu */ |
260 | KPopupMenu *viewPopup; | 260 | KPopupMenu *viewPopup; |
261 | /** "options" popup-menu */ | 261 | /** "options" popup-menu */ |
262 | KPopupMenu *optionsPopup; | 262 | KPopupMenu *optionsPopup; |
263 | /** "help" popup-menu */ | 263 | /** "help" popup-menu */ |
264 | KPopupMenu *helpPopup; | 264 | KPopupMenu *helpPopup; |
265 | /** "export" popup-menu */ | 265 | /** "export" popup-menu */ |
266 | KPopupMenu *exportPopup; | 266 | KPopupMenu *exportPopup; |
267 | /** "import" popup-menu */ | 267 | /** "import" popup-menu */ |
268 | KPopupMenu *importPopup; | 268 | KPopupMenu *importPopup; |
269 | /** force quit this window? */ | 269 | /** force quit this window? */ |
270 | bool forceQuit; | 270 | bool forceQuit; |
271 | /** force minimize this window to the tray */ | 271 | /** force minimize this window to the tray */ |
272 | bool forceMinimizeToTray; | 272 | bool forceMinimizeToTray; |
273 | 273 | ||
274 | 274 | ||
275 | 275 | ||
276 | 276 | ||
277 | private: | 277 | private: |
278 | #ifdef PWM_EMBEDDED | 278 | #ifdef PWM_EMBEDDED |
279 | //this are the overwritten callbackmethods from the syncinterface | 279 | //this are the overwritten callbackmethods from the syncinterface |
280 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 280 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
281 | virtual void removeSyncInfo( QString syncProfile); | ||
281 | 282 | ||
282 | // LR ******************************* | 283 | // LR ******************************* |
283 | // sync stuff! | 284 | // sync stuff! |
284 | QPopupMenu *syncPopup; | 285 | QPopupMenu *syncPopup; |
285 | KSyncManager* syncManager; | 286 | KSyncManager* syncManager; |
286 | #endif | 287 | #endif |
287 | 288 | ||
288 | 289 | ||
289 | 290 | ||
290 | 291 | ||
291 | 292 | ||
292 | 293 | ||
293 | 294 | ||
294 | 295 | ||
295 | }; | 296 | }; |
296 | 297 | ||
297 | #endif | 298 | #endif |
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp index cf8690f..fd17ce5 100644 --- a/pwmanager/pwmanager/pwmdoc.cpp +++ b/pwmanager/pwmanager/pwmdoc.cpp | |||
@@ -3283,49 +3283,52 @@ int PwMDoc::takePwMDataItem( PwMDataItem* local, PwMDataItem* remote, QDateTime | |||
3283 | if ( lastSync > localMod ) | 3283 | if ( lastSync > localMod ) |
3284 | return 2; | 3284 | return 2; |
3285 | localIsNew = localMod >= remoteMod; | 3285 | localIsNew = localMod >= remoteMod; |
3286 | //qDebug("conflict! ************************************** "); | 3286 | //qDebug("conflict! ************************************** "); |
3287 | { | 3287 | { |
3288 | PwMDataItemChooser acd ( *local,*remote, localIsNew , 0/*this*/ ); | 3288 | PwMDataItemChooser acd ( *local,*remote, localIsNew , 0/*this*/ ); |
3289 | result = acd.executeD(localIsNew); | 3289 | result = acd.executeD(localIsNew); |
3290 | return result; | 3290 | return result; |
3291 | } | 3291 | } |
3292 | break; | 3292 | break; |
3293 | case SYNC_PREF_FORCE_LOCAL: | 3293 | case SYNC_PREF_FORCE_LOCAL: |
3294 | return 1; | 3294 | return 1; |
3295 | break; | 3295 | break; |
3296 | case SYNC_PREF_FORCE_REMOTE: | 3296 | case SYNC_PREF_FORCE_REMOTE: |
3297 | return 2; | 3297 | return 2; |
3298 | break; | 3298 | break; |
3299 | 3299 | ||
3300 | default: | 3300 | default: |
3301 | // SYNC_PREF_TAKE_BOTH not implemented | 3301 | // SYNC_PREF_TAKE_BOTH not implemented |
3302 | break; | 3302 | break; |
3303 | } | 3303 | } |
3304 | return 0; | 3304 | return 0; |
3305 | } | 3305 | } |
3306 | 3306 | ||
3307 | 3307 | void PwMDoc::removeSyncInfo( QString syncProfile) | |
3308 | { | ||
3309 | qDebug("PwMDoc::not implemented: removeSyncInfo for profile %s ", syncProfile.latin1()); | ||
3310 | } | ||
3308 | 3311 | ||
3309 | 3312 | ||
3310 | //this are the overwritten callbackmethods from the syncinterface | 3313 | //this are the overwritten callbackmethods from the syncinterface |
3311 | bool PwMDoc::sync(KSyncManager* manager, QString filename, int mode) | 3314 | bool PwMDoc::sync(KSyncManager* manager, QString filename, int mode) |
3312 | { | 3315 | { |
3313 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 3316 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
3314 | 3317 | ||
3315 | //1) unlock local file first if necessary (ask for password) | 3318 | //1) unlock local file first if necessary (ask for password) |
3316 | if (this->isDeepLocked()) { | 3319 | if (this->isDeepLocked()) { |
3317 | PwMerror ret = this->deepLock(false); | 3320 | PwMerror ret = this->deepLock(false); |
3318 | if (ret != e_success) | 3321 | if (ret != e_success) |
3319 | return false; | 3322 | return false; |
3320 | } | 3323 | } |
3321 | 3324 | ||
3322 | //2) construct and open a new doc on the stack(automatic cleanup of remote file). | 3325 | //2) construct and open a new doc on the stack(automatic cleanup of remote file). |
3323 | PwMDoc syncTarget(this, "synctarget"); | 3326 | PwMDoc syncTarget(this, "synctarget"); |
3324 | PwMDoc* pSyncTarget = &syncTarget; | 3327 | PwMDoc* pSyncTarget = &syncTarget; |
3325 | 3328 | ||
3326 | 3329 | ||
3327 | PwMerror err = pSyncTarget->openDoc(&filename, 1 /*== open with all entries locked*/); | 3330 | PwMerror err = pSyncTarget->openDoc(&filename, 1 /*== open with all entries locked*/); |
3328 | 3331 | ||
3329 | if (err == e_alreadyOpen) { | 3332 | if (err == e_alreadyOpen) { |
3330 | PwMDocList::listItem li; | 3333 | PwMDocList::listItem li; |
3331 | if (getOpenDocList()->find(filename.latin1(), &li)) | 3334 | if (getOpenDocList()->find(filename.latin1(), &li)) |
diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h index 55e3231..e419c24 100644 --- a/pwmanager/pwmanager/pwmdoc.h +++ b/pwmanager/pwmanager/pwmdoc.h | |||
@@ -741,48 +741,49 @@ protected: | |||
741 | { | 741 | { |
742 | currentPw = pw; | 742 | currentPw = pw; |
743 | setDocStatFlag(DOC_STAT_DISK_DIRTY); | 743 | setDocStatFlag(DOC_STAT_DISK_DIRTY); |
744 | } | 744 | } |
745 | /** make a backup-copy of the given file */ | 745 | /** make a backup-copy of the given file */ |
746 | bool backupFile(const QString &filePath); | 746 | bool backupFile(const QString &filePath); |
747 | /** copy a file from src to dst */ | 747 | /** copy a file from src to dst */ |
748 | bool copyFile(const QString &src, const QString &dst); | 748 | bool copyFile(const QString &src, const QString &dst); |
749 | 749 | ||
750 | 750 | ||
751 | public: | 751 | public: |
752 | #ifdef PWM_EMBEDDED | 752 | #ifdef PWM_EMBEDDED |
753 | //US ENH: this is the magic function that syncronizes the local doc with the remote doc. | 753 | //US ENH: this is the magic function that syncronizes the local doc with the remote doc. |
754 | PwMerror syncronize(KSyncManager* manager, PwMDoc* syncLocal, PwMDoc* syncRemote, int mode ); | 754 | PwMerror syncronize(KSyncManager* manager, PwMDoc* syncLocal, PwMDoc* syncRemote, int mode ); |
755 | 755 | ||
756 | //takePwMDataItem returns the following values | 756 | //takePwMDataItem returns the following values |
757 | // 0 equal | 757 | // 0 equal |
758 | // 1 take local | 758 | // 1 take local |
759 | // 2 take remote | 759 | // 2 take remote |
760 | // 3 cancel | 760 | // 3 cancel |
761 | int takePwMDataItem( PwMDataItem* local, PwMDataItem* remote, QDateTime lastSync, int mode , bool full ); | 761 | int takePwMDataItem( PwMDataItem* local, PwMDataItem* remote, QDateTime lastSync, int mode , bool full ); |
762 | 762 | ||
763 | //the following methods are the overwritten callbackmethods from the syncinterface | 763 | //the following methods are the overwritten callbackmethods from the syncinterface |
764 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 764 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
765 | virtual void removeSyncInfo( QString syncProfile); | ||
765 | 766 | ||
766 | #endif | 767 | #endif |
767 | private: | 768 | private: |
768 | //US ENH: helpermethods to access the sync data for a certain syncname. | 769 | //US ENH: helpermethods to access the sync data for a certain syncname. |
769 | // It returns the syncdatas index | 770 | // It returns the syncdatas index |
770 | bool findSyncData(const QString &syncname, unsigned int *index); | 771 | bool findSyncData(const QString &syncname, unsigned int *index); |
771 | 772 | ||
772 | /** add new syncdataentry */ | 773 | /** add new syncdataentry */ |
773 | PwMerror addSyncDataEntry(PwMSyncItem *d, bool dontFlagDirty = false); | 774 | PwMerror addSyncDataEntry(PwMSyncItem *d, bool dontFlagDirty = false); |
774 | 775 | ||
775 | /** returns a pointer to the syncdata */ | 776 | /** returns a pointer to the syncdata */ |
776 | PwMSyncItem* getSyncDataEntry(unsigned int index) | 777 | PwMSyncItem* getSyncDataEntry(unsigned int index) |
777 | { return &(dti.syncDta[index]); } | 778 | { return &(dti.syncDta[index]); } |
778 | 779 | ||
779 | /** delete entry */ | 780 | /** delete entry */ |
780 | bool delSyncDataEntry(unsigned int index, bool dontFlagDirty = false); | 781 | bool delSyncDataEntry(unsigned int index, bool dontFlagDirty = false); |
781 | 782 | ||
782 | PwMDataItem* findEntryByID(const QString &uid, unsigned int *category, unsigned int *index); | 783 | PwMDataItem* findEntryByID(const QString &uid, unsigned int *category, unsigned int *index); |
783 | 784 | ||
784 | QStringList getIDEntryList(); | 785 | QStringList getIDEntryList(); |
785 | 786 | ||
786 | }; | 787 | }; |
787 | 788 | ||
788 | #endif | 789 | #endif |