[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] [PATCH] Recurrences
From:       David Jarvie <software () astrojar ! org ! uk>
Date:       2005-07-03 19:15:20
Message-ID: 200507032015.21246.software () astrojar ! org ! uk
[Download RAW message or body]

On Sunday 03 Jul 2005 14:51, Reinhold Kainhofer wrote:
> Am Samstag, 2. Juli 2005 19:54 schrieb David Jarvie:
> > On Friday 01 Jul 2005 00:39, Reinhold Kainhofer wrote:
> > Is it really sensible to remove the variants of methods such as
> > setRecurStart(), durationTo(), etc., which take a 'const QDate&'
> > parameter. This is a more logical way to do things for recurrences which
> > float, and also for non-sub-daily recurrence types when you're really
> > interested in the date rather than the time. For example, to find the
> > number of recurrences up to and including a certain date, you would have
> > to call durationTo(QDateTime(date, QTime(23:59:59))
> > instead of simply
> >       durationTo(date).
> > I can't see any real disadvantage of retaining these QDate versions,
>
> The API gets bloated by a factor 2. Besides, what's so bad about
> durationTo(QDateTime(date))?

If you have a non-sub-daily recurrence with a time (i.e. not floating), you 
can't just specify QDateTime(date) for durationTo(), for example. If you did, 
the reply would omit the recurrence on the date you specified, since the time 
in the parameter would default to 00:00:00, when you actually need to specify 
23:59:59.

> For floating events, the time part will be ignored, so it doesn't matter to
> what you set it (That's not yet working 100%).

For floating events, I'm not so concerned.

> If we also add methods that take QDate, we'll practically have to duplicate
> everything in the recurrence class, with one version that combines all
> QDates from the RecurrenceRules, and one that combines all QDateTimes from
> the RecurrenceRules. Is this really worth it?

Surely better to duplicate the code (which would involve simple wrapper calls 
to convert from QDate to QDateTime) in the library, rather than everybody 
using the library potentially having to duplicate the code. That, after all, 
is the purpose of a library, to share code so that people don't have to 
reimplement the same stuff. I know it's a relatively trivial thing in this 
case, but I still think the principle holds.

> > and
> > they do bring extra convenience for people using the class.
>
> And lot of extra work for the people maintaining the class ;-)

I don't think it's really much work to maintain simple wrapper methods. Again, 
rather that than callers having to maintain it.

Cheers,
David.
-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/linux/kalarm.html
_______________________________________________
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/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic