diff options
author | Wulf Krueger <philantrop@gentoo.org> | 2007-10-04 19:15:40 +0000 |
---|---|---|
committer | Wulf Krueger <philantrop@gentoo.org> | 2007-10-04 19:15:40 +0000 |
commit | ae24ec955c38d4a1699290212fa7829fef2b930a (patch) | |
tree | 981fa069a88d21a7ea48dc5d9665ae949cce7bcb /kde-base/libkcal | |
parent | Stable on amd64 wrt bug #194721 (diff) | |
download | gentoo-2-ae24ec955c38d4a1699290212fa7829fef2b930a.tar.gz gentoo-2-ae24ec955c38d4a1699290212fa7829fef2b930a.tar.bz2 gentoo-2-ae24ec955c38d4a1699290212fa7829fef2b930a.zip |
Added an upstream patch to fix problems with recurring events. Fixes bug 194371.
(Portage version: 2.1.3.11)
Diffstat (limited to 'kde-base/libkcal')
-rw-r--r-- | kde-base/libkcal/ChangeLog | 9 | ||||
-rw-r--r-- | kde-base/libkcal/files/digest-libkcal-3.5.7-r2 | 6 | ||||
-rw-r--r-- | kde-base/libkcal/files/libkcal-3.5.7-recurring_194371.patch | 256 | ||||
-rw-r--r-- | kde-base/libkcal/libkcal-3.5.7-r2.ebuild | 29 |
4 files changed, 299 insertions, 1 deletions
diff --git a/kde-base/libkcal/ChangeLog b/kde-base/libkcal/ChangeLog index 2c1ee21a1973..da952bf81a09 100644 --- a/kde-base/libkcal/ChangeLog +++ b/kde-base/libkcal/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for kde-base/libkcal # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/libkcal/ChangeLog,v 1.85 2007/08/11 16:56:46 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/libkcal/ChangeLog,v 1.86 2007/10/04 19:15:39 philantrop Exp $ + +*libkcal-3.5.7-r2 (04 Oct 2007) + + 04 Oct 2007; Wulf C. Krueger <philantrop@gentoo.org> + +files/libkcal-3.5.7-recurring_194371.patch, +libkcal-3.5.7-r2.ebuild: + Added an upstream patch to fix problems with recurring events. Fixes bug + 194371. 11 Aug 2007; Raúl Porcel <armin76@gentoo.org> libkcal-3.5.7-r1.ebuild: x86 stable wrt #185823 diff --git a/kde-base/libkcal/files/digest-libkcal-3.5.7-r2 b/kde-base/libkcal/files/digest-libkcal-3.5.7-r2 new file mode 100644 index 000000000000..c779ca922394 --- /dev/null +++ b/kde-base/libkcal/files/digest-libkcal-3.5.7-r2 @@ -0,0 +1,6 @@ +MD5 bf6b46337388fa6a93c9084d3d2c4509 kdepim-3.5-patchset-04.tar.bz2 133990 +RMD160 9d9fd1e7b04512f1f28bba78d5eeadfc3e3280ba kdepim-3.5-patchset-04.tar.bz2 133990 +SHA256 8b1968a7bef8ab2efdb2d87e96943ce636775b76365bc1bc99e1e377f9abfc61 kdepim-3.5-patchset-04.tar.bz2 133990 +MD5 8571db6dcf4168614c96bb72c493f931 kdepim-3.5.7.tar.bz2 14166061 +RMD160 14c05d4620abf1eb5421ad434dc63f037069e930 kdepim-3.5.7.tar.bz2 14166061 +SHA256 9d981d372f1822662e102b6f84f046e4df771641fc4d041aae81b8fafd47b32e kdepim-3.5.7.tar.bz2 14166061 diff --git a/kde-base/libkcal/files/libkcal-3.5.7-recurring_194371.patch b/kde-base/libkcal/files/libkcal-3.5.7-recurring_194371.patch new file mode 100644 index 000000000000..990b09408d89 --- /dev/null +++ b/kde-base/libkcal/files/libkcal-3.5.7-recurring_194371.patch @@ -0,0 +1,256 @@ +--- branches/KDE/3.5/kdepim/libkcal/calendarlocal.cpp 2007/10/01 17:04:23 719674 ++++ branches/KDE/3.5/kdepim/libkcal/calendarlocal.cpp 2007/10/01 17:04:57 719675 +@@ -401,62 +401,75 @@ + bool inclusive ) + { + Event::List eventList; ++ QDate yesterStart = start.addDays(-1); + + // Get non-recurring events + EventDictIterator it( mEvents ); + for( ; it.current(); ++it ) { + Event *event = *it; +- if ( event->doesRecur() ) { +- QDate rStart = event->dtStart().date(); +- bool found = false; +- if ( inclusive ) { +- if ( rStart >= start && rStart <= end ) { +- // Start date of event is in range. Now check for end date. +- // if duration is negative, event recurs forever, so do not include it. +- if ( event->recurrence()->duration() == 0 ) { // End date set +- QDate rEnd = event->recurrence()->endDate(); +- if ( rEnd >= start && rEnd <= end ) { // End date within range +- found = true; +- } +- } else if ( event->recurrence()->duration() > 0 ) { // Duration set +- // TODO: Calculate end date from duration. Should be done in Event +- // For now exclude all events with a duration. ++ ++ QDate rStart = event->dtStart().date(); ++ if (end < rStart) { ++ kdDebug(5800) << "Skipping event starting after TOI" << endl; ++ continue; ++ } ++ if ( inclusive && rStart < start) { ++ kdDebug(5800) << "Skipping event starting before TOI while inclusive" << endl; ++ continue; ++ } ++ ++ if ( ! event->doesRecur() ) { // non-recurring events ++ QDate rEnd = event->dtEnd().date(); ++ if (rEnd < start) { ++ kdDebug(5800) << "Skipping event ending before TOI" << endl; ++ continue; ++ } ++ if ( inclusive && end < rEnd ) { ++ kdDebug(5800) << "Skipping event ending after TOI while inclusive" << endl; ++ continue; ++ } ++ } else { // recurring events ++ switch ( event->recurrence()->duration() ) { ++ case -1: // infinite ++ if ( inclusive ) { ++ kdDebug(5800) << "Skipping infinite event because inclusive" << endl; ++ continue; + } +- } +- } else { +- if ( rStart <= end ) { // Start date not after range +- if ( rStart >= start ) { // Start date within range +- found = true; +- } else if ( event->recurrence()->duration() == -1 ) { // Recurs forever +- found = true; +- } else if ( event->recurrence()->duration() == 0 ) { // End date set +- QDate rEnd = event->recurrence()->endDate(); +- if ( rEnd >= start && rEnd <= end ) { // End date within range +- found = true; +- } +- } else { // Duration set +- // TODO: Calculate end date from duration. Should be done in Event +- // For now include all events with a duration. +- found = true; ++ break; ++ case 0: // end date given ++ default: // count given ++ QDate rEnd = event->recurrence()->endDate(); ++ if ( ! rEnd.isValid() ) { ++ kdDebug(5800) << "Skipping recurring event without occurences" << endl; ++ continue; + } +- } +- } ++ if ( rEnd < start ) { ++ kdDebug(5800) << "Skipping recurring event ending before TOI" << endl; ++ continue; ++ } ++ if ( inclusive && end < rEnd ) { ++ kdDebug(5800) << "Skipping recurring event ending after TOI while inclusive" << endl; ++ continue; ++ } ++ /* FIXME: too much conversion between QDate and QDateTime makes this useless: ++ * freebusy(end=QDateTime(day, "00:00:00")) -> ++ * rawEvents(end=QDate(day)) -> ++ * durationTo(QDateTime(day, "23:59:59")) ++ * so events repeating at the end day match and are included. ++ */ ++#if 0 ++ int durationBeforeStart = event->recurrence()->durationTo(yesterStart); ++ int durationUntilEnd = event->recurrence()->durationTo(end); ++ if (durationBeforeStart == durationUntilEnd) { ++ kdDebug(5800) << "Skipping recurring event without occurences in TOI" << endl; ++ continue; ++ } ++#endif ++ break; ++ } // switch(duration) ++ } // if(doesRecur) + +- if ( found ) eventList.append( event ); +- } else { +- QDate s = event->dtStart().date(); +- QDate e = event->dtEnd().date(); +- +- if ( inclusive ) { +- if ( s >= start && e <= end ) { +- eventList.append( event ); +- } +- } else { +- if ( s <= end && e >= start ) { +- eventList.append( event ); +- } +- } +- } ++ eventList.append( event ); + } + + return eventList; +--- branches/KDE/3.5/kdepim/libkcal/recurrencerule.cpp 2007/10/01 17:04:23 719674 ++++ branches/KDE/3.5/kdepim/libkcal/recurrencerule.cpp 2007/10/01 17:04:57 719675 +@@ -558,28 +558,22 @@ + setDirty(); + } + +- + QDateTime RecurrenceRule::endDt( bool *result ) const + { + if ( result ) *result = false; + if ( mPeriod == rNone ) return QDateTime(); +- if ( mDuration < 0 ) { +- if ( result ) result = false; +- return QDateTime(); +- } else if ( mDuration == 0 ) { ++ if ( mDuration < 0 ) return QDateTime(); ++ if ( mDuration == 0 ) { ++ if ( result ) *result = true; + return mDateEnd; +- } else { +- // N occurrences. Check if we have a full cache. If so, return the cached end date. +- if ( ! mCached ) { +- // If not enough occurrences can be found (i.e. inconsistent constraints) +- if ( !buildCache() ) { +- if ( result ) result = false; +- return QDateTime(); +- } +- } +- return mCachedDateEnd; + } +- return QDateTime(); ++ // N occurrences. Check if we have a full cache. If so, return the cached end date. ++ if ( ! mCached ) { ++ // If not enough occurrences can be found (i.e. inconsistent constraints) ++ if ( !buildCache() ) return QDateTime(); ++ } ++ if ( result ) *result = true; ++ return mCachedDateEnd; + } + + void RecurrenceRule::setEndDt( const QDateTime &dateTime ) +--- branches/KDE/3.5/kdepim/libkcal/tests/Makefile.am 2007/10/01 17:04:23 719674 ++++ branches/KDE/3.5/kdepim/libkcal/tests/Makefile.am 2007/10/01 17:04:57 719675 +@@ -4,6 +4,7 @@ + check_PROGRAMS = testtostring \ + testincidence \ + testcalendar \ ++ fbrecurring \ + readandwrite \ + testresource \ + testfields \ +@@ -28,6 +29,10 @@ + testtostring_LDFLAGS = $(all_libraries) $(KDE_RPATH) + testtostring_LDADD = ../libkcal.la + ++fbrecurring_SOURCES = fbrecurring.cpp ++fbrecurring_LDFLAGS = $(all_libraries) $(KDE_RPATH) ++fbrecurring_LDADD = ../libkcal.la ++ + readandwrite_SOURCES = readandwrite.cpp + readandwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) + readandwrite_LDADD = ../libkcal.la +@@ -78,10 +83,10 @@ + perl $(srcdir)/runtestcase.pl readandwrite "ical" $$i; \ + done; \ + for i in `find $(srcdir)/data/vCalendar/ -name "*.ics"`; do \ +- perl $(srcdir)/runtestcase.pl testvcalexport "vcal" $$i; \ ++ perl $(srcdir)/runtestcase.pl testvcalexport "vcal" $$i; \ + done; + for i in `find $(srcdir)/data/vCalendar/ -name "*.vcs"`; do \ +- perl $(srcdir)/runtestcase.pl readandwrite "ical" $$i; \ ++ perl $(srcdir)/runtestcase.pl readandwrite "ical" $$i; \ + done; + [ ! -e FAILED ] + +--- branches/KDE/3.5/kdepim/libkcal/tests.orig/fbrecurring.cpp 2007-08-31 20:52:15.220373203 +0200 ++++ branches/KDE/3.5/kdepim/libkcal/tests/fbrecurring.cpp 2007-10-04 19:53:52.000000000 +0200 +@@ -0,0 +1,52 @@ ++ ++#include "icalformat.h" ++#include "event.h" ++#include "calendarlocal.h" ++ ++#include <libkcal/freebusy.h> ++#include <iostream> ++ ++using namespace KCal; ++using namespace std; ++ ++int main() ++{ ++ ICalFormat f; ++ ++ CalendarLocal cal( QString::fromLatin1("UTC") ); ++ ++ Event *event1 = new Event; ++ event1->setSummary("A"); ++ event1->setDtStart( QDateTime(QDate(2006,1,1), QTime(12,0,0)) ); ++ //event1->setDuration(60*60); ++ event1->setDtEnd( QDateTime(QDate(2006,1,1), QTime(13,0,0)) ); ++ event1->setFloats(FALSE); ++ event1->recurrence()->setDaily( 1 ); ++ //event1->recurrence()->setDuration( 2 ); ++ event1->recurrence()->setEndDateTime( QDateTime(QDate(2006,1,3), QTime(13,0,0)) ); ++ cout << f.toICalString(event1).latin1() << endl; ++ cal.addEvent(event1); ++ ++ Event *event2 = new Event; ++ event2->setSummary("B"); ++ event2->setDtStart( QDateTime(QDate(2006,1,1), QTime(13,0,0)) ); ++ //event2->setDuration(60*60); ++ event2->setDtEnd( QDateTime(QDate(2006,1,1), QTime(14,0,0)) ); ++ event2->setFloats(FALSE); ++ event2->recurrence()->setDaily( 1 ); ++ //event2->recurrence()->setDuration( 3 ); ++ event2->recurrence()->setEndDateTime( QDateTime(QDate(2006,1,4), QTime(13,0,0)) ); ++ cout << f.toICalString(event2).latin1() << endl; ++ cal.addEvent(event2); ++ ++ Calendar *c = &cal; ++ ++ QDateTime start = QDateTime(QDate(2006,1,2), QTime(0,0,0)); ++ QDateTime end = QDateTime(QDate(2006,1,3), QTime(0,0,0)); ++ ++ FreeBusy *freebusy = new FreeBusy( c, start, end ); ++ QString result = f.createScheduleMessage( freebusy, Scheduler::Publish ); ++ cout << result.latin1() << endl; ++ ++ return 0; ++} diff --git a/kde-base/libkcal/libkcal-3.5.7-r2.ebuild b/kde-base/libkcal/libkcal-3.5.7-r2.ebuild new file mode 100644 index 000000000000..50f7f09cbb3a --- /dev/null +++ b/kde-base/libkcal/libkcal-3.5.7-r2.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/libkcal/libkcal-3.5.7-r2.ebuild,v 1.1 2007/10/04 19:15:39 philantrop Exp $ + +KMNAME=kdepim +MAXKDEVER=$PV +KM_DEPRANGE="$PV $MAXKDEVER" +inherit kde-meta eutils + +SRC_URI="${SRC_URI} + mirror://gentoo/kdepim-3.5-patchset-04.tar.bz2" + +DESCRIPTION="KDE kcal library for KOrganizer etc" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="" + +DEPEND="$(deprange $PV $MAXKDEVER kde-base/ktnef)" +RDEPEND="${DEPEND}" + +KMCOPYLIB="libktnef ktnef/lib" +KMEXTRACTONLY="libkdepim/email.h" +KMCOMPILEONLY="libemailfunctions/" + +PATCHES="${FILESDIR}/${P}-recurring_194371.patch" + +src_unpack() { + kde-meta_src_unpack + sed -e "s:SUBDIRS = libical versit tests:SUBDIRS = libical versit:" -i libkcal/Makefile.am +} |