summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/Migration-HowTo.txt77
-rw-r--r--libkcal/incidencebase.cpp10
2 files changed, 71 insertions, 16 deletions
diff --git a/bin/kdepim/korganizer/Migration-HowTo.txt b/bin/kdepim/korganizer/Migration-HowTo.txt
index ca767c6..a5fa02c 100644
--- a/bin/kdepim/korganizer/Migration-HowTo.txt
+++ b/bin/kdepim/korganizer/Migration-HowTo.txt
@@ -1,299 +1,350 @@
1 1
2Migration HowTo Outlook 200X -> KDE 2Migration HowTo Outlook 200X -> KDE
3 3
4Version 1.0.1
5The latest version of this file can be downloaded from
6http://sourceforge.net/projects/kdepimpi/
7Please choose there package/project/file:
8general Files for KDE/Pim
9MigrationHowTo_OL2KDE
10MigrationHowTo_OL2KDE.txt
11
12
4This HowTo describes the process of migrating data ( contact and calendar data ) from Outlook 200X to the PIM programs of the KDE-Desktop-Environment. 13This HowTo describes the process of migrating data ( contact and calendar data ) from Outlook 200X to the PIM programs of the KDE-Desktop-Environment.
5The PIM programs are KAdddressbook and KOrganizer, which may be used embedded in the Kontact PIM management framework. 14The PIM programs are KAdddressbook and KOrganizer, which may be used embedded in the Kontact PIM management framework.
6This HowTo describes version 1.9.3a of the migration tools. 15This HowTo describes version 1.9.3a of the migration tools.
7The migration tools are the platform independent versions of KAdddressbook and KOrganizer: KAdddressbook/Pi and KOrganizer/Pi. 16The migration tools are the platform independent versions of KAdddressbook and KOrganizer: KAdddressbook/Pi and KOrganizer/Pi.
8 17
9Content: 18Content:
10 19
111) How to start 201) How to start
122) How to import pst files in Outlook 212) How to import pst files in Outlook
133) Where to get the migration tools 223) Where to get the migration tools
144) How to install the migration tools 234) How to install the migration tools
155) How to get the contact data out of Outlook200X 245) How to get the contact data out of Outlook200X
166) How to get the calendar data out of Outlook200X 256) How to get the calendar data out of Outlook200X
267) How to import your contact data into Kontact
278) How to import your calendar data into Kontact
17 28
18APPENDIX A) Problems and solutions when reading contact data 29APPENDIX A) Problems and solutions when reading contact data
19APPENDIX B) Problems and solutions when reading calendar data 30APPENDIX B) Problems and solutions when reading calendar data
20 31
21**************************************** 32****************************************
221) How to start 331) How to start
23**************************************** 34****************************************
24 35
25For the migration we need the actual Outlook 200X data, which Outlook stores in *.pst files. 36For the migration we need the actual Outlook 200X data, which Outlook stores in *.pst files.
26Then we need an installed version of Outlook 200X to access these *.pst files. 37Then we need an installed version of Outlook 200X to access these *.pst files.
27When we have an Outllook 200X running with all data accessable, we need the migration tools. 38When we have an Outllook 200X running with all data accessable, we need the migration tools.
28 39
29If you have no Outlook200X installed please install the Outlook version, you need to a import your *.pst files. 40If you have no Outlook200X installed please install the Outlook version, you need to a import your *.pst files.
30If you have an Outlook200X installed with no contact/calendar data available, and you have some *.pst files please continue with: 2) How to import pst files in Outlook. 41If you have an Outlook200X installed with no contact/calendar data available, and you have some *.pst files please continue with: 2) How to import pst files in Outlook.
31If you have a running Outlook200X already with contact/calendar data available, please continue with: 3) Where to get the migration tools. 42If you have a running Outlook200X already with contact/calendar data available, please continue with: 3) Where to get the migration tools.
32 43
33 44
34**************************************** 45****************************************
352) How to import pst files in Outlook 462) How to import pst files in Outlook
36**************************************** 47****************************************
37 48
38MISSING 49To open a local *.pst file in Outlook2003, choose menu:
50File - Open - Outlook Data File ...
51Now the data included in this file is shown
52as folders of a newly added root folder in the Outlook folder view.
53This root folder is probably not accessable from
54the migration tools via OLE.
55To access data stored in one of the subfolders,
56copy this subfolder to a root folder,
57which can be accessed from the migration tools via OLE.
58(To know, which folder can be accessed, just perform 5.) or 6.) until
59you get the Oulook import dialog!)
60
61To copy it, right click on that subfolder and choose
62Copy "<subfoldername>"...
63in the popup menu.
39 64
40**************************************** 65****************************************
413) Where to get the migration tools 663) Where to get the migration tools
42**************************************** 67****************************************
43 68
44The data migration is is performed with the Windows versions of KAdddressbook/Pi and KOrganizer/Pi. 69The data migration is is performed with the Windows versions of KAdddressbook/Pi and KOrganizer/Pi.
45Pi stands for platform-independend - platform-independend because the same program is available for different platforms, like Windows, Linux desktop and Sharp-Zaurus PDA. 70Pi stands for platform-independend - platform-independend because the same program is available for different platforms, like Windows, Linux desktop and Sharp-Zaurus PDA.
46Note: The Linux desktop versions of KOrganizer/Pi and KOrganizer/KDE-desktop are two different programs! You cannot use KOrganizer/Pi together with or embedded in the KDE-desktop environment. The same is valid for KAdddressbook/Pi. 71Note: The Linux desktop versions of KOrganizer/Pi and KOrganizer/KDE-desktop are two different programs! You cannot use KOrganizer/Pi together with, or embedded in, the KDE-desktop environment. The same is valid for KAdddressbook/Pi.
47 72
48The programs you need for the migration are: 73The programs you need for the migration are:
49a) KAdddressbook/Pi executeable + 2dlls + icons 74a) KAdddressbook/Pi executeable + 2dlls + icons
50b) KOrganizer/Pi executeable + icons 75b) KOrganizer/Pi executeable + icons
51c) The Qt3 library qt-mt331.dll and the MSVC library msvcr71.dll 76c) The Qt3 library qt-mt331.dll and the MSVC library msvcr71.dll and the MSVC library mfc71u.dll
52
53You can download all of them at: 77You can download all of them at:
54 78
55http://sourceforge.net/projects/kdepimpi/ 79http://sourceforge.net/projects/kdepimpi/
56 80
57Download of a) and b) 81Download of a) and b)
58Please choose there package/project with name KDE/Pim 82Please choose there package/project with name KDE/Pim
59(Direct link: http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 ) 83(Direct link: http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 )
60Choose there the topmost latest version and the files 84Choose there the topmost latest version and the files
61kapixxx-exe.zip 85kapixxx-exe.zip
62kopixxx-exe.zip 86kopixxx-exe.zip
63The latest version is currently ( 2004-07-13 ) 1.9.3a. 87The latest version is currently ( 2004-07-13 ) 1.9.3a.
64Such that the files to download are 88Such that the files to download are
65kapi193a-exe.zip 89kapi193a-exe.zip
66kopi193a-exe.zip 90kopi193a-exe.zip
67 91
68To download b) 92To download b)
69Please choose there package/project with name KO/Pi - general files. 93Please choose there package/project/file:
70(Direct link: http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=116719 ) 94general Files for KDE/Pim
95Needed Windows Dlls
96kdepimdll.zip
97
98(Direct link: http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=122438&release_id=256700 )
71Choose there the file: 99Choose there the file:
72kopidll.zip 100kdepimdll.zip
73 101
74Now you have downloaded the files 102Now you have downloaded the files
75 103
76kapi193a-exe.zip 104kapi193a-exe.zip
77kopi193a-exe.zip 105kopi193a-exe.zip
78kopidll.zip 106kdepimdll.zip
79 107
80and we can continue to install the files, which is simply unzipping them. 108and we can continue to install the files, which is simply unzipping them.
81 109
82 110
83**************************************** 111****************************************
844) How to install the migration tools 1124) How to install the migration tools
85**************************************** 113****************************************
86 114
87You have downloaded the files 115You have downloaded the files
88 116
89kapi193a-exe.zip 117kapi193a-exe.zip
90kopi193a-exe.zip 118kopi193a-exe.zip
91kopidll.zip 119kdepimdll.zip
92 120
93Unzip these files. 121Unzip these files.
94The directory "pics" of the kopidll.zip is useless now and can be completely ignored.
95Now choose an arbitrary installation directory, where to copy all the needed files together. 122Now choose an arbitrary installation directory, where to copy all the needed files together.
96You should have now the following files and the directory "kdepim" in the same directory: 123You should have now the following files and the directory "kdepim" in the same directory:
97kopi.exe 124kopi.exe
98kapi.exe 125kapi.exe
99microkabc_dir.dll 126microkabc_dir.dll
100microkabc_file.dll 127microkabc_file.dll
101msvcr71.dll 128msvcr71.dll
129mfc71u.dll
102qt-mt331.dll 130qt-mt331.dll
103ReadMich.txt 131ReadMich.txt
104kdepim (directory) 132kdepim (directory)
105 133
106The directory "kdepim" should contain subdirectories 134The directory "kdepim" should contain subdirectories
107kaddressbook 135kaddressbook
108korganizer 136korganizer
109which itself contain some subdirectories with icons and help text. 137which itself contain some subdirectories with icons and help text.
110 138
111Now the migration tools are ready for use. 139Now the migration tools are ready for use.
112 140
113 141
114NOTE AND HINT for performing migration on many workstations: 142NOTE AND HINT for performing migration on many workstations:
115Just burn the content of the installation dir on a CD. 143Just burn the content of the installation dir on a CD.
116Then you can put the CD in every workstation and execute the migration tools from that CD directly. 144Then you can put the CD in every workstation and execute the migration tools from that CD directly.
117 145
118 146
119************************************************************* 147*************************************************************
1205) How to get the contact data out of Outlook200X 1485) How to get the contact data out of Outlook200X
121************************************************************* 149*************************************************************
122 150
123Note: When accessing Outlook to read the data, it should not be possible, that there is any data lost in Outlook, because the progam accesses Outlook only Read-Only. 151Note: When accessing Outlook to read the data, it should not be possible, that there is any data lost in Outlook, because the progam accesses Outlook only Read-Only.
124 152
125You have the file 153You have the file
126kapi.exe 154kapi.exe
127and the other needed files accessable on your workstation. 155and the other needed files accessable on your workstation.
128 156
129Getting the contact data 157Getting the contact data
130 158
131Please start kapi.exe. 159Please start kapi.exe.
132Choose menu: 160Choose menu:
133File - Import - Import from OL... 161File - Import - Import from OL...
134You will get a dialog which shows all "Personal Folders" of Outlook. 162You will get a dialog which shows all "Personal Folders" of Outlook.
135Choose the Contact Folder(s) you want to import and select them with a hook. 163Choose the Contact Folder(s) you want to import and select them with a hook.
136(All other folder but the contact containing folders are shown, but disabled) 164(All other folder but the contact containing folders are shown, but disabled).
165(If the data you want to import is not stored in one of the shown folders,
166please read step 2.) and click on "close" ).
137Click the "import" button. 167Click the "import" button.
138Now Outlook asks you to allow access to the contact data. 168Now Outlook asks you to allow access to the contact data.
139Select "Allow access" amd click "Yes" in this dialog. 169Select "Allow access" amd click "Yes" in this dialog.
140Now the importing is performed and KA/Pi will show a progress bar. 170Now the importing is performed and KA/Pi will show a progress bar.
141After importing, KA/Pi shows a dialog, how much contacts are imported. 171After importing, KA/Pi shows a dialog, how much contacts are imported.
142If you press a second time "import" , already imported contacts are not imported again. 172If you press a second time "import" , already imported contacts are not imported again.
143After importing you can choose another "Contact Folder" to import or close the import dialog. 173After importing you can choose another "Contact Folder" to import or close the import dialog.
144Please close the import dialog. 174Please close the import dialog.
145Now you see the imported contacts in KA/Pi on the left in the list view. 175Now you see the imported contacts in KA/Pi on the left in the list view.
146Please verify, that the import was correct. 176Please verify, that the import was correct.
147About problems of mapping particular Outlook-data-fields to KAdressbook-data-fields see Appendix A). 177About problems of mapping particular Outlook-data-fields to KAdressbook-data-fields see Appendix A).
148 178
149Choose menu: 179Choose menu:
150File - Save 180File - Save
151and close KA/Pi. 181and close KA/Pi.
152Now you should have the contact data in the file std.vcf in your home directory in the path 182Now you should have the contact data in the file std.vcf in your home directory in the path
153(YOURHOMEDIR)\kdepim\apps\kabc\std.vcf 183(YOURHOMEDIR)\kdepim\apps\kabc\std.vcf
154 184
155Copy that file to a moveable disk or memory stick or just copy it via network to the destination. 185Copy that file to a moveable disk or memory stick or just copy it via network to the destination.
156Import that file into KAddressbook/Kontact via Import - Import vcard. 186Import that file into KAddressbook/Kontact via Import - Import vcard.
187Details about importing you can read at: 7) How to import your contact data into Kontact
157 188
158Now you have your Outlook200X contact data on the KDE desktop available and you are done with the migration of contacts. 189Now you have your Outlook200X contact data on the KDE desktop available and you are done with the migration of contacts.
159 190
160************************************************************* 191*************************************************************
1616) How to get the calendar data out of Outlook200X 1926) How to get the calendar data out of Outlook200X
162************************************************************* 193*************************************************************
163 194
164Note: When accessing Outlook to read the data, it should not be possible, that there is any data lost in Outlook, because the progam accesses Outlook only Read-Only. 195Note: When accessing Outlook to read the data, it should not be possible, that there is any data lost in Outlook, because the progam accesses Outlook only Read-Only.
165 196
166You have the file 197You have the file
167kopi.exe 198kopi.exe
168and the other needed files accessable on your workstation. 199and the other needed files accessable on your workstation.
169 200
170Getting the calendar data 201Getting the calendar data
171 202
172NOTE: Before extracting the calendar data, it is recommended to extract the contact data first. 203NOTE: Before extracting the calendar data, it is recommended to extract the contact data first.
173If you extract the contact data first, the identity (UID) of attendees of a meeting can be mapped correctly in the newly created appointments, such that you can access the attendee contact data later directly from KOrganizer. 204If you extract the contact data first, the identity (UID) of attendees of a meeting can be mapped correctly in the newly created appointments, such that you can access the attendee contact data later directly from KOrganizer.
174 205
175Please start kopi.exe. 206Please start kopi.exe.
176 207
177You will see a dialog, that you started KO/Pi for the first time and that the timezone configuration will be shown now. Confirm with "Ok". 208You will see a dialog, that you started KO/Pi for the first time and that the timezone configuration will be shown now. Confirm with "Ok".
178 209
179Now you will see the configuration dialog of KO/Pi. 210Now you will see the configuration dialog of KO/Pi.
180Please choose your timezone and adjust the daylight saving settings. 211Please choose your timezone and adjust the daylight saving settings.
181The dialog shows defaults for CET (Central European Time), such that users located in central Europe simply can press "OK" in that dialog. 212The dialog shows defaults for CET (Central European Time), such that users located in central Europe simply can press "OK" in that dialog.
182(Note: Don't forget to set the timezone in KDE KOrganizer before importing data there. The timezone in KDE KOrganizer is set per default to UTC (GMT), that is -1h of CET). 213(Note: Don't forget to set the timezone in KDE KOrganizer before importing data there. The timezone in KDE KOrganizer is set per default to UTC (GMT), that is -1h of CET).
183 214
184Now you will see the KO/Pi main window. 215Now you will see the KO/Pi main window.
185Choose menu: 216Choose menu:
186File - Import from OL 217File - Import from OL
187You will get a dialog which shows all "Personal Folders" of Outlook. 218You will get a dialog which shows all "Personal Folders" of Outlook.
188Choose the Calendar Folder(s) you want to import and select them with a hook. 219Choose the Calendar Folder(s) you want to import and select them with a hook.
189(All other folder but the calendar data containing folders are shown, but disabled) 220(All other folder but the calendar data containing folders are shown, but disabled).
221(If the data you want to import is not stored in one of the shown folders,
222please read step 2.) and click on "close" ).
190Click the "import" button. 223Click the "import" button.
191Now Outllok asks you to allow access to the contact data. 224Now Outllok asks you to allow access to the contact data.
192Select "Allow access" amd click "Yes" in this dialog. 225Select "Allow access" amd click "Yes" in this dialog.
193Now the importing is performed and KO/Pi will show a progress bar. 226Now the importing is performed and KO/Pi will show a progress bar.
194After importing, KO/Pi shows a dialog, how much calendar items are imported. 227After importing, KO/Pi shows a dialog, how much calendar items are imported.
195If you press a second time "import" , already imported calendar items are not imported again. 228If you press a second time "import" , already imported calendar items are not imported again.
196After importing you can choose another "Calendar Folder" to import or close the import dialog. 229After importing you can choose another "Calendar Folder" to import or close the import dialog.
197Please close the import dialog. 230Please close the import dialog.
198Now you see the imported calendar items in KO/Pi. 231Now you see the imported calendar items in KO/Pi.
199Please verify, that the import was correct. 232Please verify, that the import was correct.
200About problems of mapping particular Outlook-data-fields to KOrganizer-data-fields see Appendix B). 233About problems of mapping particular Outlook-data-fields to KOrganizer-data-fields see Appendix B).
201Close KO/Pi - data will be saved automatically. 234Close KO/Pi - data will be saved automatically.
202 235
203Now you should have the calendar data in the file mycalendar.ics in your home directory in the path 236Now you should have the calendar data in the file mycalendar.ics in your home directory in the path
204(YOURHOMEDIR)\kdepim\apps\korganizer\mycalendar.ics 237(YOURHOMEDIR)\kdepim\apps\korganizer\mycalendar.ics
205 238
206Copy that file to a moveable disk or memory stick or just copy it via network to the destination. 239Copy that file to a moveable disk or memory stick or just copy it via network to the destination.
207Import that file into KOrganizer/Kontact via Import - Import iCal/ics file. 240Import that file into KOrganizer/Kontact.
241Details about importing your calendar data you can read at: 8) How to import your calendar data into Kontact.
208(Warning again: Don't forget to set the timezone in KDE KOrganizer before importing data there. The timezone in KDE KOrganizer is set per default to UTC (GMT), that is -1h of CET). 242(Warning again: Don't forget to set the timezone in KDE KOrganizer before importing data there. The timezone in KDE KOrganizer is set per default to UTC (GMT), that is -1h of CET).
209Now you have your Outlook200X calendar data on the KDE desktop available and you are done with the migration. 243Now you have your Outlook200X calendar data on the KDE desktop available and you are done with the migration.
210 244
211Hint: 245Hint:
212If you want to use KO/Pi and KA/Pi on your windows desktop, you should read all the help information available in the KO/Pi Help menu. One Highlight of KO/Pi is the easy syncing with another *.ics file. 246If you want to use KO/Pi and KA/Pi on your windows desktop, you should read all the help information available in the KO/Pi Help menu. One Highlight of KO/Pi is the easy syncing with another *.ics file.
213(Information about syncing available in the KO/Pi help menu). 247(Information about syncing available in the KO/Pi help menu).
214Another hint: 248Another hint:
215KO/Pi + KA/Pi ( = KDE-Pim/Pi ) are available for the Sharp Zaurus PDA. 249KO/Pi + KA/Pi ( = KDE-Pim/Pi ) are available for the Sharp Zaurus PDA.
216Syncing data works for KO/Pi ( version 1.9.3) but not yet for KA/Pi. 250Syncing data works for KO/Pi ( version 1.9.3) but not yet for KA/Pi.
217 251
218 252
253*************************************************************
2547) How to import your contact data into Kontact
255*************************************************************
256
257
258
259MISSING
260
261
262
263*************************************************************
2648) How to import your calendar data into Kontact
265*************************************************************
266
267
268MISSING
269
219 270
220************************************************************* 271*************************************************************
221APPENDIX A) Problems and solutions when reading contact data 272APPENDIX A) Problems and solutions when reading contact data
222************************************************************* 273*************************************************************
223 274
224All data, which can be displayed and accessed in KAddressbook is imported from Outlook. 275All data, which can be displayed and accessed in KAddressbook is imported from Outlook.
225In Outlook you can assign an attribute "This is the mailing address" to one of the addresses. 276In Outlook you can assign an attribute "This is the mailing address" to one of the addresses.
226This address shows up in KAddressbook twice. 277This address shows up in KAddressbook twice.
227The first time with the original attribute from Outlook ( e.g. "work" for "business" in OL ). 278The first time with the original attribute from Outlook ( e.g. "work" for "business" in OL ).
228The second time with the attribute "postal". 279The second time with the attribute "postal".
229 280
230All telephone numbers of OL are imported. 281All telephone numbers of OL are imported.
231OL offers special case telephone numbers, like "Assistant", which have no counterpart in KAdressbook. 282OL offers special case telephone numbers, like "Assistant", which have no counterpart in KAdressbook.
232In that case, the imported number has special combined attributes in KAddressbook. 283In that case, the imported number has special combined attributes in KAddressbook.
233Here is the mapping of types in OL to attributes in KA: 284Here is the mapping of types in OL to attributes in KA:
234 285
235OL type Attributes in KA 286OL type Attributes in KA
236 287
237Assistant Work + Voice 288Assistant Work + Voice
238Business Work 289Business Work
239Business2 Work 290Business2 Work
240BusinessFax Work + Fax 291BusinessFax Work + Fax
241Car Car 292Car Car
242Home Home 293Home Home
243Home2 Home 294Home2 Home
244HomeFax Home + Fax 295HomeFax Home + Fax
245ISDN Isdn 296ISDN Isdn
246Mobile Cell (displayed as Mobile Phone) 297Mobile Cell (displayed as Mobile Phone)
247OtherFax Fax 298OtherFax Fax
248OtherTelephone Voice 299OtherTelephone Voice
249Pager Pager 300Pager Pager
250PrimaryTelephone Pref ( displayed as typeless, with attribute preferred ) 301PrimaryTelephone Pref ( displayed as typeless, with attribute preferred )
251TTYTDD Modem 302TTYTDD Modem
252Telex Fax + Bbs (Bbs displayed as MailBox - not very senseful, sorry ...) 303Telex Fax + Bbs (Bbs displayed as MailBox - not very senseful, sorry ...)
253CompanyMain Work + Pref 304CompanyMain Work + Pref
254Radio Video 305Radio Video
255Callback Voice + Pref 306Callback Voice + Pref
256 307
257Some mapping may not be very senseful, but it helps to identify the original OL types. 308Some mapping may not be very senseful, but it helps to identify the original OL types.
258 309
259 310
260************************************************************* 311*************************************************************
261APPENDIX B) Problems and solutions when reading calendar data 312APPENDIX B) Problems and solutions when reading calendar data
262************************************************************* 313*************************************************************
263 314
264Almost all data, which can be displayed and accessed in KOrganizer is imported from Outlook. 315Almost all data, which can be displayed and accessed in KOrganizer is imported from Outlook.
265Attachments of appointments are not imported. 316Attachments of appointments are not imported.
266KOrganizer may crash, when reading some kinds of attachments. 317KOrganizer may crash, when reading some kinds of attachments.
267These may be changed in future versions. 318These may be changed in future versions.
268 319
269Attendee lists of meetings and their state are imported in KOrganizer. 320Attendee lists of meetings and their state are imported in KOrganizer.
270 321
271A problem is importing some kinds of recurring events: 322A problem is importing some kinds of recurring events:
272 323
273First problem: 324First problem:
274OL offers a recurrence like 325OL offers a recurrence like
275- Yearly recurrence, every second Tuesday of July. 326- Yearly recurrence, every second Tuesday of July.
276KOrganizer ( in versions < 3.3.0 ) does not offer that kind of recurrence. 327KOrganizer ( in versions < 3.3.0 ) does not offer that kind of recurrence.
277Such that 328Such that
278"Yearly recurrence, every second Tuesday of July." 329"Yearly recurrence, every second Tuesday of July."
279is converted to 330is converted to
280"Monthly recurrence, every 12. month, second Tuesday in month, StartMonth = July." 331"Monthly recurrence, every 12. month, second Tuesday in month, StartMonth = July."
281which can be edited in KO. 332which can be edited in KO.
282 333
283Second problem: 334Second problem:
284OL offers an exception in a recurrence with other data/time. 335OL offers an exception in a recurrence with other data/time.
285KO offers only an exception in a recurrence , where the exception is deleted from the row of all occurences. 336KO offers only an exception in a recurrence , where the exception is deleted from the row of all occurences.
286Such that 337Such that
287"Recurring event with exception, that date XX should be at date YY" 338"Recurring event with exception, that date XX should be at date YY"
288in OL is converted to two events in KO: 339in OL is converted to two events in KO:
289"Recurring event with exception, that date XX is not included" 340"Recurring event with exception, that date XX is not included"
290"Non-recurring event at date YY with same data like the recurring event (e.g. Summary, location, attendee list, ...)" 341"Non-recurring event at date YY with same data like the recurring event (e.g. Summary, location, attendee list, ...)"
291 342
292 343
293 344
294 345
295 346
296 347
297 348
298 349
299 350
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index d7c4595..f1db8b7 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -1,470 +1,474 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@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#include <kglobal.h> 21#include <kglobal.h>
22#include <klocale.h> 22#include <klocale.h>
23#include <kdebug.h> 23#include <kdebug.h>
24 24
25#include "calformat.h" 25#include "calformat.h"
26 26
27#include "incidencebase.h" 27#include "incidencebase.h"
28 28
29using namespace KCal; 29using namespace KCal;
30 30
31IncidenceBase::IncidenceBase() : 31IncidenceBase::IncidenceBase() :
32 mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false), 32 mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false),
33 mPilotId(0), mSyncStatus(SYNCMOD) 33 mPilotId(0), mSyncStatus(SYNCMOD)
34{ 34{
35 setUid(CalFormat::createUniqueId()); 35 setUid(CalFormat::createUniqueId());
36 mOrganizer = ""; 36 mOrganizer = "";
37 mFloats = false; 37 mFloats = false;
38 mDuration = 0; 38 mDuration = 0;
39 mHasDuration = false; 39 mHasDuration = false;
40 mPilotId = 0; 40 mPilotId = 0;
41 mZaurusId = -1; 41 mZaurusId = -1;
42 mZaurusUid = 0; 42 mZaurusUid = 0;
43 mExternalId = ":"; 43 mExternalId = ":";
44 mTempSyncStat = 0; 44 mTempSyncStat = 0;
45 mSyncStatus = 0; 45 mSyncStatus = 0;
46 mAttendees.setAutoDelete( true ); 46 mAttendees.setAutoDelete( true );
47} 47}
48 48
49IncidenceBase::IncidenceBase(const IncidenceBase &i) : 49IncidenceBase::IncidenceBase(const IncidenceBase &i) :
50 CustomProperties( i ) 50 CustomProperties( i )
51{ 51{
52 mReadOnly = i.mReadOnly; 52 mReadOnly = i.mReadOnly;
53 mDtStart = i.mDtStart; 53 mDtStart = i.mDtStart;
54 mDuration = i.mDuration; 54 mDuration = i.mDuration;
55 mHasDuration = i.mHasDuration; 55 mHasDuration = i.mHasDuration;
56 mOrganizer = i.mOrganizer; 56 mOrganizer = i.mOrganizer;
57 mUid = i.mUid; 57 mUid = i.mUid;
58 QPtrList<Attendee> attendees = i.attendees(); 58 QPtrList<Attendee> attendees = i.attendees();
59 for( Attendee *a = attendees.first(); a; a = attendees.next() ) { 59 for( Attendee *a = attendees.first(); a; a = attendees.next() ) {
60 mAttendees.append( new Attendee( *a ) ); 60 mAttendees.append( new Attendee( *a ) );
61 } 61 }
62 mFloats = i.mFloats; 62 mFloats = i.mFloats;
63 mLastModified = i.mLastModified; 63 mLastModified = i.mLastModified;
64 mPilotId = i.mPilotId; 64 mPilotId = i.mPilotId;
65 mZaurusId = i.mZaurusId; 65 mZaurusId = i.mZaurusId;
66 mZaurusUid = i.mZaurusUid; 66 mZaurusUid = i.mZaurusUid;
67 mTempSyncStat = i.mTempSyncStat; 67 mTempSyncStat = i.mTempSyncStat;
68 mSyncStatus = i.mSyncStatus; 68 mSyncStatus = i.mSyncStatus;
69 mExternalId = i.mExternalId; 69 mExternalId = i.mExternalId;
70 // The copied object is a new one, so it isn't observed by the observer 70 // The copied object is a new one, so it isn't observed by the observer
71 // of the original object. 71 // of the original object.
72 mObservers.clear(); 72 mObservers.clear();
73 73
74 mAttendees.setAutoDelete( true ); 74 mAttendees.setAutoDelete( true );
75} 75}
76 76
77IncidenceBase::~IncidenceBase() 77IncidenceBase::~IncidenceBase()
78{ 78{
79} 79}
80 80
81 81
82bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 ) 82bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 )
83{ 83{
84 // do not compare mSyncStatus and mExternalId 84 // do not compare mSyncStatus and mExternalId
85 if( i1.attendees().count() != i2.attendees().count() ) { 85 if( i1.attendees().count() != i2.attendees().count() ) {
86 return false; // no need to check further 86 return false; // no need to check further
87 } 87 }
88 if ( i1.attendees().count() > 0 ) { 88 if ( i1.attendees().count() > 0 ) {
89 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ; 89 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ;
90 while ( a1 ) { 90 while ( a1 ) {
91 if ( !( (*a1) == (*a2)) ) 91 if ( !( (*a1) == (*a2)) )
92 { 92 {
93 //qDebug("Attendee not equal "); 93 //qDebug("Attendee not equal ");
94 return false; 94 return false;
95 } 95 }
96 a1 = i1.attendees().next(); 96 a1 = i1.attendees().next();
97 a2 = i2.attendees().next(); 97 a2 = i2.attendees().next();
98 } 98 }
99 } 99 }
100 //if ( i1.dtStart() != i2.dtStart() ) 100 //if ( i1.dtStart() != i2.dtStart() )
101 // return false; 101 // return false;
102#if 0 102#if 0
103 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() ); 103 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() );
104 qDebug("1 %d ",i1.duration() == i2.duration() ); 104 qDebug("1 %d ",i1.duration() == i2.duration() );
105 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() ); 105 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() );
106 qDebug("1 %d ",i1.pilotId() == i2.pilotId() ); 106 qDebug("1 %d ",i1.pilotId() == i2.pilotId() );
107 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() ); 107 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() );
108 qDebug("6 %d ",i1.organizer() == i2.organizer() ); 108 qDebug("6 %d ",i1.organizer() == i2.organizer() );
109 109
110#endif 110#endif
111 return ( i1.organizer() == i2.organizer() && 111 return ( i1.organizer() == i2.organizer() &&
112 // i1.uid() == i2.uid() && 112 // i1.uid() == i2.uid() &&
113 // Don't compare lastModified, otherwise the operator is not 113 // Don't compare lastModified, otherwise the operator is not
114 // of much use. We are not comparing for identity, after all. 114 // of much use. We are not comparing for identity, after all.
115 i1.doesFloat() == i2.doesFloat() && 115 i1.doesFloat() == i2.doesFloat() &&
116 i1.duration() == i2.duration() && 116 i1.duration() == i2.duration() &&
117 i1.hasDuration() == i2.hasDuration() && 117 i1.hasDuration() == i2.hasDuration() &&
118 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() ); 118 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() );
119 // no need to compare mObserver 119 // no need to compare mObserver
120} 120}
121 121
122 122
123QDateTime IncidenceBase::getEvenTime( QDateTime dt ) 123QDateTime IncidenceBase::getEvenTime( QDateTime dt )
124{ 124{
125 QTime t = dt.time(); 125 QTime t = dt.time();
126 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 126 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
127 return dt; 127 return dt;
128} 128}
129 129
130 130
131void IncidenceBase::setUid(const QString &uid) 131void IncidenceBase::setUid(const QString &uid)
132{ 132{
133 mUid = uid; 133 mUid = uid;
134 updated(); 134 updated();
135} 135}
136 136
137QString IncidenceBase::uid() const 137QString IncidenceBase::uid() const
138{ 138{
139 return mUid; 139 return mUid;
140} 140}
141 141
142void IncidenceBase::setLastModified(const QDateTime &lm) 142void IncidenceBase::setLastModified(const QDateTime &lm)
143{ 143{
144 // DON'T! updated() because we call this from 144 // DON'T! updated() because we call this from
145 // Calendar::updateEvent(). 145 // Calendar::updateEvent().
146 mLastModified = getEvenTime(lm); 146 mLastModified = getEvenTime(lm);
147 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); 147 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1());
148} 148}
149 149
150QDateTime IncidenceBase::lastModified() const 150QDateTime IncidenceBase::lastModified() const
151{ 151{
152 return mLastModified; 152 return mLastModified;
153} 153}
154 154
155void IncidenceBase::setOrganizer(const QString &o) 155void IncidenceBase::setOrganizer(const QString &o)
156{ 156{
157 // we don't check for readonly here, because it is 157 // we don't check for readonly here, because it is
158 // possible that by setting the organizer we are changing 158 // possible that by setting the organizer we are changing
159 // the event's readonly status... 159 // the event's readonly status...
160 mOrganizer = o; 160 mOrganizer = o;
161 if (mOrganizer.left(7).upper() == "MAILTO:") 161 if (mOrganizer.left(7).upper() == "MAILTO:")
162 mOrganizer = mOrganizer.remove(0,7); 162 mOrganizer = mOrganizer.remove(0,7);
163 163
164 updated(); 164 updated();
165} 165}
166 166
167QString IncidenceBase::organizer() const 167QString IncidenceBase::organizer() const
168{ 168{
169 return mOrganizer; 169 return mOrganizer;
170} 170}
171 171
172void IncidenceBase::setReadOnly( bool readOnly ) 172void IncidenceBase::setReadOnly( bool readOnly )
173{ 173{
174 mReadOnly = readOnly; 174 mReadOnly = readOnly;
175} 175}
176 176
177void IncidenceBase::setDtStart(const QDateTime &dtStart) 177void IncidenceBase::setDtStart(const QDateTime &dtStart)
178{ 178{
179// if (mReadOnly) return; 179// if (mReadOnly) return;
180 mDtStart = getEvenTime(dtStart); 180 mDtStart = getEvenTime(dtStart);
181 updated(); 181 updated();
182} 182}
183 183
184QDateTime IncidenceBase::dtStart() const 184QDateTime IncidenceBase::dtStart() const
185{ 185{
186 return mDtStart; 186 return mDtStart;
187} 187}
188 188
189QString IncidenceBase::dtStartTimeStr() const 189QString IncidenceBase::dtStartTimeStr() const
190{ 190{
191 return KGlobal::locale()->formatTime(dtStart().time()); 191 return KGlobal::locale()->formatTime(dtStart().time());
192} 192}
193 193
194QString IncidenceBase::dtStartDateStr(bool shortfmt) const 194QString IncidenceBase::dtStartDateStr(bool shortfmt) const
195{ 195{
196 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); 196 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt);
197} 197}
198 198
199QString IncidenceBase::dtStartStr(bool shortfmt) const 199QString IncidenceBase::dtStartStr(bool shortfmt) const
200{ 200{
201 return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); 201 return KGlobal::locale()->formatDateTime(dtStart(), shortfmt);
202} 202}
203 203
204 204
205bool IncidenceBase::doesFloat() const 205bool IncidenceBase::doesFloat() const
206{ 206{
207 return mFloats; 207 return mFloats;
208} 208}
209 209
210void IncidenceBase::setFloats(bool f) 210void IncidenceBase::setFloats(bool f)
211{ 211{
212 if (mReadOnly) return; 212 if (mReadOnly) return;
213 mFloats = f; 213 mFloats = f;
214 updated(); 214 updated();
215} 215}
216 216
217 217
218void IncidenceBase::addAttendee(Attendee *a, bool doupdate) 218void IncidenceBase::addAttendee(Attendee *a, bool doupdate)
219{ 219{
220 if (mReadOnly) return; 220 if (mReadOnly) return;
221 if (a->name().left(7).upper() == "MAILTO:") 221 if (a->name().left(7).upper() == "MAILTO:")
222 a->setName(a->name().remove(0,7)); 222 a->setName(a->name().remove(0,7));
223 223
224 mAttendees.append(a); 224 mAttendees.append(a);
225 if (doupdate) updated(); 225 if (doupdate) updated();
226} 226}
227 227
228#if 0 228#if 0
229void IncidenceBase::removeAttendee(Attendee *a) 229void IncidenceBase::removeAttendee(Attendee *a)
230{ 230{
231 if (mReadOnly) return; 231 if (mReadOnly) return;
232 mAttendees.removeRef(a); 232 mAttendees.removeRef(a);
233 updated(); 233 updated();
234} 234}
235 235
236void IncidenceBase::removeAttendee(const char *n) 236void IncidenceBase::removeAttendee(const char *n)
237{ 237{
238 Attendee *a; 238 Attendee *a;
239 239
240 if (mReadOnly) return; 240 if (mReadOnly) return;
241 for (a = mAttendees.first(); a; a = mAttendees.next()) 241 for (a = mAttendees.first(); a; a = mAttendees.next())
242 if (a->getName() == n) { 242 if (a->getName() == n) {
243 mAttendees.remove(); 243 mAttendees.remove();
244 break; 244 break;
245 } 245 }
246} 246}
247#endif 247#endif
248 248
249void IncidenceBase::clearAttendees() 249void IncidenceBase::clearAttendees()
250{ 250{
251 if (mReadOnly) return; 251 if (mReadOnly) return;
252 mAttendees.clear(); 252 mAttendees.clear();
253} 253}
254 254
255#if 0 255#if 0
256Attendee *IncidenceBase::getAttendee(const char *n) const 256Attendee *IncidenceBase::getAttendee(const char *n) const
257{ 257{
258 QPtrListIterator<Attendee> qli(mAttendees); 258 QPtrListIterator<Attendee> qli(mAttendees);
259 259
260 qli.toFirst(); 260 qli.toFirst();
261 while (qli) { 261 while (qli) {
262 if (qli.current()->getName() == n) 262 if (qli.current()->getName() == n)
263 return qli.current(); 263 return qli.current();
264 ++qli; 264 ++qli;
265 } 265 }
266 return 0L; 266 return 0L;
267} 267}
268#endif 268#endif
269 269
270Attendee *IncidenceBase::attendeeByMail(const QString &email) 270Attendee *IncidenceBase::attendeeByMail(const QString &email)
271{ 271{
272 QPtrListIterator<Attendee> qli(mAttendees); 272 QPtrListIterator<Attendee> qli(mAttendees);
273 273
274 qli.toFirst(); 274 qli.toFirst();
275 while (qli) { 275 while (qli) {
276 if (qli.current()->email() == email) 276 if (qli.current()->email() == email)
277 return qli.current(); 277 return qli.current();
278 ++qli; 278 ++qli;
279 } 279 }
280 return 0L; 280 return 0L;
281} 281}
282 282
283Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email) 283Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email)
284{ 284{
285 QPtrListIterator<Attendee> qli(mAttendees); 285 QPtrListIterator<Attendee> qli(mAttendees);
286 286
287 QStringList mails = emails; 287 QStringList mails = emails;
288 if (!email.isEmpty()) { 288 if (!email.isEmpty()) {
289 mails.append(email); 289 mails.append(email);
290 } 290 }
291 qli.toFirst(); 291 qli.toFirst();
292 while (qli) { 292 while (qli) {
293 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) { 293 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) {
294 if (qli.current()->email() == *it) 294 if (qli.current()->email() == *it)
295 return qli.current(); 295 return qli.current();
296 } 296 }
297 297
298 ++qli; 298 ++qli;
299 } 299 }
300 return 0L; 300 return 0L;
301} 301}
302 302
303void IncidenceBase::setDuration(int seconds) 303void IncidenceBase::setDuration(int seconds)
304{ 304{
305 mDuration = seconds; 305 mDuration = seconds;
306 setHasDuration(true); 306 setHasDuration(true);
307} 307}
308 308
309int IncidenceBase::duration() const 309int IncidenceBase::duration() const
310{ 310{
311 return mDuration; 311 return mDuration;
312} 312}
313 313
314void IncidenceBase::setHasDuration(bool b) 314void IncidenceBase::setHasDuration(bool b)
315{ 315{
316 mHasDuration = b; 316 mHasDuration = b;
317} 317}
318 318
319bool IncidenceBase::hasDuration() const 319bool IncidenceBase::hasDuration() const
320{ 320{
321 return mHasDuration; 321 return mHasDuration;
322} 322}
323 323
324void IncidenceBase::setSyncStatus(int stat) 324void IncidenceBase::setSyncStatus(int stat)
325{ 325{
326 if (mReadOnly) return; 326 if (mReadOnly) return;
327 mSyncStatus = stat; 327 mSyncStatus = stat;
328} 328}
329 329
330int IncidenceBase::syncStatus() const 330int IncidenceBase::syncStatus() const
331{ 331{
332 return mSyncStatus; 332 return mSyncStatus;
333} 333}
334 334
335void IncidenceBase::setPilotId( int id ) 335void IncidenceBase::setPilotId( int id )
336{ 336{
337 if (mReadOnly) return; 337 if (mReadOnly) return;
338 mPilotId = id; 338 mPilotId = id;
339} 339}
340 340
341int IncidenceBase::pilotId() const 341int IncidenceBase::pilotId() const
342{ 342{
343 return mPilotId; 343 return mPilotId;
344} 344}
345void IncidenceBase::setZaurusId( int id ) 345void IncidenceBase::setZaurusId( int id )
346{ 346{
347 if (mReadOnly) return; 347 if (mReadOnly) return;
348 mZaurusId = id; 348 mZaurusId = id;
349} 349}
350 350
351int IncidenceBase::zaurusId() const 351int IncidenceBase::zaurusId() const
352{ 352{
353 return mZaurusId; 353 return mZaurusId;
354} 354}
355 355
356int IncidenceBase::zaurusUid() const 356int IncidenceBase::zaurusUid() const
357{ 357{
358 return mZaurusUid; 358 return mZaurusUid;
359} 359}
360void IncidenceBase::setZaurusUid( int id ) 360void IncidenceBase::setZaurusUid( int id )
361{ 361{
362 if (mReadOnly) return; 362 if (mReadOnly) return;
363 mZaurusUid = id; 363 mZaurusUid = id;
364} 364}
365 365
366int IncidenceBase::tempSyncStat() const 366int IncidenceBase::tempSyncStat() const
367{ 367{
368 return mTempSyncStat; 368 return mTempSyncStat;
369} 369}
370void IncidenceBase::setTempSyncStat( int id ) 370void IncidenceBase::setTempSyncStat( int id )
371{ 371{
372 if (mReadOnly) return; 372 if (mReadOnly) return;
373 mTempSyncStat = id; 373 mTempSyncStat = id;
374} 374}
375 375
376void IncidenceBase::setID( const QString & prof , int id ) 376void IncidenceBase::setID( const QString & prof , int id )
377{ 377{
378 int num = mExternalId.find( ":"+prof+";" ); 378 int num = mExternalId.find( ":"+prof+";" );
379 if ( num >= 0 ) { 379 if ( num >= 0 ) {
380 int len = prof.length()+2; 380 int len = prof.length()+2;
381 int end = mExternalId.find( ";", num+len ); 381 int end = mExternalId.find( ";", num+len );
382 if ( end > 0 ) { 382 if ( end > 0 ) {
383 mExternalId = mExternalId.left( num+len ) +QString::number( id)+mExternalId.mid( end ); 383 mExternalId = mExternalId.left( num+len ) +QString::number( id)+mExternalId.mid( end );
384 } else 384 } else
385 qDebug("Error in IncidenceBase::setID "); 385 qDebug("Error in IncidenceBase::setID ");
386 } else { 386 } else {
387 mExternalId += prof+";"+QString::number( id) +";0:"; 387 mExternalId += prof+";"+QString::number( id) +";0:";
388 } 388 }
389 qDebug("setID*%s*%d*%s* ", prof.latin1(), id,mExternalId.latin1() );
389} 390}
390int IncidenceBase::getID( const QString & prof) 391int IncidenceBase::getID( const QString & prof)
391{ 392{
392 int ret = -1; 393 int ret = -1;
393 int num = mExternalId.find(":"+ prof+";" ); 394 int num = mExternalId.find(":"+ prof+";" );
394 if ( num >= 0 ) { 395 if ( num >= 0 ) {
395 int len = prof.length()+2; 396 int len = prof.length()+2;
396 int end = mExternalId.find( ";", num+len ); 397 int end = mExternalId.find( ";", num+len );
397 if ( end > 0 ) { 398 if ( end > 0 ) {
398 bool ok; 399 bool ok;
399 ret = mExternalId.mid ( num + len,end-len-num).toInt( &ok ); 400 ret = mExternalId.mid ( num + len,end-len-num).toInt( &ok );
400 if (!ok) 401 if (!ok)
401 return -1; 402 ret = -1;
402 } 403 }
403 } 404 }
404 return ret; 405 qDebug("getID*%s*%d*%s* ", prof.latin1(), ret,mExternalId.latin1() );
406 return ret;
405} 407}
406 408
407// example :Sharp_DTM;22;23566:TP;-1;8654:TPP;18;0: 409// example :Sharp_DTM;22;23566:TP;-1;8654:TPP;18;0:
408// format name;III;JJJ: III >= 0, may be -1. JJJ always >= 0 410// format name;III;JJJ: III >= 0, may be -1. JJJ always >= 0
409void IncidenceBase::setCsum( const QString & prof , int id ) 411void IncidenceBase::setCsum( const QString & prof , int id )
410{ 412{
411 int num = mExternalId.find( ":"+prof+";"); 413 int num = mExternalId.find( ":"+prof+";");
412 if ( num >= 0 ) { 414 if ( num >= 0 ) {
413 int len = prof.length()+2; 415 int len = prof.length()+2;
414 num = mExternalId.find( ";", num+len ); 416 num = mExternalId.find( ";", num+len );
415 int end = mExternalId.find( ":", num+1 ); 417 int end = mExternalId.find( ":", num+1 );
416 if ( end > 0 ) { 418 if ( end > 0 ) {
417 mExternalId = mExternalId.left( num ) +QString::number(id)+mExternalId.mid( end ); 419 mExternalId = mExternalId.left( num ) +QString::number(id)+mExternalId.mid( end );
418 } else 420 } else
419 qDebug("Error in IncidenceBase::setCsum "); 421 qDebug("Error in IncidenceBase::setCsum ");
420 } else { 422 } else {
421 mExternalId += prof+";-1;"+QString::number( id) +":"; 423 mExternalId += prof+";-1;"+QString::number( id) +":";
422 } 424 }
425 qDebug("setCsum*%s*%d*%s* ", prof.latin1(), id,mExternalId.latin1() );
423} 426}
424int IncidenceBase::getCsum( const QString & prof) 427int IncidenceBase::getCsum( const QString & prof)
425{ 428{
426 int ret = -1; 429 int ret = -1;
427 int num = mExternalId.find( ":"+prof+";" ); 430 int num = mExternalId.find( ":"+prof+";" );
428 if ( num >= 0 ) { 431 if ( num >= 0 ) {
429 int len = prof.length()+2; 432 int len = prof.length()+2;
430 num = mExternalId.find( ";", num+len ); 433 num = mExternalId.find( ";", num+len );
431 int end = mExternalId.find( ":", num+1 ); 434 int end = mExternalId.find( ":", num+1 );
432 if ( end > 0 ) { 435 if ( end > 0 ) {
433 bool ok; 436 bool ok;
434 ret = mExternalId.mid ( num ,end-num).toInt( &ok ); 437 ret = mExternalId.mid ( num ,end-num).toInt( &ok );
435 if (!ok) 438 if (!ok)
436 return -1; 439 ret = -1;
437 } 440 }
438 } 441 }
442 qDebug("getCsum*%s*%d*%s* ", prof.latin1(), ret,mExternalId.latin1() );
439 return ret; 443 return ret;
440} 444}
441 445
442void IncidenceBase::setIDStr( const QString & s ) 446void IncidenceBase::setIDStr( const QString & s )
443{ 447{
444 if (mReadOnly) return; 448 if (mReadOnly) return;
445 mExternalId = s; 449 mExternalId = s;
446} 450}
447 451
448QString IncidenceBase::IDStr() const 452QString IncidenceBase::IDStr() const
449{ 453{
450 return mExternalId ; 454 return mExternalId ;
451} 455}
452void IncidenceBase::registerObserver( IncidenceBase::Observer *observer ) 456void IncidenceBase::registerObserver( IncidenceBase::Observer *observer )
453{ 457{
454 if( !mObservers.contains(observer) ) mObservers.append( observer ); 458 if( !mObservers.contains(observer) ) mObservers.append( observer );
455} 459}
456 460
457void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer ) 461void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer )
458{ 462{
459 mObservers.remove( observer ); 463 mObservers.remove( observer );
460} 464}
461 465
462void IncidenceBase::updated() 466void IncidenceBase::updated()
463{ 467{
464 QPtrListIterator<Observer> it(mObservers); 468 QPtrListIterator<Observer> it(mObservers);
465 while( it.current() ) { 469 while( it.current() ) {
466 Observer *o = it.current(); 470 Observer *o = it.current();
467 ++it; 471 ++it;
468 o->incidenceUpdated( this ); 472 o->incidenceUpdated( this );
469 } 473 }
470} 474}