summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--kaddressbook/kabcore.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 41b3e45..c61a322 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,228 +1,232 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 1.9.11 ************ 3********** VERSION 1.9.11 ************
4 4
5Fixed several problems in PWM/Pi, like 5Fixed several problems in PWM/Pi, like
6asking the user, if unsaved changed are pending 6asking the user, if unsaved changed are pending
7when closing the app. 7when closing the app.
8 8
9Fixed a crash in KO/Pi , when importing/loading vcs files 9Fixed a crash in KO/Pi , when importing/loading vcs files
10which have an entry with an attendee with state: 10which have an entry with an attendee with state:
11NEEDS ACTION 11NEEDS ACTION
12 12
13Fixed some problems in the German translation of OM/Pi, 13Fixed some problems in the German translation of OM/Pi,
14which makes some dialogs not fitting on the screen 14which makes some dialogs not fitting on the screen
15of the Z 5500. 15of the Z 5500.
16 16
17Fixed Qtopia crash, when disabling/deinstalling 17Fixed Qtopia crash, when disabling/deinstalling
18KO/Pi alarm applet. 18KO/Pi alarm applet.
19 19
20Implemented direct KDE<->KA/Pi sync for KA/Pi running 20Implemented direct KDE<->KA/Pi sync for KA/Pi running
21on Linux desktop. 21on Linux desktop.
22 22
23Added "remove sync info" to sync menu. 23Added "remove sync info" to sync menu.
24 24
25Tweaked the KO/Pi What's next view a bit, added 25Tweaked the KO/Pi What's next view a bit, added
26setting to hide events that are done. 26setting to hide events that are done.
27 27
28Disabled "beam receive enabled" on startup to 28Disabled "beam receive enabled" on startup to
29avoid problems if Fastload is enabled. 29avoid problems if Fastload is enabled.
30Please set "beam receive enabled", 30Please set "beam receive enabled",
31if you want to receive data via IR. 31if you want to receive data via IR.
32 32
33Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running 33Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running
34on Linux desktop. 34on Linux desktop.
35 35
36Made in KA/Pi scrolling possible, if details view is selected. 36Made in KA/Pi scrolling possible, if details view is selected.
37(The keyboard focus is set automatically to the search line)
38
39Fixed a bug in DMT sync, that a new entry in DTM was added
40on every sync to Kx/Pi.
37 41
38 42
39 43
40 44
41********** VERSION 1.9.10 ************ 45********** VERSION 1.9.10 ************
42 46
43Many internal small bugfixes. 47Many internal small bugfixes.
44And fix of the "big" bug in KO/Pi, 48And fix of the "big" bug in KO/Pi,
45that after Syncing the appointments had an offset by several hours. 49that after Syncing the appointments had an offset by several hours.
46That was a problem with the internal timezone setting, 50That was a problem with the internal timezone setting,
47introduced by the changed timezone configuration settings. 51introduced by the changed timezone configuration settings.
48 52
49German translation for OM/Pi is now available. 53German translation for OM/Pi is now available.
50 54
51 55
52********** VERSION 1.9.9 ************ 56********** VERSION 1.9.9 ************
53 57
54KDE-Pim/Pi has a new Member! 58KDE-Pim/Pi has a new Member!
55It is called PWM/Pi (Passwordmanager/platform-independent) 59It is called PWM/Pi (Passwordmanager/platform-independent)
56and it is available for the Zaurus. 60and it is available for the Zaurus.
57It is planned, that it will be available later for Windows. 61It is planned, that it will be available later for Windows.
58(And for Linux, of course). 62(And for Linux, of course).
59It is a port of the Passwordmanager of KDE. 63It is a port of the Passwordmanager of KDE.
60It will need the MicroKDElibs to run. 64It will need the MicroKDElibs to run.
61 65
62Made loading of addressbooks in KA/Pi up to 7 times faster! 66Made loading of addressbooks in KA/Pi up to 7 times faster!
63The bigger your addressbook file, the more starting speed 67The bigger your addressbook file, the more starting speed
64will you gain. (relatively) 68will you gain. (relatively)
65 69
66The Qtopia addressbook connector is now platform independend 70The Qtopia addressbook connector is now platform independend
67as well and should work on any platform for importing/exporting 71as well and should work on any platform for importing/exporting
68Qtopia and Opie XML files. 72Qtopia and Opie XML files.
69 73
70Added a +30min feature to the timezone settings to make 74Added a +30min feature to the timezone settings to make
71KDE-Pim/Pi useable in Australia and other parts on the 75KDE-Pim/Pi useable in Australia and other parts on the
72world with strange timezones ;-) 76world with strange timezones ;-)
73 77
74German "Umlaute" should now be sorted correctly on the Z in KA/Pi. 78German "Umlaute" should now be sorted correctly on the Z in KA/Pi.
75 79
76It is now possible to disable the 80It is now possible to disable the
77"receive data via infrared" feature, such that syncing with 81"receive data via infrared" feature, such that syncing with
78Outlook is now possible again with Kx/Pi runing. 82Outlook is now possible again with Kx/Pi runing.
79Please disable it, before syncing Sharp DTM with Outlook. 83Please disable it, before syncing Sharp DTM with Outlook.
80For your convenience, the "receive data via infrared" feature 84For your convenience, the "receive data via infrared" feature
81is disabled automatically, if you sync Kx/Pi with DTM. 85is disabled automatically, if you sync Kx/Pi with DTM.
82You have to enable it again manually after syncing. 86You have to enable it again manually after syncing.
83Enabling this feature makes it impossible to start the 87Enabling this feature makes it impossible to start the
84Sharp DTM apps. If this feature is enabled, you will only get the 88Sharp DTM apps. If this feature is enabled, you will only get the
85alarm notification from KO/Pi and not from the Sharp calendar. 89alarm notification from KO/Pi and not from the Sharp calendar.
86This is very useful if you sync KO/Pi with Sharp DTM, 90This is very useful if you sync KO/Pi with Sharp DTM,
87because after syncing you usually would get notified about 91because after syncing you usually would get notified about
88an alarm by KO/Pi and the Sharp Calendar. 92an alarm by KO/Pi and the Sharp Calendar.
89 93
90Together with the Linux desktop version of KO/Pi 94Together with the Linux desktop version of KO/Pi
91it is now possible to sync KO/Pi on the Zaurus 95it is now possible to sync KO/Pi on the Zaurus
92with the complete KDE-desktop (3.3 or later) 96with the complete KDE-desktop (3.3 or later)
93calendar data easily. 97calendar data easily.
94That makes it possible to sync the Z with one 98That makes it possible to sync the Z with one
95click of a mouse with the KDE-Desktop. 99click of a mouse with the KDE-Desktop.
96This feature it available for all Zaurus platforms KO/Pi 100This feature it available for all Zaurus platforms KO/Pi
97is running on. 101is running on.
98The only thing needed is a running KO/Pi on Linux and 102The only thing needed is a running KO/Pi on Linux and
99a compiled version of the small 103a compiled version of the small
100KDE-Pim/Pi<->KDE-Desktop access command line program, 104KDE-Pim/Pi<->KDE-Desktop access command line program,
101which is in the KDE-Pim/Pi sources available. 105which is in the KDE-Pim/Pi sources available.
102 106
103The "KDE-desktop" syncing feature for KA/Pi will follow 107The "KDE-desktop" syncing feature for KA/Pi will follow
104in the next releases. 108in the next releases.
105 109
106Fixed the vcard export bug, which had the version 1.9.8. 110Fixed the vcard export bug, which had the version 1.9.8.
107 111
108Added missing GERMAN translation to KO/Pi. 112Added missing GERMAN translation to KO/Pi.
109Hi PsionX, could you add the missing french translation?Thx! 113Hi PsionX, could you add the missing french translation?Thx!
110 114
111Translation files for KA/Pi are available as well. 115Translation files for KA/Pi are available as well.
112GERMAN translation will be available in the next release. 116GERMAN translation will be available in the next release.
113PsionX ( yres, you again ;-) ), could you start translating 117PsionX ( yres, you again ;-) ), could you start translating
114KA/Pi? Thx! 118KA/Pi? Thx!
115 119
116You can download the version 1.9.9 at 120You can download the version 1.9.9 at
117 121
118http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 122http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604
119 123
120Note: 124Note:
121To run the mail program OM/Pi you need libopenssl. 125To run the mail program OM/Pi you need libopenssl.
122A link to a download loaction is available at 126A link to a download loaction is available at
123ZSI at www.killefiz.de 127ZSI at www.killefiz.de
124 128
125 129
126********** VERSION 1.9.8 ************ 130********** VERSION 1.9.8 ************
127 131
128Fixed character decoding in OM/Pi. 132Fixed character decoding in OM/Pi.
129(e.g. German "Umlaute" were not displayed properly.) 133(e.g. German "Umlaute" were not displayed properly.)
130 134
131Made is possible to reparent todos in KO/Pi. 135Made is possible to reparent todos in KO/Pi.
132Use contextmenu or keys (look at Help-Keys + Colors) for that. 136Use contextmenu or keys (look at Help-Keys + Colors) for that.
133 137
134Added the missing Sync-Howto and WhatsNew to the packages. 138Added the missing Sync-Howto and WhatsNew to the packages.
135 139
136KO/Pi on Linux desktop can now sync with KDE desktop. 140KO/Pi on Linux desktop can now sync with KDE desktop.
137That means: When using KO/Pi on Linux desktop for syncing with 141That means: When using KO/Pi on Linux desktop for syncing with
138KDE desktop and the Zaurus, the Zaurus can be synced now 142KDE desktop and the Zaurus, the Zaurus can be synced now
139with all KDE-Calendar resources, not only with one local file. 143with all KDE-Calendar resources, not only with one local file.
140(That makes it possible to sync the Zaurus with the 144(That makes it possible to sync the Zaurus with the
141calendar data on a Kolab server) 145calendar data on a Kolab server)
142 146
143KA/Pi syncing with KDE desktop will be available in the next version. 147KA/Pi syncing with KDE desktop will be available in the next version.
144 148
145 149
146********** VERSION 1.9.7 ************ 150********** VERSION 1.9.7 ************
147 151
148KO/Pi - KA/Pi on Windows: 152KO/Pi - KA/Pi on Windows:
149Now a directory can be defined by the user, where the 153Now a directory can be defined by the user, where the
150application/config data should be saved. 154application/config data should be saved.
151 Define your desired path in the evironment variable 155 Define your desired path in the evironment variable
152 MICROKDEHOME 156 MICROKDEHOME
153 before starting KO/Pi or KA/Pi. 157 before starting KO/Pi or KA/Pi.
154 158
155An easy Kx/Pi to Kx/Pi syncing is now possible 159An easy Kx/Pi to Kx/Pi syncing is now possible
156(it is called Pi-Sync) via network. 160(it is called Pi-Sync) via network.
157Please look at the Sync Howto. 161Please look at the Sync Howto.
158 162
159Exporting of calendar data and contacts to mobile phones is now possible. 163Exporting of calendar data and contacts to mobile phones is now possible.
160The SyncHowto is updated with information howto 164The SyncHowto is updated with information howto
161access/sync mobile phones. 165access/sync mobile phones.
162Please look at the Sync Howto. 166Please look at the Sync Howto.
163 167
164Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. 168Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
165Please disable Fastload for the original contact/calendar applications 169Please disable Fastload for the original contact/calendar applications
166and close them. 170and close them.
167KO/Pi and KA/Pi must be running in order to receive the data. 171KO/Pi and KA/Pi must be running in order to receive the data.
168(KO/Pi and KA/Pi are always running if Fastload for them is enabled!) 172(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
169 173
170In the KA/Pi details view are now the preferred tel. numbers displayed on top 174In the KA/Pi details view are now the preferred tel. numbers displayed on top
171of the other data ( emails/tel.numbers/addresses) 175of the other data ( emails/tel.numbers/addresses)
172 176
173Fixed some syncing problems in KA/Pi. 177Fixed some syncing problems in KA/Pi.
174 178
175Added font settings for the KA/Pi details view. 179Added font settings for the KA/Pi details view.
176Added fields "children's name" and "gender" to KA/Pi. 180Added fields "children's name" and "gender" to KA/Pi.
177 181
178Made searching in KA/Pi better: 182Made searching in KA/Pi better:
179Now the first item in a view is selected after a search automatically and 183Now the first item in a view is selected after a search automatically and
180the views can be scrolled up/down when the search input field has the keyboard focus. 184the views can be scrolled up/down when the search input field has the keyboard focus.
181 185
182And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. 186And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
183 187
184 188
185********** VERSION 1.9.6 ************ 189********** VERSION 1.9.6 ************
186 190
187Changes in the external application communication on the Zaurus 191Changes in the external application communication on the Zaurus
188in order to use less RAM when the apps are running. 192in order to use less RAM when the apps are running.
189First syncing of addressbooks (KA/Pi) is possible. 193First syncing of addressbooks (KA/Pi) is possible.
190 194
191 195
192********** VERSION 1.9.5a ************ 196********** VERSION 1.9.5a ************
193 197
194Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. 198Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5.
195Fixed some small bugs. 199Fixed some small bugs.
196KA/Pi shows now the birthday in summary view. 200KA/Pi shows now the birthday in summary view.
197Now OM/Pi and KA/Pi are using the date format defined in KO/Pi 201Now OM/Pi and KA/Pi are using the date format defined in KO/Pi
198for displaying dates. 202for displaying dates.
199 203
200 204
201********** VERSION 1.9.5 ************ 205********** VERSION 1.9.5 ************
202 206
203There is still no Addressbook syncing! 207There is still no Addressbook syncing!
204 208
205New in 1.9.5: 209New in 1.9.5:
206 210
207Many bugfixes. 211Many bugfixes.
208Better searching in KA/Pi. 212Better searching in KA/Pi.
209You can configure in KA/Pi if you want to search only after 213You can configure in KA/Pi if you want to search only after
210<return> key pressed. 214<return> key pressed.
211 215
212Better mail downloading in OM/Pi. 216Better mail downloading in OM/Pi.
213 217
214First experimental alpha version of sync of KO/Pi with mobile phones. 218First experimental alpha version of sync of KO/Pi with mobile phones.
215See gammu documentation for supported phones. 219See gammu documentation for supported phones.
216You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp. 220You need to install the package kammu_1.9.5_arm.ipk for sync of KO/Pi with mobile phones. kammu_1.9.5_arm.ipk needs libbluetooth and libsdp.
217Quick hint how to use: 221Quick hint how to use:
218NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! 222NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL!
219Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. 223Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp.
220Create syncprofile - mobile device 224Create syncprofile - mobile device
221Remove entry for model. (Leave empty ). 225Remove entry for model. (Leave empty ).
222Enable infrared on Zaurus and your Phone. 226Enable infrared on Zaurus and your Phone.
223Sync. 227Sync.
224To get a more detailed log, start kopi from konsole. 228To get a more detailed log, start kopi from konsole.
225 229
226********** VERSION 1.9.4 ************ 230********** VERSION 1.9.4 ************
227 231
228This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. 232This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus.
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index c75b4bc..9ef97c9 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2546,385 +2546,385 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2546 local->resetTempSyncStat(); 2546 local->resetTempSyncStat();
2547 mLastAddressbookSync = QDateTime::currentDateTime(); 2547 mLastAddressbookSync = QDateTime::currentDateTime();
2548 if ( syncManager->syncWithDesktop() ) { 2548 if ( syncManager->syncWithDesktop() ) {
2549 // remote->removeSyncInfo( QString());//remove all info 2549 // remote->removeSyncInfo( QString());//remove all info
2550 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 2550 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
2551 mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; 2551 mLastAddressbookSync = KSyncManager::mRequestedSyncEvent;
2552 qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); 2552 qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() );
2553 } else { 2553 } else {
2554 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); 2554 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
2555 } 2555 }
2556 } 2556 }
2557 QDateTime modifiedCalendar = mLastAddressbookSync; 2557 QDateTime modifiedCalendar = mLastAddressbookSync;
2558 addresseeLSync = getLastSyncAddressee(); 2558 addresseeLSync = getLastSyncAddressee();
2559 qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1()); 2559 qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1());
2560 addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); 2560 addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName );
2561 if ( !addresseeR.isEmpty() ) { 2561 if ( !addresseeR.isEmpty() ) {
2562 addresseeRSync = addresseeR; 2562 addresseeRSync = addresseeR;
2563 remote->removeAddressee(addresseeR ); 2563 remote->removeAddressee(addresseeR );
2564 2564
2565 } else { 2565 } else {
2566 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2566 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2567 addresseeRSync = addresseeLSync ; 2567 addresseeRSync = addresseeLSync ;
2568 } else { 2568 } else {
2569 qDebug("FULLDATE 1"); 2569 qDebug("FULLDATE 1");
2570 fullDateRange = true; 2570 fullDateRange = true;
2571 Addressee newAdd; 2571 Addressee newAdd;
2572 addresseeRSync = newAdd; 2572 addresseeRSync = newAdd;
2573 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); 2573 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee"));
2574 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); 2574 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName );
2575 addresseeRSync.setRevision( mLastAddressbookSync ); 2575 addresseeRSync.setRevision( mLastAddressbookSync );
2576 addresseeRSync.setCategories( i18n("SyncAddressee") ); 2576 addresseeRSync.setCategories( i18n("SyncAddressee") );
2577 } 2577 }
2578 } 2578 }
2579 if ( addresseeLSync.revision() == mLastAddressbookSync ) { 2579 if ( addresseeLSync.revision() == mLastAddressbookSync ) {
2580 qDebug("FULLDATE 2"); 2580 qDebug("FULLDATE 2");
2581 fullDateRange = true; 2581 fullDateRange = true;
2582 } 2582 }
2583 if ( ! fullDateRange ) { 2583 if ( ! fullDateRange ) {
2584 if ( addresseeLSync.revision() != addresseeRSync.revision() ) { 2584 if ( addresseeLSync.revision() != addresseeRSync.revision() ) {
2585 2585
2586 // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); 2586 // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() );
2587 //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); 2587 //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec());
2588 fullDateRange = true; 2588 fullDateRange = true;
2589 qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() ); 2589 qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() );
2590 } 2590 }
2591 } 2591 }
2592 // fullDateRange = true; // debug only! 2592 // fullDateRange = true; // debug only!
2593 if ( fullDateRange ) 2593 if ( fullDateRange )
2594 mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365); 2594 mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365);
2595 else 2595 else
2596 mLastAddressbookSync = addresseeLSync.revision(); 2596 mLastAddressbookSync = addresseeLSync.revision();
2597 // for resyncing if own file has changed 2597 // for resyncing if own file has changed
2598 // PENDING fixme later when implemented 2598 // PENDING fixme later when implemented
2599#if 0 2599#if 0
2600 if ( mCurrentSyncDevice == "deleteaftersync" ) { 2600 if ( mCurrentSyncDevice == "deleteaftersync" ) {
2601 mLastAddressbookSync = loadedFileVersion; 2601 mLastAddressbookSync = loadedFileVersion;
2602 qDebug("setting mLastAddressbookSync "); 2602 qDebug("setting mLastAddressbookSync ");
2603 } 2603 }
2604#endif 2604#endif
2605 2605
2606 //qDebug("*************************** "); 2606 //qDebug("*************************** ");
2607 // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() ); 2607 // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() );
2608 QStringList er = remote->uidList(); 2608 QStringList er = remote->uidList();
2609 Addressee inR ;//= er.first(); 2609 Addressee inR ;//= er.first();
2610 Addressee inL; 2610 Addressee inL;
2611 2611
2612 syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); 2612 syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count());
2613 2613
2614 int modulo = (er.count()/10)+1; 2614 int modulo = (er.count()/10)+1;
2615 int incCounter = 0; 2615 int incCounter = 0;
2616 while ( incCounter < er.count()) { 2616 while ( incCounter < er.count()) {
2617 if (syncManager->isProgressBarCanceled()) 2617 if (syncManager->isProgressBarCanceled())
2618 return false; 2618 return false;
2619 if ( incCounter % modulo == 0 ) 2619 if ( incCounter % modulo == 0 )
2620 syncManager->showProgressBar(incCounter); 2620 syncManager->showProgressBar(incCounter);
2621 2621
2622 uid = er[ incCounter ]; 2622 uid = er[ incCounter ];
2623 bool skipIncidence = false; 2623 bool skipIncidence = false;
2624 if ( uid.left(19) == QString("last-syncAddressee-") ) 2624 if ( uid.left(19) == QString("last-syncAddressee-") )
2625 skipIncidence = true; 2625 skipIncidence = true;
2626 QString idS,OidS; 2626 QString idS,OidS;
2627 qApp->processEvents(); 2627 qApp->processEvents();
2628 if ( !skipIncidence ) { 2628 if ( !skipIncidence ) {
2629 inL = local->findByUid( uid ); 2629 inL = local->findByUid( uid );
2630 inR = remote->findByUid( uid ); 2630 inR = remote->findByUid( uid );
2631 //inL.setResource( 0 ); 2631 //inL.setResource( 0 );
2632 //inR.setResource( 0 ); 2632 //inR.setResource( 0 );
2633 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars 2633 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars
2634 if ( !inL.resource() || inL.resource()->includeInSync() ) { 2634 if ( !inL.resource() || inL.resource()->includeInSync() ) {
2635 if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) { 2635 if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) {
2636 //qDebug("take %d %s ", take, inL.summary().latin1()); 2636 //qDebug("take %d %s ", take, inL.summary().latin1());
2637 if ( take == 3 ) 2637 if ( take == 3 )
2638 return false; 2638 return false;
2639 if ( take == 1 ) {// take local ********************** 2639 if ( take == 1 ) {// take local **********************
2640 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2640 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2641 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 2641 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
2642 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 2642 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
2643 local->insertAddressee( inL, false ); 2643 local->insertAddressee( inL, false );
2644 idS = inR.externalUID(); 2644 idS = inR.externalUID();
2645 OidS = inR.originalExternalUID(); 2645 OidS = inR.originalExternalUID();
2646 } 2646 }
2647 else 2647 else
2648 idS = inR.IDStr(); 2648 idS = inR.IDStr();
2649 remote->removeAddressee( inR ); 2649 remote->removeAddressee( inR );
2650 inR = inL; 2650 inR = inL;
2651 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 2651 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
2652 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2652 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2653 inR.setOriginalExternalUID( OidS ); 2653 inR.setOriginalExternalUID( OidS );
2654 inR.setExternalUID( idS ); 2654 inR.setExternalUID( idS );
2655 if ( syncManager->syncWithDesktop() ) 2655 if ( syncManager->syncWithDesktop() )
2656 inR.setIDStr("changed" ); 2656 inR.setIDStr("changed" );
2657 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); 2657 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" );
2658 } else { 2658 } else {
2659 inR.setIDStr( idS ); 2659 inR.setIDStr( idS );
2660 } 2660 }
2661 inR.setResource( 0 ); 2661 inR.setResource( 0 );
2662 remote->insertAddressee( inR , false); 2662 remote->insertAddressee( inR , false);
2663 ++changedRemote; 2663 ++changedRemote;
2664 } else { // take == 2 take remote ********************** 2664 } else { // take == 2 take remote **********************
2665 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2665 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2666 if ( inR.revision().date().year() < 2004 ) 2666 if ( inR.revision().date().year() < 2004 )
2667 inR.setRevision( modifiedCalendar ); 2667 inR.setRevision( modifiedCalendar );
2668 } 2668 }
2669 idS = inL.IDStr(); 2669 idS = inL.IDStr();
2670 local->removeAddressee( inL ); 2670 local->removeAddressee( inL );
2671 inL = inR; 2671 inL = inR;
2672 inL.setIDStr( idS ); 2672 inL.setIDStr( idS );
2673 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2673 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2674 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 2674 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
2675 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 2675 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
2676 } 2676 }
2677 inL.setResource( 0 ); 2677 inL.setResource( 0 );
2678 local->insertAddressee( inL , false ); 2678 local->insertAddressee( inL , false );
2679 ++changedLocal; 2679 ++changedLocal;
2680 } 2680 }
2681 } 2681 }
2682 } 2682 }
2683 } else { // no conflict ********** add or delete remote 2683 } else { // no conflict ********** add or delete remote
2684 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2684 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2685 QString des = addresseeLSync.note(); 2685 QString des = addresseeLSync.note();
2686 if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 2686 if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
2687 inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 2687 inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE );
2688 remote->insertAddressee( inR, false ); 2688 remote->insertAddressee( inR, false );
2689 ++deletedAddresseeR; 2689 ++deletedAddresseeR;
2690 } else { 2690 } else {
2691 inR.setRevision( modifiedCalendar ); 2691 inR.setRevision( modifiedCalendar );
2692 remote->insertAddressee( inR, false ); 2692 remote->insertAddressee( inR, false );
2693 inL = inR; 2693 inL = inR;
2694 inL.setIDStr( ":" ); 2694 inL.setIDStr( ":" );
2695 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 2695 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
2696 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 2696 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
2697 inL.setResource( 0 ); 2697 inL.setResource( 0 );
2698 local->insertAddressee( inL , false); 2698 local->insertAddressee( inL , false);
2699 ++addedAddressee; 2699 ++addedAddressee;
2700 } 2700 }
2701 } else { 2701 } else {
2702 if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { 2702 if ( inR.revision() > mLastAddressbookSync || mode == 5 ) {
2703 inR.setRevision( modifiedCalendar ); 2703 inR.setRevision( modifiedCalendar );
2704 remote->insertAddressee( inR, false ); 2704 remote->insertAddressee( inR, false );
2705 inR.setResource( 0 ); 2705 inR.setResource( 0 );
2706 local->insertAddressee( inR, false ); 2706 local->insertAddressee( inR, false );
2707 ++addedAddressee; 2707 ++addedAddressee;
2708 } else { 2708 } else {
2709 // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); 2709 // pending checkExternSyncAddressee(addresseeRSyncSharp, inR);
2710 remote->removeAddressee( inR ); 2710 remote->removeAddressee( inR );
2711 ++deletedAddresseeR; 2711 ++deletedAddresseeR;
2712 } 2712 }
2713 } 2713 }
2714 } 2714 }
2715 } 2715 }
2716 ++incCounter; 2716 ++incCounter;
2717 } 2717 }
2718 er.clear(); 2718 er.clear();
2719 QStringList el = local->uidList(); 2719 QStringList el = local->uidList();
2720 modulo = (el.count()/10)+1; 2720 modulo = (el.count()/10)+1;
2721 2721
2722 syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); 2722 syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count());
2723 incCounter = 0; 2723 incCounter = 0;
2724 while ( incCounter < el.count()) { 2724 while ( incCounter < el.count()) {
2725 qApp->processEvents(); 2725 qApp->processEvents();
2726 if (syncManager->isProgressBarCanceled()) 2726 if (syncManager->isProgressBarCanceled())
2727 return false; 2727 return false;
2728 if ( incCounter % modulo == 0 ) 2728 if ( incCounter % modulo == 0 )
2729 syncManager->showProgressBar(incCounter); 2729 syncManager->showProgressBar(incCounter);
2730 uid = el[ incCounter ]; 2730 uid = el[ incCounter ];
2731 bool skipIncidence = false; 2731 bool skipIncidence = false;
2732 if ( uid.left(19) == QString("last-syncAddressee-") ) 2732 if ( uid.left(19) == QString("last-syncAddressee-") )
2733 skipIncidence = true; 2733 skipIncidence = true;
2734 if ( !skipIncidence ) { 2734 if ( !skipIncidence ) {
2735 inL = local->findByUid( uid ); 2735 inL = local->findByUid( uid );
2736 if ( !inL.resource() || inL.resource()->includeInSync() ) { 2736 if ( !inL.resource() || inL.resource()->includeInSync() ) {
2737 inR = remote->findByUid( uid ); 2737 inR = remote->findByUid( uid );
2738 if ( inR.isEmpty() ) { / no conflict ********** add or delete local 2738 if ( inR.isEmpty() ) { // no conflict ********** add or delete local
2739 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2739 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2740 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 2740 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
2741 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 2741 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
2742 local->removeAddressee( inL ); 2742 local->removeAddressee( inL );
2743 ++deletedAddresseeL; 2743 ++deletedAddresseeL;
2744 } else { 2744 } else {
2745 if ( ! syncManager->mWriteBackExistingOnly ) { 2745 if ( ! syncManager->mWriteBackExistingOnly ) {
2746 inL.removeID(mCurrentSyncDevice ); 2746 inL.removeID(mCurrentSyncDevice );
2747 ++addedAddresseeR; 2747 ++addedAddresseeR;
2748 inL.setRevision( modifiedCalendar ); 2748 inL.setRevision( modifiedCalendar );
2749 local->insertAddressee( inL, false ); 2749 local->insertAddressee( inL, false );
2750 inR = inL; 2750 inR = inL;
2751 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); 2751 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL );
2752 inR.setResource( 0 ); 2752 inR.setResource( 0 );
2753 remote->insertAddressee( inR, false ); 2753 remote->insertAddressee( inR, false );
2754 } 2754 }
2755 } 2755 }
2756 } else { 2756 } else {
2757 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { 2757 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) {
2758 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 2758 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
2759 local->removeAddressee( inL ); 2759 local->removeAddressee( inL );
2760 ++deletedAddresseeL; 2760 ++deletedAddresseeL;
2761 } else { 2761 } else {
2762 if ( ! syncManager->mWriteBackExistingOnly ) { 2762 if ( ! syncManager->mWriteBackExistingOnly ) {
2763 ++addedAddresseeR; 2763 ++addedAddresseeR;
2764 inL.setRevision( modifiedCalendar ); 2764 inL.setRevision( modifiedCalendar );
2765 local->insertAddressee( inL, false ); 2765 local->insertAddressee( inL, false );
2766 inR = inL; 2766 inR = inL;
2767 inR.setIDStr( ":" ); 2767 inR.setIDStr( ":" );
2768 inR.setResource( 0 ); 2768 inR.setResource( 0 );
2769 remote->insertAddressee( inR, false ); 2769 remote->insertAddressee( inR, false );
2770 } 2770 }
2771 } 2771 }
2772 } 2772 }
2773 } 2773 }
2774 } 2774 }
2775 } 2775 }
2776 ++incCounter; 2776 ++incCounter;
2777 } 2777 }
2778 el.clear(); 2778 el.clear();
2779 syncManager->hideProgressBar(); 2779 syncManager->hideProgressBar();
2780 mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); 2780 mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 );
2781 // get rid of micro seconds 2781 // get rid of micro seconds
2782 QTime t = mLastAddressbookSync.time(); 2782 QTime t = mLastAddressbookSync.time();
2783 mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 2783 mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) );
2784 addresseeLSync.setRevision( mLastAddressbookSync ); 2784 addresseeLSync.setRevision( mLastAddressbookSync );
2785 addresseeRSync.setRevision( mLastAddressbookSync ); 2785 addresseeRSync.setRevision( mLastAddressbookSync );
2786 addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; 2786 addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ;
2787 addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); 2787 addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName );
2788 addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; 2788 addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ;
2789 addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); 2789 addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") );
2790 addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; 2790 addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ;
2791 addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); 2791 addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() );
2792 addresseeRSync.setNote( "" ) ; 2792 addresseeRSync.setNote( "" ) ;
2793 addresseeLSync.setNote( "" ); 2793 addresseeLSync.setNote( "" );
2794 2794
2795 if ( mGlobalSyncMode == SYNC_MODE_NORMAL) 2795 if ( mGlobalSyncMode == SYNC_MODE_NORMAL)
2796 remote->insertAddressee( addresseeRSync, false ); 2796 remote->insertAddressee( addresseeRSync, false );
2797 local->insertAddressee( addresseeLSync, false ); 2797 local->insertAddressee( addresseeLSync, false );
2798 QString mes; 2798 QString mes;
2799 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); 2799 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR );
2800 qDebug( mes ); 2800 qDebug( mes );
2801 if ( syncManager->mShowSyncSummary ) { 2801 if ( syncManager->mShowSyncSummary ) {
2802 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 2802 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
2803 i18n("KA/Pi Synchronization"),i18n("Write back"))) { 2803 i18n("KA/Pi Synchronization"),i18n("Write back"))) {
2804 qDebug("cancelled "); 2804 qDebug("cancelled ");
2805 return false; 2805 return false;
2806 } 2806 }
2807 } 2807 }
2808 return syncOK; 2808 return syncOK;
2809} 2809}
2810 2810
2811 2811
2812//this is a overwritten callbackmethods from the syncinterface 2812//this is a overwritten callbackmethods from the syncinterface
2813bool KABCore::sync(KSyncManager* manager, QString filename, int mode) 2813bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
2814{ 2814{
2815 2815
2816 //pending prepare addresseeview for output 2816 //pending prepare addresseeview for output
2817 //pending detect, if remote file has REV field. if not switch to external sync 2817 //pending detect, if remote file has REV field. if not switch to external sync
2818 mGlobalSyncMode = SYNC_MODE_NORMAL; 2818 mGlobalSyncMode = SYNC_MODE_NORMAL;
2819 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 2819 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
2820 2820
2821 AddressBook abLocal(filename,"syncContact"); 2821 AddressBook abLocal(filename,"syncContact");
2822 bool syncOK = false; 2822 bool syncOK = false;
2823 if ( abLocal.load() ) { 2823 if ( abLocal.load() ) {
2824 qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); 2824 qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode );
2825 bool external = false; 2825 bool external = false;
2826 bool isXML = false; 2826 bool isXML = false;
2827 if ( filename.right(4) == ".xml") { 2827 if ( filename.right(4) == ".xml") {
2828 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2828 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2829 isXML = true; 2829 isXML = true;
2830 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 2830 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
2831 } else { 2831 } else {
2832 external = !manager->mIsKapiFile; 2832 external = !manager->mIsKapiFile;
2833 if ( external ) { 2833 if ( external ) {
2834 qDebug("Setting vcf mode to external "); 2834 qDebug("Setting vcf mode to external ");
2835 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2835 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2836 AddressBook::Iterator it; 2836 AddressBook::Iterator it;
2837 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 2837 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
2838 (*it).setID( mCurrentSyncDevice, (*it).uid() ); 2838 (*it).setID( mCurrentSyncDevice, (*it).uid() );
2839 (*it).computeCsum( mCurrentSyncDevice ); 2839 (*it).computeCsum( mCurrentSyncDevice );
2840 } 2840 }
2841 } 2841 }
2842 } 2842 }
2843 //AddressBook::Iterator it; 2843 //AddressBook::Iterator it;
2844 //QStringList vcards; 2844 //QStringList vcards;
2845 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 2845 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
2846 // qDebug("Name %s ", (*it).familyName().latin1()); 2846 // qDebug("Name %s ", (*it).familyName().latin1());
2847 //} 2847 //}
2848 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); 2848 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
2849 if ( syncOK ) { 2849 if ( syncOK ) {
2850 if ( syncManager->mWriteBackFile ) 2850 if ( syncManager->mWriteBackFile )
2851 { 2851 {
2852 if ( external ) 2852 if ( external )
2853 abLocal.removeSyncAddressees( !isXML); 2853 abLocal.removeSyncAddressees( !isXML);
2854 qDebug("Saving remote AB "); 2854 qDebug("Saving remote AB ");
2855 if ( ! abLocal.saveAB()) 2855 if ( ! abLocal.saveAB())
2856 qDebug("Error writing back AB to file "); 2856 qDebug("Error writing back AB to file ");
2857 if ( external ) { 2857 if ( external ) {
2858 // afterwrite processing 2858 // afterwrite processing
2859 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); 2859 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML);
2860 } 2860 }
2861 } 2861 }
2862 } 2862 }
2863 setModified(); 2863 setModified();
2864 2864
2865 } 2865 }
2866 if ( syncOK ) 2866 if ( syncOK )
2867 mViewManager->refreshView(); 2867 mViewManager->refreshView();
2868 return syncOK; 2868 return syncOK;
2869 2869
2870} 2870}
2871void KABCore::removeSyncInfo( QString syncProfile) 2871void KABCore::removeSyncInfo( QString syncProfile)
2872{ 2872{
2873 qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1()); 2873 qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1());
2874 mAddressBook->removeSyncInfo( syncProfile ); 2874 mAddressBook->removeSyncInfo( syncProfile );
2875 setModified(); 2875 setModified();
2876} 2876}
2877 2877
2878 2878
2879//this is a overwritten callbackmethods from the syncinterface 2879//this is a overwritten callbackmethods from the syncinterface
2880bool KABCore::syncExternal(KSyncManager* manager, QString resource) 2880bool KABCore::syncExternal(KSyncManager* manager, QString resource)
2881{ 2881{
2882 if ( resource == "phone" ) 2882 if ( resource == "phone" )
2883 return syncPhone(); 2883 return syncPhone();
2884 disableBR( true ); 2884 disableBR( true );
2885 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 2885 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
2886 2886
2887 AddressBook abLocal( resource,"syncContact"); 2887 AddressBook abLocal( resource,"syncContact");
2888 bool syncOK = false; 2888 bool syncOK = false;
2889 if ( abLocal.load() ) { 2889 if ( abLocal.load() ) {
2890 qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); 2890 qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
2891 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2891 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2892 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); 2892 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
2893 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 2893 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
2894 if ( syncOK ) { 2894 if ( syncOK ) {
2895 if ( syncManager->mWriteBackFile ) { 2895 if ( syncManager->mWriteBackFile ) {
2896 abLocal.removeSyncAddressees( false ); 2896 abLocal.removeSyncAddressees( false );
2897 abLocal.saveAB(); 2897 abLocal.saveAB();
2898 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 2898 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
2899 } 2899 }
2900 } else 2900 } else
2901 message( i18n("Sync cancelled or failed.") ); 2901 message( i18n("Sync cancelled or failed.") );
2902 setModified(); 2902 setModified();
2903 } 2903 }
2904 if ( syncOK ) 2904 if ( syncOK )
2905 mViewManager->refreshView(); 2905 mViewManager->refreshView();
2906 disableBR( false ); 2906 disableBR( false );
2907 return syncOK; 2907 return syncOK;
2908 2908
2909} 2909}
2910void KABCore::message( QString m ) 2910void KABCore::message( QString m )
2911{ 2911{
2912 topLevelWidget()->setCaption( m ); 2912 topLevelWidget()->setCaption( m );
2913 mMessageTimer->start( 15000, true ); 2913 mMessageTimer->start( 15000, true );
2914} 2914}
2915bool KABCore::syncPhone() 2915bool KABCore::syncPhone()
2916{ 2916{
2917 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2917 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2918 QString fileName = getPhoneFile(); 2918 QString fileName = getPhoneFile();
2919 if ( !PhoneAccess::readFromPhone( fileName) ) { 2919 if ( !PhoneAccess::readFromPhone( fileName) ) {
2920 message(i18n("Phone access failed!")); 2920 message(i18n("Phone access failed!"));
2921 return false; 2921 return false;
2922 } 2922 }
2923 AddressBook abLocal( fileName,"syncContact"); 2923 AddressBook abLocal( fileName,"syncContact");
2924 bool syncOK = false; 2924 bool syncOK = false;
2925 { 2925 {
2926 abLocal.importFromFile( fileName ); 2926 abLocal.importFromFile( fileName );
2927 qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 2927 qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
2928 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2928 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2929 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 2929 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
2930 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 2930 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );