summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt11
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.cpp4
-rw-r--r--kabc/plugins/sharpdtm/sharpdtmconverter.cpp154
-rw-r--r--kabc/plugins/sharpdtm/sharpdtmconverter.h1
4 files changed, 109 insertions, 61 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 756ccc1..f38dd70 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,528 +1,535 @@
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.
8And PwM/Pi handles now different texts for the
9fields Description, Username, Password, configurable per category.
8 10
9Fixed a crash in KO/Pi , when importing/loading vcs files 11Fixed a crash in KO/Pi , when importing/loading vcs files
10which have an entry with an attendee with state: 12which have an entry with an attendee with state:
11NEEDS ACTION 13NEEDS ACTION
12 14
13Fixed some problems in the German translation of OM/Pi, 15Fixed some problems in the German translation of OM/Pi,
14which makes some dialogs not fitting on the screen 16which makes some dialogs not fitting on the screen
15of the Z 5500. 17of the Z 5500.
16 18
17Fixed Qtopia crash, when disabling/deinstalling 19Fixed Qtopia crash, when disabling/deinstalling
18KO/Pi alarm applet. 20KO/Pi alarm applet.
19 21
20Implemented direct KDE<->KA/Pi sync for KA/Pi running 22Implemented direct KDE<->KA/Pi sync for KA/Pi running
21on Linux desktop. 23on Linux desktop.
22 24
23Added feature "remove sync info" to sync menu. 25Added feature "remove sync info" to sync menu.
24 26
25Tweaked the KO/Pi What's next view a bit, added 27Tweaked the KO/Pi What's next view a bit, added
26setting to hide events that are done. 28setting to hide events that are done.
27 29
28Disabled "beam receive enabled" on startup to 30Disabled "beam receive enabled" on startup to
29avoid problems if Fastload is enabled. 31avoid problems if Fastload is enabled.
30Please set "beam receive enabled", 32Please set "beam receive enabled",
31if you want to receive data via IR. 33if you want to receive data via IR.
32 34
33Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running 35Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running
34on Linux desktop. 36on Linux desktop.
35 37
36Made in KA/Pi scrolling possible, if details view is selected. 38Made in KA/Pi scrolling possible, if details view is selected.
37(The keyboard focus is set automatically to the search line) 39(The keyboard focus is set automatically to the search line)
38 40
39Fixed a bug in DMT sync, that a new entry in DTM was added 41Fixed a bug in DMT sync, that a new entry in DTM was added
40on every sync to Kx/Pi. 42on every sync to Kx/Pi.
41 43
42Fixed a bug in DMT sync with todos created in KO/Pi containing 44Fixed a bug in DMT sync with todos created in KO/Pi containing
43non-latin1 characters. 45non-latin1 characters.
44 46
45Rearranged package contents of Sharp-ipks and made all 47Rearranged package contents of Sharp-ipks and made all
46packages installable on SD again. 48packages installable on SD again.
47 49
48PwM/Pi handles now different texts for the 50Fixed the writing of addressbook data in DTM sync.
49fields Description, Username, Password, configurable per category. 51Empty fields in KA/Pi were not removed.
50 52
53Added better category handling in KA/Pi:
54Menu "change selected has now"
55Set Categories and
56Add Categories option.
57Possible to configure a view to display categories.
51 58
52 59
53********** VERSION 1.9.10 ************ 60********** VERSION 1.9.10 ************
54 61
55Many internal small bugfixes. 62Many internal small bugfixes.
56And fix of the "big" bug in KO/Pi, 63And fix of the "big" bug in KO/Pi,
57that after Syncing the appointments had an offset by several hours. 64that after Syncing the appointments had an offset by several hours.
58That was a problem with the internal timezone setting, 65That was a problem with the internal timezone setting,
59introduced by the changed timezone configuration settings. 66introduced by the changed timezone configuration settings.
60 67
61German translation for OM/Pi is now available. 68German translation for OM/Pi is now available.
62 69
63 70
64********** VERSION 1.9.9 ************ 71********** VERSION 1.9.9 ************
65 72
66KDE-Pim/Pi has a new Member! 73KDE-Pim/Pi has a new Member!
67It is called PWM/Pi (Passwordmanager/platform-independent) 74It is called PWM/Pi (Passwordmanager/platform-independent)
68and it is available for the Zaurus. 75and it is available for the Zaurus.
69It is planned, that it will be available later for Windows. 76It is planned, that it will be available later for Windows.
70(And for Linux, of course). 77(And for Linux, of course).
71It is a port of the Passwordmanager of KDE. 78It is a port of the Passwordmanager of KDE.
72It will need the MicroKDElibs to run. 79It will need the MicroKDElibs to run.
73 80
74Made loading of addressbooks in KA/Pi up to 7 times faster! 81Made loading of addressbooks in KA/Pi up to 7 times faster!
75The bigger your addressbook file, the more starting speed 82The bigger your addressbook file, the more starting speed
76will you gain. (relatively) 83will you gain. (relatively)
77 84
78The Qtopia addressbook connector is now platform independend 85The Qtopia addressbook connector is now platform independend
79as well and should work on any platform for importing/exporting 86as well and should work on any platform for importing/exporting
80Qtopia and Opie XML files. 87Qtopia and Opie XML files.
81 88
82Added a +30min feature to the timezone settings to make 89Added a +30min feature to the timezone settings to make
83KDE-Pim/Pi useable in Australia and other parts on the 90KDE-Pim/Pi useable in Australia and other parts on the
84world with strange timezones ;-) 91world with strange timezones ;-)
85 92
86German "Umlaute" should now be sorted correctly on the Z in KA/Pi. 93German "Umlaute" should now be sorted correctly on the Z in KA/Pi.
87 94
88It is now possible to disable the 95It is now possible to disable the
89"receive data via infrared" feature, such that syncing with 96"receive data via infrared" feature, such that syncing with
90Outlook is now possible again with Kx/Pi runing. 97Outlook is now possible again with Kx/Pi runing.
91Please disable it, before syncing Sharp DTM with Outlook. 98Please disable it, before syncing Sharp DTM with Outlook.
92For your convenience, the "receive data via infrared" feature 99For your convenience, the "receive data via infrared" feature
93is disabled automatically, if you sync Kx/Pi with DTM. 100is disabled automatically, if you sync Kx/Pi with DTM.
94You have to enable it again manually after syncing. 101You have to enable it again manually after syncing.
95Enabling this feature makes it impossible to start the 102Enabling this feature makes it impossible to start the
96Sharp DTM apps. If this feature is enabled, you will only get the 103Sharp DTM apps. If this feature is enabled, you will only get the
97alarm notification from KO/Pi and not from the Sharp calendar. 104alarm notification from KO/Pi and not from the Sharp calendar.
98This is very useful if you sync KO/Pi with Sharp DTM, 105This is very useful if you sync KO/Pi with Sharp DTM,
99because after syncing you usually would get notified about 106because after syncing you usually would get notified about
100an alarm by KO/Pi and the Sharp Calendar. 107an alarm by KO/Pi and the Sharp Calendar.
101 108
102Together with the Linux desktop version of KO/Pi 109Together with the Linux desktop version of KO/Pi
103it is now possible to sync KO/Pi on the Zaurus 110it is now possible to sync KO/Pi on the Zaurus
104with the complete KDE-desktop (3.3 or later) 111with the complete KDE-desktop (3.3 or later)
105calendar data easily. 112calendar data easily.
106That makes it possible to sync the Z with one 113That makes it possible to sync the Z with one
107click of a mouse with the KDE-Desktop. 114click of a mouse with the KDE-Desktop.
108This feature it available for all Zaurus platforms KO/Pi 115This feature it available for all Zaurus platforms KO/Pi
109is running on. 116is running on.
110The only thing needed is a running KO/Pi on Linux and 117The only thing needed is a running KO/Pi on Linux and
111a compiled version of the small 118a compiled version of the small
112KDE-Pim/Pi<->KDE-Desktop access command line program, 119KDE-Pim/Pi<->KDE-Desktop access command line program,
113which is in the KDE-Pim/Pi sources available. 120which is in the KDE-Pim/Pi sources available.
114 121
115The "KDE-desktop" syncing feature for KA/Pi will follow 122The "KDE-desktop" syncing feature for KA/Pi will follow
116in the next releases. 123in the next releases.
117 124
118Fixed the vcard export bug, which had the version 1.9.8. 125Fixed the vcard export bug, which had the version 1.9.8.
119 126
120Added missing GERMAN translation to KO/Pi. 127Added missing GERMAN translation to KO/Pi.
121Hi PsionX, could you add the missing french translation?Thx! 128Hi PsionX, could you add the missing french translation?Thx!
122 129
123Translation files for KA/Pi are available as well. 130Translation files for KA/Pi are available as well.
124GERMAN translation will be available in the next release. 131GERMAN translation will be available in the next release.
125PsionX ( yres, you again ;-) ), could you start translating 132PsionX ( yres, you again ;-) ), could you start translating
126KA/Pi? Thx! 133KA/Pi? Thx!
127 134
128You can download the version 1.9.9 at 135You can download the version 1.9.9 at
129 136
130http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 137http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604
131 138
132Note: 139Note:
133To run the mail program OM/Pi you need libopenssl. 140To run the mail program OM/Pi you need libopenssl.
134A link to a download loaction is available at 141A link to a download loaction is available at
135ZSI at www.killefiz.de 142ZSI at www.killefiz.de
136 143
137 144
138********** VERSION 1.9.8 ************ 145********** VERSION 1.9.8 ************
139 146
140Fixed character decoding in OM/Pi. 147Fixed character decoding in OM/Pi.
141(e.g. German "Umlaute" were not displayed properly.) 148(e.g. German "Umlaute" were not displayed properly.)
142 149
143Made is possible to reparent todos in KO/Pi. 150Made is possible to reparent todos in KO/Pi.
144Use contextmenu or keys (look at Help-Keys + Colors) for that. 151Use contextmenu or keys (look at Help-Keys + Colors) for that.
145 152
146Added the missing Sync-Howto and WhatsNew to the packages. 153Added the missing Sync-Howto and WhatsNew to the packages.
147 154
148KO/Pi on Linux desktop can now sync with KDE desktop. 155KO/Pi on Linux desktop can now sync with KDE desktop.
149That means: When using KO/Pi on Linux desktop for syncing with 156That means: When using KO/Pi on Linux desktop for syncing with
150KDE desktop and the Zaurus, the Zaurus can be synced now 157KDE desktop and the Zaurus, the Zaurus can be synced now
151with all KDE-Calendar resources, not only with one local file. 158with all KDE-Calendar resources, not only with one local file.
152(That makes it possible to sync the Zaurus with the 159(That makes it possible to sync the Zaurus with the
153calendar data on a Kolab server) 160calendar data on a Kolab server)
154 161
155KA/Pi syncing with KDE desktop will be available in the next version. 162KA/Pi syncing with KDE desktop will be available in the next version.
156 163
157 164
158********** VERSION 1.9.7 ************ 165********** VERSION 1.9.7 ************
159 166
160KO/Pi - KA/Pi on Windows: 167KO/Pi - KA/Pi on Windows:
161Now a directory can be defined by the user, where the 168Now a directory can be defined by the user, where the
162application/config data should be saved. 169application/config data should be saved.
163 Define your desired path in the evironment variable 170 Define your desired path in the evironment variable
164 MICROKDEHOME 171 MICROKDEHOME
165 before starting KO/Pi or KA/Pi. 172 before starting KO/Pi or KA/Pi.
166 173
167An easy Kx/Pi to Kx/Pi syncing is now possible 174An easy Kx/Pi to Kx/Pi syncing is now possible
168(it is called Pi-Sync) via network. 175(it is called Pi-Sync) via network.
169Please look at the Sync Howto. 176Please look at the Sync Howto.
170 177
171Exporting of calendar data and contacts to mobile phones is now possible. 178Exporting of calendar data and contacts to mobile phones is now possible.
172The SyncHowto is updated with information howto 179The SyncHowto is updated with information howto
173access/sync mobile phones. 180access/sync mobile phones.
174Please look at the Sync Howto. 181Please look at the Sync Howto.
175 182
176Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. 183Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
177Please disable Fastload for the original contact/calendar applications 184Please disable Fastload for the original contact/calendar applications
178and close them. 185and close them.
179KO/Pi and KA/Pi must be running in order to receive the data. 186KO/Pi and KA/Pi must be running in order to receive the data.
180(KO/Pi and KA/Pi are always running if Fastload for them is enabled!) 187(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
181 188
182In the KA/Pi details view are now the preferred tel. numbers displayed on top 189In the KA/Pi details view are now the preferred tel. numbers displayed on top
183of the other data ( emails/tel.numbers/addresses) 190of the other data ( emails/tel.numbers/addresses)
184 191
185Fixed some syncing problems in KA/Pi. 192Fixed some syncing problems in KA/Pi.
186 193
187Added font settings for the KA/Pi details view. 194Added font settings for the KA/Pi details view.
188Added fields "children's name" and "gender" to KA/Pi. 195Added fields "children's name" and "gender" to KA/Pi.
189 196
190Made searching in KA/Pi better: 197Made searching in KA/Pi better:
191Now the first item in a view is selected after a search automatically and 198Now the first item in a view is selected after a search automatically and
192the views can be scrolled up/down when the search input field has the keyboard focus. 199the views can be scrolled up/down when the search input field has the keyboard focus.
193 200
194And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. 201And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
195 202
196 203
197********** VERSION 1.9.6 ************ 204********** VERSION 1.9.6 ************
198 205
199Changes in the external application communication on the Zaurus 206Changes in the external application communication on the Zaurus
200in order to use less RAM when the apps are running. 207in order to use less RAM when the apps are running.
201First syncing of addressbooks (KA/Pi) is possible. 208First syncing of addressbooks (KA/Pi) is possible.
202 209
203 210
204********** VERSION 1.9.5a ************ 211********** VERSION 1.9.5a ************
205 212
206Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. 213Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5.
207Fixed some small bugs. 214Fixed some small bugs.
208KA/Pi shows now the birthday in summary view. 215KA/Pi shows now the birthday in summary view.
209Now OM/Pi and KA/Pi are using the date format defined in KO/Pi 216Now OM/Pi and KA/Pi are using the date format defined in KO/Pi
210for displaying dates. 217for displaying dates.
211 218
212 219
213********** VERSION 1.9.5 ************ 220********** VERSION 1.9.5 ************
214 221
215There is still no Addressbook syncing! 222There is still no Addressbook syncing!
216 223
217New in 1.9.5: 224New in 1.9.5:
218 225
219Many bugfixes. 226Many bugfixes.
220Better searching in KA/Pi. 227Better searching in KA/Pi.
221You can configure in KA/Pi if you want to search only after 228You can configure in KA/Pi if you want to search only after
222<return> key pressed. 229<return> key pressed.
223 230
224Better mail downloading in OM/Pi. 231Better mail downloading in OM/Pi.
225 232
226First experimental alpha version of sync of KO/Pi with mobile phones. 233First experimental alpha version of sync of KO/Pi with mobile phones.
227See gammu documentation for supported phones. 234See gammu documentation for supported phones.
228You 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. 235You 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.
229Quick hint how to use: 236Quick hint how to use:
230NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! 237NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL!
231Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. 238Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp.
232Create syncprofile - mobile device 239Create syncprofile - mobile device
233Remove entry for model. (Leave empty ). 240Remove entry for model. (Leave empty ).
234Enable infrared on Zaurus and your Phone. 241Enable infrared on Zaurus and your Phone.
235Sync. 242Sync.
236To get a more detailed log, start kopi from konsole. 243To get a more detailed log, start kopi from konsole.
237 244
238********** VERSION 1.9.4 ************ 245********** VERSION 1.9.4 ************
239 246
240This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. 247This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus.
241 248
242WARNING: 249WARNING:
243PLEASE BACKUP ALL YOUR DATA! 250PLEASE BACKUP ALL YOUR DATA!
244We have changed a lot and maybe there are some unknown problems. 251We have changed a lot and maybe there are some unknown problems.
245 252
246SYNC HANDLING HAS CHANGED! 253SYNC HANDLING HAS CHANGED!
247Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 254Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
248(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 255(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
249 256
250You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. 257You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs.
251If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well. 258If you get the error: "Install only possible in main memory", just try it again to install it on SD card. That worked for me. And it was reported that rebooting Qtopia did help in this case as well.
252 259
253As programs are available: 260As programs are available:
254KO/Pi (korganizer ipk) - a calendar program. 261KO/Pi (korganizer ipk) - a calendar program.
255KA/Pi (kaddressbook ipk ) - an addressbook 262KA/Pi (kaddressbook ipk ) - an addressbook
256OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. 263OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support.
257 264
258An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. 265An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode.
259(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) 266(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia)
260 267
261All the applications are installed in a "Pim" TAB. 268All the applications are installed in a "Pim" TAB.
262If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk 269If this TAB is new on your system, you can get an icon in this TAB by installing pim_TAB_icon_1.9.4_arm.ipk
263 270
264All the application are integrated. 271All the application are integrated.
265Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail. 272Such that you can choose in KO/Pi the attendees of a meeting from the addresses in KA/Pi. When you click in KA/Pi on the email address, OM/Pi is started to write the mail.
266 273
267HINT: 274HINT:
268If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. 275If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number.
269 276
270What's new? 277What's new?
271 278
272SYNC HANDLING HAS CHANGED! 279SYNC HANDLING HAS CHANGED!
273Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 280Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
274(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 281(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
275 282
276New in OM/Pi: 283New in OM/Pi:
277When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails. 284When copying(i.e. downloading mails) , you can specify, that only mails of a given size should be downloaded. Added mail copy possibility for selected mails.
278 285
279New in KO/Pi: 286New in KO/Pi:
280French is now available for KO/Pi. 287French is now available for KO/Pi.
281Choose menu:Actions - Configure:TAB locale 288Choose menu:Actions - Configure:TAB locale
282Syncing has changed. 289Syncing has changed.
283Phone sync available soon. 290Phone sync available soon.
284Not much changes, I cannot remember them ... 291Not much changes, I cannot remember them ...
285 292
286New in KA/Pi: 293New in KA/Pi:
287Beaming possible. 294Beaming possible.
288Sharp DTM readonly access possible( create a new DTM resource ); 295Sharp DTM readonly access possible( create a new DTM resource );
289Better searching possible. 296Better searching possible.
290Search is performed only after pressing the return key. 297Search is performed only after pressing the return key.
291Use wildcard * to specify parts of a name. 298Use wildcard * to specify parts of a name.
292 299
293Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * . 300Better name/email selection dialog (called from KO/Pi or OM/Pi). In this dialog, now searching is possible. Like in KA/Pi, use return key and wildcard * .
294 301
295A big improvement is the new management of the contact access. 302A big improvement is the new management of the contact access.
296In version 1.9.3, every application was using their own addressbook access data. 303In version 1.9.3, every application was using their own addressbook access data.
297That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. 304That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi.
298That was wasting of memory, if you had several hundreds of contacts. 305That was wasting of memory, if you had several hundreds of contacts.
299 306
300Now only KA/Pi accesses the addressbook. 307Now only KA/Pi accesses the addressbook.
301If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them. 308If KO/Pi or OM/Pi want to get some name/email data, they request KA/Pi to open the name/email selection dialog and send it back to them.
302If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. 309If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly.
303That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. 310That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first.
304 311
305New in the KO/Pi alarm applet: 312New in the KO/Pi alarm applet:
306Configure your own timer popup menu! 313Configure your own timer popup menu!
307(Text and minutes for timer countdown) 314(Text and minutes for timer countdown)
308Just edit the file 315Just edit the file
309(yourhomedir)/.kopialarmtimerrc 316(yourhomedir)/.kopialarmtimerrc
310and start/stop a timer to get a new menu with the data of this file. 317and start/stop a timer to get a new menu with the data of this file.
311 318
312********** VERSION 1.9.3 ************ 319********** VERSION 1.9.3 ************
3131) 3201)
314Now KO/Pi on Windows imports directly the calendar data of 321Now KO/Pi on Windows imports directly the calendar data of
315an installed Outlook. Should work with OL version >= 2000. 322an installed Outlook. Should work with OL version >= 2000.
316 323
317********** VERSION 1.9.2 ************ 324********** VERSION 1.9.2 ************
3181) 3251)
319KDE-Pim/Pi has got a new member: 326KDE-Pim/Pi has got a new member:
320KmicroMail (KM/Pi) is a mail program, 327KmicroMail (KM/Pi) is a mail program,
321which can handle IMAP and POP mail access. 328which can handle IMAP and POP mail access.
322It is based on Opie-Mail v3. 329It is based on Opie-Mail v3.
323All dependencies to the Opie libraries ar removed, 330All dependencies to the Opie libraries ar removed,
324such that no additional Opie lib is needed. 331such that no additional Opie lib is needed.
325It is already integrated in KO/Pi and KA/Pi. 332It is already integrated in KO/Pi and KA/Pi.
326It it now available for the Zaurus,probably it 333It it now available for the Zaurus,probably it
327will be available for other platforms later. 334will be available for other platforms later.
328Hint: 335Hint:
329Create your own contact (name + email) 336Create your own contact (name + email)
330in KA/Pi, select this contact and choose menu: 337in KA/Pi, select this contact and choose menu:
331Settings - Set Who Am I. 338Settings - Set Who Am I.
332Now the settings of this contact are used as 339Now the settings of this contact are used as
333the sender data in KM/Pi. 340the sender data in KM/Pi.
3342) 3412)
335KDE-Pim/Pi is split up in five different 342KDE-Pim/Pi is split up in five different
336packages now precompiled for Sharp Zaurus: 343packages now precompiled for Sharp Zaurus:
337--kmicrokdelibs_1.9.2_arm.ipk 344--kmicrokdelibs_1.9.2_arm.ipk
338The libs are needed for any 345The libs are needed for any
339of the following programs: 346of the following programs:
340--kaddressbook_1.9.2_arm.ipk 347--kaddressbook_1.9.2_arm.ipk
341--kmicromail_1.9.2_arm.ipk 348--kmicromail_1.9.2_arm.ipk
342--korganizer_1.9.2_arm.ipk 349--korganizer_1.9.2_arm.ipk
343Independ from that, there is the alarm applet 350Independ from that, there is the alarm applet
344available for KO/Pi, which also offers 351available for KO/Pi, which also offers
345quick access for a new mail or 352quick access for a new mail or
346showing the addressbook.: 353showing the addressbook.:
347--korganizer-alarm_1.9.2_arm.ipk 354--korganizer-alarm_1.9.2_arm.ipk
348Independend means, that the alarm applet 355Independend means, that the alarm applet
349does not need any of the libs or programs above to run. 356does not need any of the libs or programs above to run.
350But it would be quite useless without these programs. 357But it would be quite useless without these programs.
351NOTE: 358NOTE:
352If you get a 359If you get a
353"This application depends on other programs" 360"This application depends on other programs"
354during installation of 361during installation of
355--kmicrokdelibs_1.9.2_arm.ipk 362--kmicrokdelibs_1.9.2_arm.ipk
356you probably do not have to care about that. 363you probably do not have to care about that.
357kmicrokdelibs_1.9.2 will come with some 364kmicrokdelibs_1.9.2 will come with some
358resource plugins, which needs additional libraries. 365resource plugins, which needs additional libraries.
359(E.g. libopie1, if you want to use the 366(E.g. libopie1, if you want to use the
360opie resource connector in KA/Pi). 367opie resource connector in KA/Pi).
361If you do not have this libraries installed, 368If you do not have this libraries installed,
362you simply cannot use the resource. 369you simply cannot use the resource.
363To make it clear: 370To make it clear:
364If the libraries are missing, the applications 371If the libraries are missing, the applications
365using kmicrokdelibs will start, 372using kmicrokdelibs will start,
366because the resources are plugins. 373because the resources are plugins.
3673) 3743)
368KO/Pi and friends are now installable on SD-Card! 375KO/Pi and friends are now installable on SD-Card!
369It is recommended to install all libs and apps 376It is recommended to install all libs and apps
370on the SD card or all in the internal storage. 377on the SD card or all in the internal storage.
371There may be problems, if this is mixed. 378There may be problems, if this is mixed.
3724) 3794)
373Fixed two bugs in the alarm notification on Windows. 380Fixed two bugs in the alarm notification on Windows.
3745) 3815)
375Great improvement! 382Great improvement!
376KO/Pi uses now the latest version of libical. 383KO/Pi uses now the latest version of libical.
377Libical is the library which actually reads 384Libical is the library which actually reads
378the calendar files and extract the data from it. 385the calendar files and extract the data from it.
379With the old version, there were problems 386With the old version, there were problems
380(crashes or program hangs) when licical did read 387(crashes or program hangs) when licical did read
381files, which were not stored from KO/Pi. 388files, which were not stored from KO/Pi.
382I do not know, if the new libical works perfect, 389I do not know, if the new libical works perfect,
383but actually it works much better than 390but actually it works much better than
384the old version. 391the old version.
385There are no problems with compatibility with 392There are no problems with compatibility with
386old calendar files of KO/Pi, of course! 393old calendar files of KO/Pi, of course!
3876) 3946)
388New in KA/Pi: 395New in KA/Pi:
389Opie addressbook resource connector available! 396Opie addressbook resource connector available!
390You will need libopie1 and the opie addressbook, 397You will need libopie1 and the opie addressbook,
391of course. 398of course.
392With the Opie addressbook resource connector, 399With the Opie addressbook resource connector,
393you can access the Opie addressbook readonly in KA/Pi. 400you can access the Opie addressbook readonly in KA/Pi.
394If you want to edit or import the data into KA/Pi, 401If you want to edit or import the data into KA/Pi,
395do this: 402do this:
396a) Create an Opie resource. 403a) Create an Opie resource.
397 (Menu: Settings-Configure Resources). 404 (Menu: Settings-Configure Resources).
398After configuration and restarting KA/Pi you should see 405After configuration and restarting KA/Pi you should see
399the Opie contacts in KA/Pi. 406the Opie contacts in KA/Pi.
400b) Select some or all Opie contacts. 407b) Select some or all Opie contacts.
401(NOTE: +++++ 408(NOTE: +++++
402To know exactly, what contacts are Opie contacts, 409To know exactly, what contacts are Opie contacts,
403do this: Choose menu: 410do this: Choose menu:
404View-Modify View - TAB Fields. 411View-Modify View - TAB Fields.
405Select in the above list "Resource" and click 412Select in the above list "Resource" and click
406down arrow to add it to the "Selected fields". 413down arrow to add it to the "Selected fields".
407Click OK. 414Click OK.
408Now you have a new column "Resource" in your list, 415Now you have a new column "Resource" in your list,
409where you can see, what an Opie resource is. 416where you can see, what an Opie resource is.
410++++ NOTE end.) 417++++ NOTE end.)
411Ok, we do have now some Opie contacts seleted. 418Ok, we do have now some Opie contacts seleted.
412(Use SHIFT or CTRL key in order to multiple select). 419(Use SHIFT or CTRL key in order to multiple select).
413c) Choose menu: Edit-Copy. 420c) Choose menu: Edit-Copy.
414d) Choose menu: Edit-Paste. 421d) Choose menu: Edit-Paste.
415e) Select the resource, you want to add the contacts to. 422e) Select the resource, you want to add the contacts to.
416Congrats! Now you have read/write access to the copied 423Congrats! Now you have read/write access to the copied
417opie contacts as "real" KA/Pi contacts. 424opie contacts as "real" KA/Pi contacts.
418 425
419 426
420********** VERSION 1.9.1 ************ 427********** VERSION 1.9.1 ************
4211) 4281)
422 +++ IMPORTANT 1 +++ 429 +++ IMPORTANT 1 +++
423 430
424The storing place of the default calendar 431The storing place of the default calendar
425file has changed! 432file has changed!
426The default calendar file was 433The default calendar file was
427Applications/korganizer/mycalendar.ics 434Applications/korganizer/mycalendar.ics
428on Zaurus and 435on Zaurus and
429(yourHomeDir)/korganizer/mycalendar.ics 436(yourHomeDir)/korganizer/mycalendar.ics
430on Windows/Linux desktop. Now it is 437on Windows/Linux desktop. Now it is
431(yourHomeDir)/kdepim/korganizer/mycalendar.ics 438(yourHomeDir)/kdepim/korganizer/mycalendar.ics
432on Zaurus, Windows and Linux. 439on Zaurus, Windows and Linux.
433To load the old file, choose menu 440To load the old file, choose menu
434File-Load calendar backup. 441File-Load calendar backup.
435(It should be loaded automatically 442(It should be loaded automatically
436at startup with a warning message displayed). 443at startup with a warning message displayed).
437The place of the configuration file has changed too. 444The place of the configuration file has changed too.
438If you want to use your old KO/Pi config, 445If you want to use your old KO/Pi config,
439copy it to 446copy it to
440(yourHomeDir)/kdepim/config/korganizerrc 447(yourHomeDir)/kdepim/config/korganizerrc
441Please read VERSION 1.9.0 - topic 3) as well! 448Please read VERSION 1.9.0 - topic 3) as well!
442 449
443 +++ IMPORTANT 2 +++ 450 +++ IMPORTANT 2 +++
444 451
445Because of the new paths, you will need 452Because of the new paths, you will need
446a new version of the KO/Pi alarm applet 453a new version of the KO/Pi alarm applet
447for Zaurus. 454for Zaurus.
448Use version >= 1.9.1 455Use version >= 1.9.1
449 456
4502) 4572)
451Now the QWhat'sThis Icon works for items 458Now the QWhat'sThis Icon works for items
452in the month view as well. 459in the month view as well.
453(See VERSION 1.7.8 Topic 1) ). 460(See VERSION 1.7.8 Topic 1) ).
4543) 4613)
455You can import birtsdays/anniversaries 462You can import birtsdays/anniversaries
456from KA/Pi into KO/Pi. 463from KA/Pi into KO/Pi.
457Choose menu File-Import birthdays. 464Choose menu File-Import birthdays.
458If you import twice, already imported items 465If you import twice, already imported items
459will not be imported again, if they 466will not be imported again, if they
460have not been changed in KO/Pi. 467have not been changed in KO/Pi.
4614) 4684)
462When syncing with sharp DTM, now a progress 469When syncing with sharp DTM, now a progress
463is shown, when the data is written back. 470is shown, when the data is written back.
464If there is much data in KO/Pi and no data 471If there is much data in KO/Pi and no data
465in DTM, that can take a long time. 472in DTM, that can take a long time.
466(But only for the first time ). 473(But only for the first time ).
4675) 4745)
468In the search dialog, you can search 475In the search dialog, you can search
469now for the name/email of an attendee 476now for the name/email of an attendee
470of an event/todo. 477of an event/todo.
471To get more space for displaying 478To get more space for displaying
472search results, the buttons 479search results, the buttons
473for "search" and "close" on the 480for "search" and "close" on the
474bottom are removed in the PDA version. 481bottom are removed in the PDA version.
475You have to click OK in the top right 482You have to click OK in the top right
476corner to do a search. 483corner to do a search.
4776) 4846)
478Now it is possible to disable the displaying 485Now it is possible to disable the displaying
479of todo items in the Allday part of the Agenda. 486of todo items in the Allday part of the Agenda.
480Choose Menu Action-Configure, 487Choose Menu Action-Configure,
481TAB Todo View, checkbox 488TAB Todo View, checkbox
482"Allday Agenda view shows todos" 489"Allday Agenda view shows todos"
4837) 4907)
484If FastLoad is enabled, now the settings and the 491If FastLoad is enabled, now the settings and the
485calendar data are saved, when KO/Pi is closed. 492calendar data are saved, when KO/Pi is closed.
486(If no Fastload is enabled, KO/Pi saves 493(If no Fastload is enabled, KO/Pi saves
487the data as well, of course) 494the data as well, of course)
4888) 4958)
489The Agenda View has a minimize-splitter now, 496The Agenda View has a minimize-splitter now,
490such that the height of the allday part can be 497such that the height of the allday part can be
491changed quickly. 498changed quickly.
492 499
493********** VERSION 1.9.0 ************ 500********** VERSION 1.9.0 ************
4941) 5011)
495KO/Pi is now merged with the new microKDE from KA/Pi. 502KO/Pi is now merged with the new microKDE from KA/Pi.
496KO/Pi accesses now KA/Pi as the addressbook. 503KO/Pi accesses now KA/Pi as the addressbook.
497The other ddressbook-plugins are not working any longer. 504The other ddressbook-plugins are not working any longer.
498(It is planned, that later KA/Pi itself uses these plugins) 505(It is planned, that later KA/Pi itself uses these plugins)
499New versions of KO/Pi are only available 506New versions of KO/Pi are only available
500together with KA/Pi as the KDE-Pim/Pi package. 507together with KA/Pi as the KDE-Pim/Pi package.
5012) 5082)
502If you click on an attendee of a meeting in the 509If you click on an attendee of a meeting in the
503event viewer, a detailed summary of the 510event viewer, a detailed summary of the
504attendee is shown. 511attendee is shown.
5053) 5123)
506The place of the configuration file has changed. 513The place of the configuration file has changed.
507If you want to use your old KO/Pi config, copy 514If you want to use your old KO/Pi config, copy
508Applications/korganizer/config_korganizerrc 515Applications/korganizer/config_korganizerrc
509to 516to
510Applications/korganizer/config/korganizerrc 517Applications/korganizer/config/korganizerrc
511 518
512********** VERSION 1.7.8 ************ 519********** VERSION 1.7.8 ************
5131) 5201)
514Now the QWhat'sThis ist working. 521Now the QWhat'sThis ist working.
515Enable the QWhat'sThis icon in the toolbar. 522Enable the QWhat'sThis icon in the toolbar.
516(You have to restart to reload the changed toolbar config). 523(You have to restart to reload the changed toolbar config).
517Now click on the QWhat'sThis Icon 524Now click on the QWhat'sThis Icon
518in the top right corner of KO/Pi. 525in the top right corner of KO/Pi.
519Then click on an item in the Agenda View: 526Then click on an item in the Agenda View:
520You will get a detailed display of the items content. 527You will get a detailed display of the items content.
5212) 5282)
522Some other very minor changes. 529Some other very minor changes.
523But I have forgotten the details ... 530But I have forgotten the details ...
524For that reason I start this log here: 531For that reason I start this log here:
525To document my changes, when I am doing it. 532To document my changes, when I am doing it.
526 533
527********** VERSION 1.7.7 ************ 534********** VERSION 1.7.7 ************
528Stable Version of KO/Pi 535Stable Version of KO/Pi
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
index 7069f5d..6413b42 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
@@ -1,301 +1,303 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <unistd.h> 30#include <unistd.h>
31 31
32#include <qdir.h> 32#include <qdir.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qfileinfo.h> 34#include <qfileinfo.h>
35#include <qregexp.h> 35#include <qregexp.h>
36//US #include <qtimer.h> 36//US #include <qtimer.h>
37 37
38#include <kapplication.h> 38#include <kapplication.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <kdebug.h> 40#include <kdebug.h>
41#include <klocale.h> 41#include <klocale.h>
42//US #include <ksavefile.h> 42//US #include <ksavefile.h>
43#include <kstandarddirs.h> 43#include <kstandarddirs.h>
44#include <kmessagebox.h> 44#include <kmessagebox.h>
45 45
46#include <sl/slzdb.h> 46#include <sl/slzdb.h>
47 47
48#include <libkdepim/ksyncprofile.h> 48#include <libkdepim/ksyncprofile.h>
49 49
50#include "resourcesharpdtmconfig.h" 50#include "resourcesharpdtmconfig.h"
51#include "resourcesharpdtm.h" 51#include "resourcesharpdtm.h"
52 52
53#include "stdaddressbook.h" 53#include "stdaddressbook.h"
54 54
55#include "sharpdtmconverter.h" 55#include "sharpdtmconverter.h"
56//#define ALLOW_LOCKING 56//#define ALLOW_LOCKING
57using namespace KABC; 57using namespace KABC;
58extern "C" 58extern "C"
59{ 59{
60 void *init_microkabc_sharpdtm() 60 void *init_microkabc_sharpdtm()
61 { 61 {
62 return new KRES::PluginFactory<ResourceSharpDTM,ResourceSharpDTMConfig>(); 62 return new KRES::PluginFactory<ResourceSharpDTM,ResourceSharpDTMConfig>();
63 } 63 }
64} 64}
65 65
66ResourceSharpDTM::ResourceSharpDTM( const KConfig *config ) 66ResourceSharpDTM::ResourceSharpDTM( const KConfig *config )
67 : Resource( config ), mConverter (0) 67 : Resource( config ), mConverter (0)
68{ 68{
69 // we can not choose the filename. Therefore use the default to display 69 // we can not choose the filename. Therefore use the default to display
70 mAccess = 0; 70 mAccess = 0;
71 QString fileName = SlZDataBase::addressbookFileName(); 71 QString fileName = SlZDataBase::addressbookFileName();
72 init( fileName ); 72 init( fileName );
73} 73}
74 74
75ResourceSharpDTM::ResourceSharpDTM( const QString &fileName ) 75ResourceSharpDTM::ResourceSharpDTM( const QString &fileName )
76 : Resource( 0 ) 76 : Resource( 0 )
77{ 77{
78 mAccess = 0; 78 mAccess = 0;
79 init( fileName ); 79 init( fileName );
80} 80}
81 81
82void ResourceSharpDTM::init( const QString &fileName ) 82void ResourceSharpDTM::init( const QString &fileName )
83{ 83{
84 if (mConverter == 0) { 84 if (mConverter == 0) {
85 mConverter = new SharpDTMConverter(); 85 mConverter = new SharpDTMConverter();
86 bool res = mConverter->init(); 86 bool res = mConverter->init();
87 if ( !res ) 87 if ( !res )
88 { 88 {
89 QString msg("Unable to initialize sharp converter. Most likely a problem with the category file"); 89 QString msg("Unable to initialize sharp converter. Most likely a problem with the category file");
90 qDebug(msg); 90 qDebug(msg);
91 return; 91 return;
92 } 92 }
93 } 93 }
94 setFileName( fileName ); 94 setFileName( fileName );
95} 95}
96 96
97ResourceSharpDTM::~ResourceSharpDTM() 97ResourceSharpDTM::~ResourceSharpDTM()
98{ 98{
99 if (mConverter != 0) 99 if (mConverter != 0)
100 delete mConverter; 100 delete mConverter;
101 101
102 if(mAccess != 0) 102 if(mAccess != 0)
103 delete mAccess; 103 delete mAccess;
104} 104}
105 105
106void ResourceSharpDTM::writeConfig( KConfig *config ) 106void ResourceSharpDTM::writeConfig( KConfig *config )
107{ 107{
108 Resource::writeConfig( config ); 108 Resource::writeConfig( config );
109} 109}
110 110
111Ticket *ResourceSharpDTM::requestSaveTicket() 111Ticket *ResourceSharpDTM::requestSaveTicket()
112{ 112{
113 113
114 qDebug("ResourceSharpDTM::requestSaveTicket: %s", fileName().latin1()); 114 qDebug("ResourceSharpDTM::requestSaveTicket: %s", fileName().latin1());
115 115
116 if ( !addressBook() ) return 0; 116 if ( !addressBook() ) return 0;
117 return createTicket( this ); 117 return createTicket( this );
118} 118}
119 119
120 120
121bool ResourceSharpDTM::doOpen() 121bool ResourceSharpDTM::doOpen()
122{ 122{
123 if (!mConverter) 123 if (!mConverter)
124 return false; 124 return false;
125 return true; 125 return true;
126} 126}
127 127
128void ResourceSharpDTM::doClose() 128void ResourceSharpDTM::doClose()
129{ 129{
130 return; 130 return;
131} 131}
132 132
133bool ResourceSharpDTM::load() 133bool ResourceSharpDTM::load()
134{ 134{
135 if (!mConverter) 135 if (!mConverter)
136 return false; 136 return false;
137 QString fileN = SlZDataBase::addressbookFileName(); 137 QString fileN = SlZDataBase::addressbookFileName();
138 if ( ! mAccess ) { 138 if ( ! mAccess ) {
139 mAccess = new SlZDataBase(fileN, 139 mAccess = new SlZDataBase(fileN,
140 SlZDataBase::addressbookItems(), 140 SlZDataBase::addressbookItems(),
141 0, false); 141 0, false);
142 } 142 }
143 if(mAccess == 0) 143 if(mAccess == 0)
144 return false; 144 return false;
145 145
146 qDebug("%xResourceSharpDTM::load: %s",this, fileName().latin1()); 146 qDebug("%xResourceSharpDTM::load: %s",this, fileName().latin1());
147 bool res = false; 147 bool res = false;
148 CardId id; 148 CardId id;
149 for (bool res=mAccess->first(); res == true; res=mAccess->next()) 149 for (bool res=mAccess->first(); res == true; res=mAccess->next())
150 { 150 {
151 id = mAccess->cardId(); 151 id = mAccess->cardId();
152 KABC::Addressee addressee; 152 KABC::Addressee addressee;
153 res = mConverter->sharpToAddressee( id, mAccess, addressee ); 153 res = mConverter->sharpToAddressee( id, mAccess, addressee );
154 if ( !addressee.isEmpty() && res ) 154 if ( !addressee.isEmpty() && res )
155 { 155 {
156 addressee.setResource( this ); 156 addressee.setResource( this );
157 addressBook()->insertAddressee( addressee ); 157 addressBook()->insertAddressee( addressee );
158 } 158 }
159 } 159 }
160 if(mAccess != 0) 160 if(mAccess != 0)
161 delete mAccess; 161 delete mAccess;
162 mAccess = 0; 162 mAccess = 0;
163 163
164 return true; 164 return true;
165} 165}
166 166
167bool ResourceSharpDTM::save( Ticket *ticket ) 167bool ResourceSharpDTM::save( Ticket *ticket )
168{ 168{
169 if (!mConverter) 169 if (!mConverter)
170 return false; 170 return false;
171 QString fileN = SlZDataBase::addressbookFileName(); 171 QString fileN = SlZDataBase::addressbookFileName();
172 if ( ! mAccess ) { 172 if ( ! mAccess ) {
173 mAccess = new SlZDataBase(fileN, 173 mAccess = new SlZDataBase(fileN,
174 SlZDataBase::addressbookItems(), 174 SlZDataBase::addressbookItems(),
175 0, false); 175 0, false);
176 } 176 }
177 if(mAccess == 0) 177 if(mAccess == 0)
178 return false; 178 return false;
179 qDebug("ResourceSharpDTM::save: %s", fileName().latin1()); 179 qDebug("ResourceSharpDTM::save: %s", fileName().latin1());
180 KABC::AddressBook::Iterator it; 180 KABC::AddressBook::Iterator it;
181 bool res; 181 bool res;
182 KABC::Addressee::List changedAddressees; 182 KABC::Addressee::List changedAddressees;
183 typedef QMap<int,QString> AddresseeMap; 183 typedef QMap<int,QString> AddresseeMap;
184 AddresseeMap map; 184 AddresseeMap map;
185 CardId id ; 185 CardId id ;
186 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { 186 for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
187 187
188 if ( (*it).tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { 188 if ( (*it).tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) {
189 QString uid = (*it).originalExternalUID(); 189 QString uid = (*it).originalExternalUID();
190 bool res; 190 bool res;
191 if ( uid.isEmpty() ) 191 if ( uid.isEmpty() )
192 id = 0; 192 id = 0;
193 else 193 else
194 id = uid.toUInt(); 194 id = uid.toUInt();
195 KABC::Addressee addressee = (*it); 195 KABC::Addressee addressee = (*it);
196 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL ) { 196 if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL ) {
197 res = mAccess->startEditCard(id); 197 res = mAccess->startEditCard(id);
198 if (res == true) 198 if (res == true)
199 { 199 {
200 res = mConverter->addresseeToSharp( (*it), mAccess, id ); 200 res = mConverter->addresseeToSharp( (*it), mAccess, id );
201 if (res == true) 201 if (res == true)
202 { 202 {
203 res = mAccess->finishEditCard(&id);; 203 res = mAccess->finishEditCard(&id);;
204 mConverter->setCategories( (*it), mAccess, id );
204 map.insert(id,(*it).uid()); 205 map.insert(id,(*it).uid());
205 if (res == false) 206 if (res == false)
206 qDebug("Unable to append Contact: %s", addressee.formattedName().latin1()); 207 qDebug("Unable to append Contact: %s", addressee.formattedName().latin1());
207 208
208 } 209 }
209 else 210 else
210 { 211 {
211 qDebug("Unable to convert Addressee: %s", addressee.formattedName().latin1()); 212 qDebug("Unable to convert Addressee: %s", addressee.formattedName().latin1());
212 mAccess->cancelEditCard(); 213 mAccess->cancelEditCard();
213 } 214 }
214 } 215 }
215 216
216 } else if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { 217 } else if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_DELETE ) {
217 res = mAccess->deleteCard(&id); 218 res = mAccess->deleteCard(&id);
218 if ( !res ) 219 if ( !res )
219 qDebug("delete error "); 220 qDebug("delete error ");
220 221
221 222
222 } else if ( (*it).tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { 223 } else if ( (*it).tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) {
223 //changed 224 //changed
224 res = mAccess->startEditCard(id); 225 res = mAccess->startEditCard(id);
225 if (res == true) 226 if (res == true)
226 { 227 {
227 res = mConverter->addresseeToSharp( (*it), mAccess, id ); 228 res = mConverter->addresseeToSharp( (*it), mAccess, id );
228 if (res == true) 229 if (res == true)
229 { 230 {
230 res = mAccess->finishEditCard(&id); 231 res = mAccess->finishEditCard(&id);
232 mConverter->setCategories( (*it), mAccess, id );
231 map.insert(id,(*it).uid()); 233 map.insert(id,(*it).uid());
232 if (res == false) 234 if (res == false)
233 qDebug("Unable to append Contact: %s", addressee.formattedName().latin1()); 235 qDebug("Unable to append Contact: %s", addressee.formattedName().latin1());
234 } 236 }
235 else 237 else
236 { 238 {
237 qDebug("Unable to convert Addressee: %s", addressee.formattedName().latin1()); 239 qDebug("Unable to convert Addressee: %s", addressee.formattedName().latin1());
238 mAccess->cancelEditCard(); 240 mAccess->cancelEditCard();
239 } 241 }
240 } 242 }
241 } 243 }
242 } 244 }
243 245
244 } 246 }
245 AddresseeMap::Iterator itam; 247 AddresseeMap::Iterator itam;
246 for ( res=mAccess->first(); res == true; res=mAccess->next()) 248 for ( res=mAccess->first(); res == true; res=mAccess->next())
247 { 249 {
248 id = mAccess->cardId(); 250 id = mAccess->cardId();
249 int idint = id; 251 int idint = id;
250 itam = map.find( idint ); 252 itam = map.find( idint );
251 if ( itam != map.end() ) { 253 if ( itam != map.end() ) {
252 KABC::Addressee addressee; 254 KABC::Addressee addressee;
253 res = mConverter->sharpToAddressee( id, mAccess, addressee ); 255 res = mConverter->sharpToAddressee( id, mAccess, addressee );
254 256
255 if ( !addressee.isEmpty() && res ) 257 if ( !addressee.isEmpty() && res )
256 { 258 {
257 addressee.setResource( this ); 259 addressee.setResource( this );
258 addressee.setUid( itam.data() ); 260 addressee.setUid( itam.data() );
259 addressee.setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); 261 addressee.setTempSyncStat( SYNC_TEMPSTATE_NEW_ID );
260 addressBook()->insertAddressee( addressee , false ); 262 addressBook()->insertAddressee( addressee , false );
261 } 263 }
262 } 264 }
263 } 265 }
264 delete ticket; 266 delete ticket;
265 if(mAccess != 0) 267 if(mAccess != 0)
266 delete mAccess; 268 delete mAccess;
267 mAccess = 0; 269 mAccess = 0;
268 return true; 270 return true;
269} 271}
270 272
271bool ResourceSharpDTM::lock( const QString &lockfileName ) 273bool ResourceSharpDTM::lock( const QString &lockfileName )
272{ 274{
273 return true; 275 return true;
274} 276}
275 277
276void ResourceSharpDTM::unlock( const QString &fileName ) 278void ResourceSharpDTM::unlock( const QString &fileName )
277{ 279{
278 280
279} 281}
280 282
281void ResourceSharpDTM::setFileName( const QString &newFileName ) 283void ResourceSharpDTM::setFileName( const QString &newFileName )
282{ 284{
283 Resource::setFileName( newFileName ); 285 Resource::setFileName( newFileName );
284} 286}
285 287
286void ResourceSharpDTM::fileChanged() 288void ResourceSharpDTM::fileChanged()
287{ 289{
288 290
289} 291}
290 292
291void ResourceSharpDTM::removeAddressee( const Addressee &addr ) 293void ResourceSharpDTM::removeAddressee( const Addressee &addr )
292{ 294{
293} 295}
294 296
295void ResourceSharpDTM::cleanUp() 297void ResourceSharpDTM::cleanUp()
296{ 298{
297 299
298} 300}
299 301
300 302
301 303
diff --git a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
index 396be0a..ae4cfbb 100644
--- a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
+++ b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp
@@ -1,444 +1,482 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include "kglobal.h" 28#include "kglobal.h"
29#include <qregexp.h> 29#include <qregexp.h>
30 30
31 31
32#include "sharpdtmconverter.h" 32#include "sharpdtmconverter.h"
33 33
34#include <sl/slcategories.h> 34#include <sl/slcategories.h>
35#include <libkdepim/ksyncprofile.h> 35#include <libkdepim/ksyncprofile.h>
36//US #include <qpe/categoryselect.h> 36//US #include <qpe/categoryselect.h>
37 37
38 38
39using namespace KABC; 39using namespace KABC;
40using namespace SlCategory; 40using namespace SlCategory;
41 41
42SharpDTMConverter::SharpDTMConverter() : catDB(0) 42SharpDTMConverter::SharpDTMConverter() : catDB(0)
43{ 43{
44} 44}
45 45
46SharpDTMConverter::~SharpDTMConverter() 46SharpDTMConverter::~SharpDTMConverter()
47{ 47{
48 deinit(); 48 deinit();
49} 49}
50 50
51bool SharpDTMConverter::init() 51bool SharpDTMConverter::init()
52{ 52{
53 catDB = new SlCategory::SlCategories(); 53 catDB = new SlCategory::SlCategories();
54 54
55 if (!catDB) 55 if (!catDB)
56 return false; 56 return false;
57 57
58// catDB->load( categoryFileName() ); 58// catDB->load( categoryFileName() );
59 return true; 59 return true;
60} 60}
61 61
62void SharpDTMConverter::deinit() 62void SharpDTMConverter::deinit()
63{ 63{
64 if (catDB) 64 if (catDB)
65 { 65 {
66 delete catDB; 66 delete catDB;
67 catDB = 0; 67 catDB = 0;
68 } 68 }
69} 69}
70 70
71bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr ) 71bool SharpDTMConverter::sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr )
72{ 72{
73 SlZDataBase* db = (SlZDataBase*)database; 73 SlZDataBase* db = (SlZDataBase*)database;
74 74
75 // for syncing: we need setting of the two fields 75 // for syncing: we need setting of the two fields
76 addr.setExternalUID( QString::number( contact ) ); 76 addr.setExternalUID( QString::number( contact ) );
77 addr.setOriginalExternalUID( QString::number( contact ) ); 77 addr.setOriginalExternalUID( QString::number( contact ) );
78 addr.setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); 78 addr.setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL );
79 79
80 80
81 // name 81 // name
82 //qDebug("SharpDTMConverter::sharpToAddressee check if the fileAs transformation works!!"); 82 //qDebug("SharpDTMConverter::sharpToAddressee check if the fileAs transformation works!!");
83 addr.setFormattedName(db->readField(ZdbAdrs::FileAs)); // needs fix 83 addr.setFormattedName(db->readField(ZdbAdrs::FileAs)); // needs fix
84 84
85 addr.setFamilyName( db->readField(ZdbAdrs::LastName) ); 85 addr.setFamilyName( db->readField(ZdbAdrs::LastName) );
86 addr.setGivenName( db->readField(ZdbAdrs::FirstName) ); 86 addr.setGivenName( db->readField(ZdbAdrs::FirstName) );
87 addr.setAdditionalName( db->readField(ZdbAdrs::MiddleName) ); 87 addr.setAdditionalName( db->readField(ZdbAdrs::MiddleName) );
88 addr.setPrefix( db->readField(ZdbAdrs::Title) ); 88 addr.setPrefix( db->readField(ZdbAdrs::Title) );
89 addr.setSuffix( db->readField(ZdbAdrs::Suffix) ); 89 addr.setSuffix( db->readField(ZdbAdrs::Suffix) );
90 90
91 91
92 QString emailstr = db->readField(ZdbAdrs::Emails); 92 QString emailstr = db->readField(ZdbAdrs::Emails);
93 emailstr.replace( QRegExp(","), " " ); 93 emailstr.replace( QRegExp(","), " " );
94 emailstr.replace( QRegExp(";"), " " ); 94 emailstr.replace( QRegExp(";"), " " );
95 emailstr.replace( QRegExp(":"), " " ); 95 emailstr.replace( QRegExp(":"), " " );
96 //qDebug("SharpDTMConverter::sharpToAddressee whats the character to seperate the emailadresses? %s ", emailstr.latin1()); 96 //qDebug("SharpDTMConverter::sharpToAddressee whats the character to seperate the emailadresses? %s ", emailstr.latin1());
97 QStringList emails = QStringList::split(" ", emailstr.simplifyWhiteSpace()); 97 QStringList emails = QStringList::split(" ", emailstr.simplifyWhiteSpace());
98 bool defE = false; 98 bool defE = false;
99 bool found = false; 99 bool found = false;
100 for ( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) { 100 for ( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) {
101 if (found ) 101 if (found )
102 defE = false; 102 defE = false;
103 else 103 else
104 found = defE = ((*it).lower() == db->readField(ZdbAdrs::DefaultEmail).lower()); 104 found = defE = ((*it).lower() == db->readField(ZdbAdrs::DefaultEmail).lower());
105 addr.insertEmail( *it, defE ); 105 addr.insertEmail( *it, defE );
106 } 106 }
107 if ( ! found ) 107 if ( ! found )
108 if (!db->readField(ZdbAdrs::DefaultEmail).isEmpty()) 108 if (!db->readField(ZdbAdrs::DefaultEmail).isEmpty())
109 addr.insertEmail(db->readField(ZdbAdrs::DefaultEmail), true); 109 addr.insertEmail(db->readField(ZdbAdrs::DefaultEmail), true);
110 110
111 // home 111 // home
112 if ((!db->readField(ZdbAdrs::HomeStreet).isEmpty()) || 112 if ((!db->readField(ZdbAdrs::HomeStreet).isEmpty()) ||
113 (!db->readField(ZdbAdrs::HomeCity).isEmpty()) || 113 (!db->readField(ZdbAdrs::HomeCity).isEmpty()) ||
114 (!db->readField(ZdbAdrs::HomeState).isEmpty()) || 114 (!db->readField(ZdbAdrs::HomeState).isEmpty()) ||
115 (!db->readField(ZdbAdrs::HomeZip).isEmpty()) || 115 (!db->readField(ZdbAdrs::HomeZip).isEmpty()) ||
116 (!db->readField(ZdbAdrs::HomeCountry).isEmpty())) 116 (!db->readField(ZdbAdrs::HomeCountry).isEmpty()))
117 { 117 {
118 Address homeaddress; 118 Address homeaddress;
119 homeaddress.setType(Address::Home); 119 homeaddress.setType(Address::Home);
120//US homeaddress.setPostOfficeBox( "" ); 120//US homeaddress.setPostOfficeBox( "" );
121//US homeaddress.setExtended( "" ); 121//US homeaddress.setExtended( "" );
122 homeaddress.setStreet( db->readField(ZdbAdrs::HomeStreet).replace( QRegExp("\\r"), "")); 122 homeaddress.setStreet( db->readField(ZdbAdrs::HomeStreet).replace( QRegExp("\\r"), ""));
123 homeaddress.setLocality( db->readField(ZdbAdrs::HomeCity) ); 123 homeaddress.setLocality( db->readField(ZdbAdrs::HomeCity) );
124 homeaddress.setRegion( db->readField(ZdbAdrs::HomeState) ); 124 homeaddress.setRegion( db->readField(ZdbAdrs::HomeState) );
125 homeaddress.setPostalCode( db->readField(ZdbAdrs::HomeZip) ); 125 homeaddress.setPostalCode( db->readField(ZdbAdrs::HomeZip) );
126 homeaddress.setCountry( db->readField(ZdbAdrs::HomeCountry) ); 126 homeaddress.setCountry( db->readField(ZdbAdrs::HomeCountry) );
127 127
128 addr.insertAddress( homeaddress ); 128 addr.insertAddress( homeaddress );
129 } 129 }
130 130
131 if (!db->readField(ZdbAdrs::HomePhone).isEmpty()) 131 if (!db->readField(ZdbAdrs::HomePhone).isEmpty())
132 { 132 {
133 PhoneNumber homephone; 133 PhoneNumber homephone;
134 homephone.setType( PhoneNumber::Home ); 134 homephone.setType( PhoneNumber::Home );
135 homephone.setNumber( db->readField(ZdbAdrs::HomePhone) ); 135 homephone.setNumber( db->readField(ZdbAdrs::HomePhone) );
136 addr.insertPhoneNumber( homephone ); 136 addr.insertPhoneNumber( homephone );
137 } 137 }
138 138
139 if (!db->readField(ZdbAdrs::HomeFax).isEmpty()) 139 if (!db->readField(ZdbAdrs::HomeFax).isEmpty())
140 { 140 {
141 PhoneNumber homefax; 141 PhoneNumber homefax;
142 homefax.setType( PhoneNumber::Home | PhoneNumber::Fax ); 142 homefax.setType( PhoneNumber::Home | PhoneNumber::Fax );
143 homefax.setNumber( db->readField(ZdbAdrs::HomeFax) ); 143 homefax.setNumber( db->readField(ZdbAdrs::HomeFax) );
144 addr.insertPhoneNumber( homefax ); 144 addr.insertPhoneNumber( homefax );
145 } 145 }
146 146
147 if (!db->readField(ZdbAdrs::HomeMobile).isEmpty()) 147 if (!db->readField(ZdbAdrs::HomeMobile).isEmpty())
148 { 148 {
149 PhoneNumber homemobile; 149 PhoneNumber homemobile;
150 homemobile.setType( PhoneNumber::Home | PhoneNumber::Cell ); 150 homemobile.setType( PhoneNumber::Home | PhoneNumber::Cell );
151 homemobile.setNumber( db->readField(ZdbAdrs::HomeMobile) ); 151 homemobile.setNumber( db->readField(ZdbAdrs::HomeMobile) );
152 addr.insertPhoneNumber( homemobile ); 152 addr.insertPhoneNumber( homemobile );
153 } 153 }
154 154
155 addr.setUrl( db->readField(ZdbAdrs::HomeWebPage) ); 155 addr.setUrl( db->readField(ZdbAdrs::HomeWebPage) );
156 156
157 157
158 // business 158 // business
159 if ((!db->readField(ZdbAdrs::BusinessStreet).isEmpty()) || 159 if ((!db->readField(ZdbAdrs::BusinessStreet).isEmpty()) ||
160 (!db->readField(ZdbAdrs::BusinessCity).isEmpty()) || 160 (!db->readField(ZdbAdrs::BusinessCity).isEmpty()) ||
161 (!db->readField(ZdbAdrs::BusinessState).isEmpty()) || 161 (!db->readField(ZdbAdrs::BusinessState).isEmpty()) ||
162 (!db->readField(ZdbAdrs::BusinessZip).isEmpty()) || 162 (!db->readField(ZdbAdrs::BusinessZip).isEmpty()) ||
163 (!db->readField(ZdbAdrs::BusinessCountry).isEmpty())) 163 (!db->readField(ZdbAdrs::BusinessCountry).isEmpty()))
164 { 164 {
165 Address businessaddress; 165 Address businessaddress;
166 businessaddress.setType(Address::Work); 166 businessaddress.setType(Address::Work);
167//US businessaddress.setPostOfficeBox( "" ); 167//US businessaddress.setPostOfficeBox( "" );
168//US businessaddress.setExtended( "" ); 168//US businessaddress.setExtended( "" );
169 businessaddress.setStreet( db->readField(ZdbAdrs::BusinessStreet).replace( QRegExp("\\r"), "") ); 169 businessaddress.setStreet( db->readField(ZdbAdrs::BusinessStreet).replace( QRegExp("\\r"), "") );
170 businessaddress.setLocality( db->readField(ZdbAdrs::BusinessCity) ); 170 businessaddress.setLocality( db->readField(ZdbAdrs::BusinessCity) );
171 businessaddress.setRegion( db->readField(ZdbAdrs::BusinessState) ); 171 businessaddress.setRegion( db->readField(ZdbAdrs::BusinessState) );
172 businessaddress.setPostalCode( db->readField(ZdbAdrs::BusinessZip) ); 172 businessaddress.setPostalCode( db->readField(ZdbAdrs::BusinessZip) );
173 businessaddress.setCountry( db->readField(ZdbAdrs::BusinessCountry) ); 173 businessaddress.setCountry( db->readField(ZdbAdrs::BusinessCountry) );
174 174
175 addr.insertAddress( businessaddress ); 175 addr.insertAddress( businessaddress );
176 } 176 }
177 177
178 178
179 if (!db->readField(ZdbAdrs::BusinessPhone).isEmpty()) 179 if (!db->readField(ZdbAdrs::BusinessPhone).isEmpty())
180 { 180 {
181 PhoneNumber businessphone; 181 PhoneNumber businessphone;
182 businessphone.setType( PhoneNumber::Work ); 182 businessphone.setType( PhoneNumber::Work );
183 businessphone.setNumber( db->readField(ZdbAdrs::BusinessPhone) ); 183 businessphone.setNumber( db->readField(ZdbAdrs::BusinessPhone) );
184 addr.insertPhoneNumber( businessphone ); 184 addr.insertPhoneNumber( businessphone );
185 } 185 }
186 186
187 if (!db->readField(ZdbAdrs::BusinessFax).isEmpty()) 187 if (!db->readField(ZdbAdrs::BusinessFax).isEmpty())
188 { 188 {
189 PhoneNumber businessfax; 189 PhoneNumber businessfax;
190 businessfax.setType( PhoneNumber::Work | PhoneNumber::Fax ); 190 businessfax.setType( PhoneNumber::Work | PhoneNumber::Fax );
191 businessfax.setNumber( db->readField(ZdbAdrs::BusinessFax) ); 191 businessfax.setNumber( db->readField(ZdbAdrs::BusinessFax) );
192 addr.insertPhoneNumber( businessfax ); 192 addr.insertPhoneNumber( businessfax );
193 } 193 }
194 194
195 if (!db->readField(ZdbAdrs::BusinessMobile).isEmpty()) 195 if (!db->readField(ZdbAdrs::BusinessMobile).isEmpty())
196 { 196 {
197 PhoneNumber businessmobile; 197 PhoneNumber businessmobile;
198 businessmobile.setType( PhoneNumber::Work | PhoneNumber::Cell ); 198 businessmobile.setType( PhoneNumber::Work | PhoneNumber::Cell );
199 businessmobile.setNumber( db->readField(ZdbAdrs::BusinessMobile) ); 199 businessmobile.setNumber( db->readField(ZdbAdrs::BusinessMobile) );
200 addr.insertPhoneNumber( businessmobile ); 200 addr.insertPhoneNumber( businessmobile );
201 } 201 }
202 202
203 if (!db->readField(ZdbAdrs::BusinessPager).isEmpty()) 203 if (!db->readField(ZdbAdrs::BusinessPager).isEmpty())
204 { 204 {
205 PhoneNumber businesspager; 205 PhoneNumber businesspager;
206 businesspager.setType( PhoneNumber::Work | PhoneNumber::Pager ); 206 businesspager.setType( PhoneNumber::Work | PhoneNumber::Pager );
207 businesspager.setNumber( db->readField(ZdbAdrs::BusinessPager) ); 207 businesspager.setNumber( db->readField(ZdbAdrs::BusinessPager) );
208 addr.insertPhoneNumber( businesspager ); 208 addr.insertPhoneNumber( businesspager );
209 } 209 }
210 210
211 addr.setRole( db->readField(ZdbAdrs::JobTitle) ); 211 addr.setRole( db->readField(ZdbAdrs::JobTitle) );
212 addr.setOrganization( db->readField(ZdbAdrs::Company) ); 212 addr.setOrganization( db->readField(ZdbAdrs::Company) );
213 addr.insertCustom( "KADDRESSBOOK", "X-Profession", db->readField(ZdbAdrs::Profession) ); 213 addr.insertCustom( "KADDRESSBOOK", "X-Profession", db->readField(ZdbAdrs::Profession) );
214 addr.insertCustom( "KADDRESSBOOK", "X-AssistantsName", db->readField(ZdbAdrs::Assistant) ); 214 addr.insertCustom( "KADDRESSBOOK", "X-AssistantsName", db->readField(ZdbAdrs::Assistant) );
215 addr.insertCustom( "KADDRESSBOOK", "X-Department", db->readField(ZdbAdrs::Department) ); 215 addr.insertCustom( "KADDRESSBOOK", "X-Department", db->readField(ZdbAdrs::Department) );
216 addr.insertCustom( "KADDRESSBOOK", "X-ManagersName", db->readField(ZdbAdrs::Manager) ); 216 addr.insertCustom( "KADDRESSBOOK", "X-ManagersName", db->readField(ZdbAdrs::Manager) );
217 addr.insertCustom( "KADDRESSBOOK", "X-Office", db->readField(ZdbAdrs::Office) ); 217 addr.insertCustom( "KADDRESSBOOK", "X-Office", db->readField(ZdbAdrs::Office) );
218 218
219 //personal 219 //personal
220 addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", db->readField(ZdbAdrs::Spouse) ); 220 addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", db->readField(ZdbAdrs::Spouse) );
221 221
222 QString gen = db->readField(ZdbAdrs::Gender); 222 QString gen = db->readField(ZdbAdrs::Gender);
223 //qDebug("SharpDTMConverter::sharpToAddressee pleas check that gender works!! : Gender: %s", gen.latin1()); 223 //qDebug("SharpDTMConverter::sharpToAddressee pleas check that gender works!! : Gender: %s", gen.latin1());
224 //qDebug("SharpDTMConverter::sharpToAddressee: may be int db->readUshortField(\"ZdbAdrs::Gender\") is here better suited"); 224 //qDebug("SharpDTMConverter::sharpToAddressee: may be int db->readUshortField(\"ZdbAdrs::Gender\") is here better suited");
225 225
226 if (gen == "male") 226 if (gen == "male")
227 addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male"); 227 addr.insertCustom( "KADDRESSBOOK", "X-Gender", "male");
228 else if (gen == "female") 228 else if (gen == "female")
229 addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female"); 229 addr.insertCustom( "KADDRESSBOOK", "X-Gender", "female");
230 230
231 231
232 QDate ann = KGlobal::locale()->readDate( db->readField(ZdbAdrs::Anniversary) ); 232 QDate ann = KGlobal::locale()->readDate( db->readField(ZdbAdrs::Anniversary) );
233 if (ann.isValid()) { 233 if (ann.isValid()) {
234 QString dt = KGlobal::locale()->formatDate(ann, true, KLocale::ISODate); 234 QString dt = KGlobal::locale()->formatDate(ann, true, KLocale::ISODate);
235 //qDebug("qtopiaToAddressee annyversary found:%s", dt.latin1()); 235 //qDebug("qtopiaToAddressee annyversary found:%s", dt.latin1());
236 addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); 236 addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
237 } 237 }
238 238
239 239
240 addr.insertCustom( "KADDRESSBOOK", "X-Children", db->readField(ZdbAdrs::Children) ); 240 addr.insertCustom( "KADDRESSBOOK", "X-Children", db->readField(ZdbAdrs::Children) );
241 241
242 242
243 QDate birthd = KGlobal::locale()->readDate( db->readField(ZdbAdrs::Birthday) ); 243 QDate birthd = KGlobal::locale()->readDate( db->readField(ZdbAdrs::Birthday) );
244 //qDebug("birtd %s ", birthd.toString().latin1()); 244 //qDebug("birtd %s ", birthd.toString().latin1());
245 if (birthd.isValid()) 245 if (birthd.isValid())
246 addr.setBirthday( birthd ); 246 addr.setBirthday( birthd );
247 247
248 addr.setNickName( db->readField(ZdbAdrs::Nickname) ); 248 addr.setNickName( db->readField(ZdbAdrs::Nickname) );
249 249
250 // others 250 // others
251 //US I put opies BusinessWebPage into Ka/Pi's notes block, because no other native field is available. 251 //US I put opies BusinessWebPage into Ka/Pi's notes block, because no other native field is available.
252 //QString notes = db->readField(ZdbAdrs::Notes); 252 //QString notes = db->readField(ZdbAdrs::Notes);
253 //notes += "\nBusinessWebPage: " + db->readField(ZdbAdrs::BusinessWebPage) + "\n"; 253 //notes += "\nBusinessWebPage: " + db->readField(ZdbAdrs::BusinessWebPage) + "\n";
254 if ( addr.url().isEmpty() ) 254 if ( addr.url().isEmpty() )
255 addr.setUrl( db->readField(ZdbAdrs::BusinessWebPage) ); 255 addr.setUrl( db->readField(ZdbAdrs::BusinessWebPage) );
256 addr.setNote( db->readField(ZdbAdrs::Notes).replace( QRegExp("\\r"), "")); 256 addr.setNote( db->readField(ZdbAdrs::Notes).replace( QRegExp("\\r"), ""));
257 257
258 258
259 259
260//US QString groups() const { return find( Qtopia::Groups ); } 260//US QString groups() const { return find( Qtopia::Groups ); }
261//US QStringList groupList() const; 261//US QStringList groupList() const;
262 262
263 //qDebug("SharpDTMConverter::sharpToAddressee please check that the categories will be converted" ); 263 //qDebug("SharpDTMConverter::sharpToAddressee please check that the categories will be converted" );
264 QArray<int> catArray = db->readCategories(); 264 QArray<int> catArray = db->readCategories();
265 QString cat; 265 QString cat;
266 266
267 for ( unsigned int i=0; i < catArray.size(); i++ ) { 267 for ( unsigned int i=0; i < catArray.size(); i++ ) {
268 cat = catDB->label(catArray[i]); 268 cat = catDB->label(catArray[i]);
269 if ( cat.isEmpty() ) 269 if ( cat.isEmpty() )
270 addr.insertCategory(QString::number(catArray[i])); 270 addr.insertCategory(QString::number(catArray[i]));
271 else 271 else
272 addr.insertCategory( cat ); 272 addr.insertCategory( cat );
273 } 273 }
274 274
275 return true; 275 return true;
276} 276}
277 277
278bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* database , const CardId &contact ) 278bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* database , const CardId &contact )
279{ 279{
280 bool cellHome = false, cellWork = false; 280 bool cellHome = false, cellWork = false;
281 // name 281 // name
282 database->writeField(ZdbAdrs::LastName, addr.familyName()); 282 database->writeField(ZdbAdrs::LastName, addr.familyName());
283 database->writeField(ZdbAdrs::FirstName, addr.givenName()); 283 database->writeField(ZdbAdrs::FirstName, addr.givenName());
284 database->writeField(ZdbAdrs::MiddleName, addr.additionalName()); 284 database->writeField(ZdbAdrs::MiddleName, addr.additionalName());
285 database->writeField(ZdbAdrs::Title, addr.prefix()); 285 database->writeField(ZdbAdrs::Title, addr.prefix());
286 database->writeField(ZdbAdrs::Suffix, addr.suffix()); 286 database->writeField(ZdbAdrs::Suffix, addr.suffix());
287 287
288 //qDebug("SharpDTMConverter::addresseeToSharp check if the fileAs transformation works!!\n%s",addr.formattedName().latin1() ); 288 //qDebug("SharpDTMConverter::addresseeToSharp check if the fileAs transformation works!!\n%s",addr.formattedName().latin1() );
289 QString formattedName = addr.formattedName(); 289 QString formattedName = addr.formattedName();
290 if ( formattedName.isEmpty() ) { 290 if ( formattedName.isEmpty() ) {
291 if ( !addr.familyName().isEmpty() ) { 291 if ( !addr.familyName().isEmpty() ) {
292 formattedName = addr.familyName(); 292 formattedName = addr.familyName();
293 if ( !addr.givenName().isEmpty() ) { 293 if ( !addr.givenName().isEmpty() ) {
294 formattedName += ", "; 294 formattedName += ", ";
295 formattedName += addr.givenName(); 295 formattedName += addr.givenName();
296 } 296 }
297 } else 297 } else
298 formattedName = addr.givenName(); 298 formattedName = addr.givenName();
299 } 299 }
300 database->writeField(ZdbAdrs::FileAs, formattedName); 300 database->writeField(ZdbAdrs::FileAs, formattedName);
301 database->writeField(ZdbAdrs::FullName, formattedName); 301 database->writeField(ZdbAdrs::FullName, formattedName);
302 302
303 // email 303 // email
304 //qDebug("SharpDTMConverter::addresseeToSharp check which seperator we need here for the emails!!"); 304 //qDebug("SharpDTMConverter::addresseeToSharp check which seperator we need here for the emails!!");
305 //qDebug("SharpDTMConverter::addresseeToSharp its probably the same from sharpToAddressee"); 305 //qDebug("SharpDTMConverter::addresseeToSharp its probably the same from sharpToAddressee");
306 QString emails = addr.emails().join(" "); 306 QString emails = addr.emails().join(" ");
307 database->writeField(ZdbAdrs::Emails, emails ); 307 database->writeField(ZdbAdrs::Emails, emails );
308 308
309 database->writeField(ZdbAdrs::DefaultEmail, addr.preferredEmail() ); 309 database->writeField(ZdbAdrs::DefaultEmail, addr.preferredEmail() );
310
311
312 // home 310 // home
313 const Address homeaddress = addr.address(Address::Home); 311 const Address homeaddress = addr.address(Address::Home);
314 if (!homeaddress.isEmpty()) { 312 database->writeField(ZdbAdrs::HomeStreet, homeaddress.street());
315 //qDebug("write home address "); 313 database->writeField(ZdbAdrs::HomeCity, homeaddress.locality());
316 database->writeField(ZdbAdrs::HomeStreet, homeaddress.street()); 314 database->writeField(ZdbAdrs::HomeState, homeaddress.region());
317 database->writeField(ZdbAdrs::HomeCity, homeaddress.locality()); 315 database->writeField(ZdbAdrs::HomeZip, homeaddress.postalCode());
318 database->writeField(ZdbAdrs::HomeState, homeaddress.region()); 316 database->writeField(ZdbAdrs::HomeCountry, homeaddress.country());
319 database->writeField(ZdbAdrs::HomeZip, homeaddress.postalCode()); 317
320 database->writeField(ZdbAdrs::HomeCountry, homeaddress.country());
321 }
322
323 PhoneNumber homephone = addr.phoneNumber( PhoneNumber::Home ); 318 PhoneNumber homephone = addr.phoneNumber( PhoneNumber::Home );
324 if (!homephone.number().isEmpty()) 319 database->writeField(ZdbAdrs::HomePhone, homephone.number());
325 database->writeField(ZdbAdrs::HomePhone, homephone.number());
326
327 PhoneNumber homefax = addr.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ); 320 PhoneNumber homefax = addr.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax );
328 if (!homefax.number().isEmpty()) 321 database->writeField(ZdbAdrs::HomeFax, homefax.number());
329 database->writeField(ZdbAdrs::HomeFax, homefax.number());
330
331 PhoneNumber homemobile = addr.phoneNumber( PhoneNumber::Home | PhoneNumber::Cell ); 322 PhoneNumber homemobile = addr.phoneNumber( PhoneNumber::Home | PhoneNumber::Cell );
323 database->writeField(ZdbAdrs::HomeMobile, homemobile.number());
332 if (!homemobile.number().isEmpty()) { 324 if (!homemobile.number().isEmpty()) {
333 database->writeField(ZdbAdrs::HomeMobile, homemobile.number());
334 cellHome = true; 325 cellHome = true;
335 } 326 }
336
337 database->writeField(ZdbAdrs::HomeWebPage, addr.url().url()); 327 database->writeField(ZdbAdrs::HomeWebPage, addr.url().url());
338
339
340 // business 328 // business
341 const Address businessaddress = addr.address(Address::Work); 329 const Address businessaddress = addr.address(Address::Work);
342 if (!businessaddress.isEmpty()) {
343 //qDebug("write business address "); 330 //qDebug("write business address ");
344 database->writeField(ZdbAdrs::BusinessStreet, businessaddress.street()); 331 database->writeField(ZdbAdrs::BusinessStreet, businessaddress.street());
345 database->writeField(ZdbAdrs::BusinessCity, businessaddress.locality()); 332 database->writeField(ZdbAdrs::BusinessCity, businessaddress.locality());
346 database->writeField(ZdbAdrs::BusinessState, businessaddress.region()); 333 database->writeField(ZdbAdrs::BusinessState, businessaddress.region());
347 database->writeField(ZdbAdrs::BusinessZip, businessaddress.postalCode()); 334 database->writeField(ZdbAdrs::BusinessZip, businessaddress.postalCode());
348 database->writeField(ZdbAdrs::BusinessCountry, businessaddress.country()); 335 database->writeField(ZdbAdrs::BusinessCountry, businessaddress.country());
349 } 336
350
351 PhoneNumber businessphone = addr.phoneNumber( PhoneNumber::Work ); 337 PhoneNumber businessphone = addr.phoneNumber( PhoneNumber::Work );
352 if (!businessphone.number().isEmpty()) 338 database->writeField(ZdbAdrs::BusinessPhone, businessphone.number());
353 database->writeField(ZdbAdrs::BusinessPhone, businessphone.number());
354 339
355 PhoneNumber businessfax = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ); 340 PhoneNumber businessfax = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax );
356 if (!businessfax.number().isEmpty()) 341 database->writeField(ZdbAdrs::BusinessFax, businessfax.number());
357 database->writeField(ZdbAdrs::BusinessFax, businessfax.number());
358 342
359 PhoneNumber businessmobile = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Cell ); 343 PhoneNumber businessmobile = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Cell );
344 database->writeField(ZdbAdrs::BusinessMobile, businessmobile.number());
360 if (!businessmobile.number().isEmpty()) { 345 if (!businessmobile.number().isEmpty()) {
361 cellWork = true; 346 cellWork = true;
362 database->writeField(ZdbAdrs::BusinessMobile, businessmobile.number());
363 } 347 }
364 PhoneNumber mobile = addr.phoneNumber( PhoneNumber::Cell ); 348 PhoneNumber mobile = addr.phoneNumber( PhoneNumber::Cell );
365 if (! mobile.number().isEmpty()) { 349 if (! mobile.number().isEmpty()) {
366 if ( ! cellHome ) 350 if ( ! cellHome )
367 database->writeField(ZdbAdrs::HomeMobile, mobile.number()); 351 database->writeField(ZdbAdrs::HomeMobile, mobile.number());
368 else if (! cellWork ) 352 else if (! cellWork )
369 database->writeField(ZdbAdrs::BusinessMobile, mobile.number()); 353 database->writeField(ZdbAdrs::BusinessMobile, mobile.number());
370 } 354 }
371 355
372 PhoneNumber businesspager = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Pager ); 356 PhoneNumber businesspager = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Pager );
373 if (!businesspager.number().isEmpty()) 357 database->writeField(ZdbAdrs::BusinessPager, businesspager.number());
374 database->writeField(ZdbAdrs::BusinessPager, businesspager.number());
375 358
376 database->writeField(ZdbAdrs::JobTitle, addr.role()); 359 database->writeField(ZdbAdrs::JobTitle, addr.role());
377 database->writeField(ZdbAdrs::Company, addr.organization()); 360 database->writeField(ZdbAdrs::Company, addr.organization());
378 361
379 database->writeField(ZdbAdrs::Profession, addr.custom( "KADDRESSBOOK", "X-Profession" )); 362 database->writeField(ZdbAdrs::Profession, addr.custom( "KADDRESSBOOK", "X-Profession" ));
380 database->writeField(ZdbAdrs::Assistant, addr.custom( "KADDRESSBOOK", "X-AssistantsName" )); 363 database->writeField(ZdbAdrs::Assistant, addr.custom( "KADDRESSBOOK", "X-AssistantsName" ));
381 database->writeField(ZdbAdrs::Department, addr.custom( "KADDRESSBOOK", "X-Department" )); 364 database->writeField(ZdbAdrs::Department, addr.custom( "KADDRESSBOOK", "X-Department" ));
382 database->writeField(ZdbAdrs::Manager, addr.custom( "KADDRESSBOOK", "X-ManagersName" )); 365 database->writeField(ZdbAdrs::Manager, addr.custom( "KADDRESSBOOK", "X-ManagersName" ));
383 database->writeField(ZdbAdrs::Office, addr.custom( "KADDRESSBOOK", "X-Office" )); 366 database->writeField(ZdbAdrs::Office, addr.custom( "KADDRESSBOOK", "X-Office" ));
384 367
385 //personal 368 //personal
386 database->writeField(ZdbAdrs::Spouse, addr.custom( "KADDRESSBOOK", "X-Spouse" )); 369 database->writeField(ZdbAdrs::Spouse, addr.custom( "KADDRESSBOOK", "X-Spouse" ));
387 370
388 QString gt = addr.custom( "KADDRESSBOOK", "X-Gender" ); 371 QString gt = addr.custom( "KADDRESSBOOK", "X-Gender" );
389 //qDebug("SharpDTMConverter::addresseeToSharp please check that gender works!! : Gender: %s", gt.latin1()); 372 //qDebug("SharpDTMConverter::addresseeToSharp please check that gender works!! : Gender: %s", gt.latin1());
390 //qDebug("SharpDTMConverter::addresseeToSharp: may be writeField(\"ZdbAdrs::Gender\", ushort) is here better suited?"); 373 //qDebug("SharpDTMConverter::addresseeToSharp: may be writeField(\"ZdbAdrs::Gender\", ushort) is here better suited?");
391 //qDebug("SharpDTMConverter::addresseeToSharp: check also the reverse functionality in sharpToAddressee"); 374 //qDebug("SharpDTMConverter::addresseeToSharp: check also the reverse functionality in sharpToAddressee");
392 if (gt == "male") 375 if (gt == "male")
393 database->writeField(ZdbAdrs::Gender, "male"); 376 database->writeField(ZdbAdrs::Gender, "male");
394 else if (gt == "female") 377 else if (gt == "female")
395 database->writeField(ZdbAdrs::Gender, "female"); 378 database->writeField(ZdbAdrs::Gender, "female");
396 else 379 else
397 database->writeField(ZdbAdrs::Gender, ""); 380 database->writeField(ZdbAdrs::Gender, "");
398 381
399 382 QString dateS ;
400 QDate dt = KGlobal::locale()->readDate( 383 QDate dt = KGlobal::locale()->readDate(addr.custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); // = Qt::ISODate
401 addr.custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); // = Qt::ISODate
402 if ( dt.isValid() ) { 384 if ( dt.isValid() ) {
403 QString dateS = KGlobal::locale()->formatDate(dt, true ); 385 dateS = KGlobal::locale()->formatDate(dt, true );
404 database->writeField(ZdbAdrs::Anniversary, dateS );
405 } 386 }
387 database->writeField(ZdbAdrs::Anniversary, dateS );
406 database->writeField(ZdbAdrs::Children, addr.custom( "KADDRESSBOOK", "X-Children" )); 388 database->writeField(ZdbAdrs::Children, addr.custom( "KADDRESSBOOK", "X-Children" ));
407 dt = addr.birthday().date(); 389 dt = addr.birthday().date();
390 dateS = "";
408 if ( dt.isValid() ) { 391 if ( dt.isValid() ) {
409 QString dateS = KGlobal::locale()->formatDate(dt, true ); 392 dateS = KGlobal::locale()->formatDate(dt, true );
410 database->writeField(ZdbAdrs::Birthday, dateS);
411 } 393 }
394 database->writeField(ZdbAdrs::Birthday, dateS);
412 database->writeField(ZdbAdrs::Nickname, addr.nickName()); 395 database->writeField(ZdbAdrs::Nickname, addr.nickName());
413 396
414 // other 397 // other
415 database->writeField(ZdbAdrs::Notes, addr.note()); 398 database->writeField(ZdbAdrs::Notes, addr.note());
416 399
417//US QString groups() const { return find( Qtopia::Groups ); } 400//US QString groups() const { return find( Qtopia::Groups ); }
418//US QStringList groupList() const; 401//US QStringList groupList() const;
419 402
420 403
421 //qDebug("SharpDTMConverter::addresseeToSharp please check if category transformation works"); 404 //qDebug("SharpDTMConverter::addresseeToSharp please check if category transformation works");
422 405
423 QStringList cats = addr.categories();
424 int ii;
425 for ( ii = 0; ii < cats.count() ;++ii ) {
426 if ( !catDB->exists( cats[ii] ))
427 catDB->addCategory(cats[ii]);
428 }
429 QArray<int> iar;
430 if ( !cats.isEmpty() ) {
431 QArray<int> iar = catDB->ids(cats);
432 //qDebug("***cat count is %d ", iar.count());
433 database->updateCategories(contact, iar);
434 }
435
436 return true; 406 return true;
437} 407}
438 408
409
410bool SharpDTMConverter::setCategories( const Addressee &addr, SlZDataBase* database , const CardId &contact )
411{
412 QStringList list = addr.categories();
413
414 QArray<int> ids(list.count());
415 uint index = 0;
416 for(uint i=0; i<ids.size(); i++){
417 if(catDB->exists(list[i])){
418 ids[index] = catDB->id(list[i]);
419 qDebug("set ex cat %d %s ",ids[index] , list[i].latin1());
420 index++;
421 } else {
422 ids[index] = catDB->addCategory(list[i]);
423 qDebug("add new cat %d %s ",ids[index] , list[i].latin1());
424 index++;
425 }
426 }
427 bool res ;
428 if ( res = database->updateCategories(contact, ids) )
429 qDebug("cat updated ");
430 else
431 qDebug("error cat updating ");
432
433 return res;
434}
435
436#if 0
437 m_pCategories = new SlCategories;
438catDB
439
440 if(categories == QString::null) return true;
441 QStringList list = CSVParser::parse(categories);
442 QArray<int> ids(list.count());
443 uint index = 0;
444 for(uint i=0; i<ids.size(); i++){
445#if 0
446 bool ok;
447 ids[index] = list[i].toInt(&ok);
448 if(ok){
449 index++;
450 } else {
451 if(m_pCategories->exists(list[i])){
452 ids[index] = m_pCategories->id(list[i]);
453 index++;
454 }
455 }
456#else
457 if(m_pCategories->exists(list[i])){
458 ids[index] = m_pCategories->id(list[i]);
459 index++;
460 } else if(m_addCategory){
461 ids[index] = m_pCategories->addCategory(list[i]);
462 index++;
463 }
464#endif
465 }
466 if(ids.size() > 0 && index == 0){
467 return true;
468 } else if(index != ids.size()){
469 ids.resize(index);
470 }
471 if(!m_pZdb->updateCategories(id, ids)){
472 return false;
473 }
474 return true;
475#endif
476
439QDate SharpDTMConverter::convertDate( QString s) 477QDate SharpDTMConverter::convertDate( QString s)
440{ 478{
441 QDate dt = KGlobal::locale()->readDate( s ); 479 QDate dt = KGlobal::locale()->readDate( s );
442 return dt; 480 return dt;
443 return QDate (); 481 return QDate ();
444} 482}
diff --git a/kabc/plugins/sharpdtm/sharpdtmconverter.h b/kabc/plugins/sharpdtm/sharpdtmconverter.h
index a04083e..db1bf2d 100644
--- a/kabc/plugins/sharpdtm/sharpdtmconverter.h
+++ b/kabc/plugins/sharpdtm/sharpdtmconverter.h
@@ -1,87 +1,88 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24$Id$ 24$Id$
25*/ 25*/
26 26
27#ifndef KABC_SHARPDTMCONVERTER_H 27#ifndef KABC_SHARPDTMCONVERTER_H
28#define KABC_SHARPDTMCONVERTER_H 28#define KABC_SHARPDTMCONVERTER_H
29 29
30#include <qstring.h> 30#include <qstring.h>
31 31
32#include <sl/slzdb.h> 32#include <sl/slzdb.h>
33 33
34#include "addressee.h" 34#include "addressee.h"
35 35
36namespace SlCategory { 36namespace SlCategory {
37 class SlCategories; 37 class SlCategories;
38} 38}
39 39
40class SlZDataBase; 40class SlZDataBase;
41 41
42namespace KABC { 42namespace KABC {
43 43
44class SharpDTMConverter 44class SharpDTMConverter
45{ 45{
46public: 46public:
47 47
48 /** 48 /**
49 * Constructor. 49 * Constructor.
50 */ 50 */
51 SharpDTMConverter(); 51 SharpDTMConverter();
52 52
53 /** 53 /**
54 * Destructor. 54 * Destructor.
55 */ 55 */
56 virtual ~SharpDTMConverter(); 56 virtual ~SharpDTMConverter();
57 57
58 bool init(); 58 bool init();
59 void deinit(); 59 void deinit();
60 60
61 /** 61 /**
62 * Converts a given sharp card to an addressee. 62 * Converts a given sharp card to an addressee.
63 * 63 *
64 * @param contact The sharp card id, eventhough it might be 0, if the contact is a new one. 64 * @param contact The sharp card id, eventhough it might be 0, if the contact is a new one.
65 * @param database The sharp database pointer we use for the conversion 65 * @param database The sharp database pointer we use for the conversion
66 * @param addr The addressee. 66 * @param addr The addressee.
67 */ 67 */
68 bool sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr ); 68 bool sharpToAddressee( const CardId &contact, const SlZDataBase* database, Addressee &addr );
69 69
70 /** 70 /**
71 * Converts an addressee to a sharp dtm contact. 71 * Converts an addressee to a sharp dtm contact.
72 * 72 *
73 * @param addr The addressee. 73 * @param addr The addressee.
74 * @param database The sharp database pointer we use for the conversion 74 * @param database The sharp database pointer we use for the conversion
75 * @param contact The sharp card id, eventhough it might be 0, if the contact is a new one. 75 * @param contact The sharp card id, eventhough it might be 0, if the contact is a new one.
76 */ 76 */
77 bool addresseeToSharp( const Addressee &addr, SlZDataBase* database , const CardId &contact ); 77 bool addresseeToSharp( const Addressee &addr, SlZDataBase* database , const CardId &contact );
78 bool setCategories( const Addressee &addr, SlZDataBase* database , const CardId &contact );
78 79
79 private: 80 private:
80 SlCategory::SlCategories* catDB; 81 SlCategory::SlCategories* catDB;
81 QDate convertDate( QString ); 82 QDate convertDate( QString );
82 83
83 84
84}; 85};
85 86
86} 87}
87#endif 88#endif