From kde-pim Thu Jun 30 23:39:06 2005 From: Reinhold Kainhofer Date: Thu, 30 Jun 2005 23:39:06 +0000 To: kde-pim Subject: [Kde-pim] [PATCH] Recurrences Message-Id: <200507010139.06735.reinhold () kainhofer ! com> X-MARC-Message: https://marc.info/?l=kde-pim&m=112017476307741 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1504457523==" --===============1504457523== Content-Type: multipart/signed; boundary="nextPart11923912.Y1zWGaQ20A"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart11923912.Y1zWGaQ20A Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi guys, Here is the patch for libkcal, which implements recurrences much better: http://www.fam.tuwien.ac.at/~reinhold/KOrganizer/RecurrenceRule/ I've also created the patches for the affected apps (KAlarm, Kitchensync,=20 KMobile, KOrganizer, KPilot and KResources). I haven't been able to test th= em=20 all, but at least they compile ;-) The patch is split up into several patches, one for each affected applicati= on.=20 There's also one large patch available for all changes to kdepim. I'd like to commit this weekend so that we have enough time to test (and ne= xt=20 week is the first week after the semester at university, so most of the=20 stress is over for now and I can spend a little more time on coding). So if= =20 you have any objections please tell me ASAP. I might add that these patches will probably still have some bugs, that I=20 missed so far... I wrote lots of test cases, so the methods to calculate th= e=20 recurrence dates should work, but the API changes might still introduce nas= ty=20 bugs. Here's a very quick and incomplete overview of what is implemented by this= =20 patch. There might not be a UI to edit all these possibilities, but at leas= t=20 the library supports them so we can correctly read all this stuff and show= =20 the events at the correct time in korganizer (and in all other apps). And w= ho=20 knows, we might add a UI sooner or later, too: 1) EXRULES are implemented 2) RDATES are implemented 3) all BY* combinations are allowed in the rule (e.g. all fridays the 13th) 4) BYSETPOS implemented (e.g. n-th weekday of the month) 5) exDates are no longer part of the event itself, but part of the recurren= ce=20 (*ALL* recurrence-related things are consistently accessible through the=20 event->recurrence() ) 6) API cleanup The API of the recurrences stayed very similar to the old one, with several= =20 exceptions: =2D) The end date / duration are no longer part of=20 the ::setDaily, ::setWeekly,etc. methods, but have their own methods=20 (setEndDate, setDuration). By default, infinite recurrence is used if none = of=20 these two methods is called =2D) For monthly and yearly recurrences, we don't need the specific type (d= ate=20 vs. nth weekday) in the setMontly/setYearly any more. After you call=20 setMonthly( freq ) or setWeekly( freq ), you can call addMonthlyDay(..) or= =20 addMonthlyDate(..) or addYearlyMonth(...) or addYearlyDay(...) (for n-th da= y=20 of year) or addYearlyDate(...) (for n-th day of the given month). =2D) Instead of our old uint doesRecur(), which also returned the type of t= he=20 recurrence, i changed this to two methods: bool doesRecur() and uint=20 recurrenceType(), which should be self-explaining. =2D) I got rid of the February 29 setting, because all three possibilities = (to=20 recur on Feb 28, Feb 29 or March 1) can be implemented by ordinary recurren= ce=20 settings. No need to add another config flag for this. =2D) Instead of QPtrList, I'm now using QValueList for everything. Some things are not fully working yet: 1) recurring to-dos are probably very broken (I'll need to fix this, but th= e=20 current implement doesn't seem to be rfc-compliant, so I'll need to do=20 something about recurrint to-dos anyway). 2) It's not yet fully rfc2445-compliant (for some weird combinations that=20 involve n-th BYDAY with some other BY* rule (other than BYMONTH!), the=20 recurrence days are not correctly determined) 3) Duration across daylight time changes doesn't work correctly, because ou= r=20 dates don't include the time zone yet (that's a general problem of libkcal). 4) Changes in the recurrence rule don't trigger the event's update yet. I=20 don't want to pass the Incidence* pointer to the recurrence rule (I'd like = to=20 keep the recurrence issues completely separated from the incidence class)..= =2E=20 If we get rid of the Incidence* pointer, we can safely add copying for=20 recurrences and then I suppose kalarm could get rid of several hundred line= s=20 of code, which just implements copying of recurrence data... The affected files are: kalarm/alarmevent.cpp | 218 kalarm/alarmevent.h | 21 kalarm/dcophandler.cpp | 4 kalarm/kalarmapp.cpp | 2 kalarm/recurrenceedit.cpp | 44 kitchensync/libkonnector2/plugins/qtopia/datebook.cpp | 58 kitchensync/libkonnector2/plugins/qtopia/metacalendar.cpp | 2 kitchensync/libksync/calendarmerger.cpp | 2 kmobile/devices/gnokii/gnokii_mobile.cpp | 2 korganizer/calendarview.cpp | 3 korganizer/koagendaview.cpp | 10 korganizer/kodaymatrix.cpp | 3 korganizer/koeditorrecurrence.cpp | 257 korganizer/komonthview.cpp | 2 korganizer/printing/calprinthelper.cpp | 8 kpilot/conduits/vcalconduit/vcal-conduit.cc | 77 kpilot/lib/Makefile.am | 2 kpilot/lib/pilotDateEntry.cc | 2 kresources/egroupware/kcal_resourcexmlrpc.cpp | 125 kresources/groupwise/soap/incidenceconverter.cpp | 85 kresources/kolab/kcal/incidence.cpp | 89 kresources/newexchange/exchangeconvertercalendar.cpp | 6 kresources/slox/kcalresourceslox.cpp | 25 libkcal/Makefile.am | 2 libkcal/calendar.cpp | 10 libkcal/calendarlocal.cpp | 32 libkcal/calformat.cpp | 24 libkcal/calformat.h | 2 libkcal/compat.cpp | 112 libkcal/compat.h | 12 libkcal/icalformat.cpp | 7 libkcal/icalformat.h | 6 libkcal/icalformatimpl.cpp | 778 -- libkcal/icalformatimpl.h | 10 libkcal/incidence.cpp | 166 libkcal/incidence.h | 95 libkcal/incidenceformatter.cpp | 28 libkcal/kcalversion.h | 4 libkcal/qtopiaformat.cpp | 28 libkcal/recurrence.cpp | 3819 ++---------= =2D-- libkcal/recurrence.h | 429 - libkcal/resourcekabc.cpp | 12 libkcal/tests/Makefile.am | 58 libkcal/tests/checkcalendar.pl | 123 libkcal/tests/testincidence.cpp | 3 libkcal/tests/testincidencegenerator.h | 3 libkcal/todo.cpp | 2 libkcal/vcalformat.cpp | 210 libkdepim/calendardiffalgo.cpp | 5 libkpimexchange/core/exchangedownload.cpp | 20 libkpimexchange/core/exchangeupload.cpp | 6 51 files changed, 2011 insertions(+), 5042 deletions(-) Cheers, Reinhold =2D-=20 =2D----------------------------------------------------------------- Reinhold Kainhofer, Vienna, Austria email: reinhold@kainhofer.com, http://reinhold.kainhofer.com/ * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at * K Desktop Environment, http://www.kde.org/, KOrganizer / KPilot maintain= er --nextPart11923912.Y1zWGaQ20A Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBCxIKaTqjEwhXvPN0RAinCAJ4vOxTyDj/BqsnIkEXF6piiXadDNgCgigZf x0oihD7L3B/3BHCo3G1OiDY= =k5LV -----END PGP SIGNATURE----- --nextPart11923912.Y1zWGaQ20A-- --===============1504457523== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-pim mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim kde-pim home page at http://pim.kde.org/ --===============1504457523==--