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

List:       kde-pim
Subject:    Re: [Kde-pim] Calendar::getAllEvents
From:       Adriaan de Groot <adridg () cs ! kun ! nl>
Date:       2002-01-27 21:34:57
[Download RAW message or body]

On Sunday 27 January 2002 14:36, Cornelius Schumacher wrote:
> On Saturday 26 January 2002 15:10, Adriaan de Groot wrote:
> > Would a code snippet like the following (based loosely on the libkcal
> > from KDE 2.2.2) change the calendar?
> >
> > 	QList<Event> l = calendar.getAllEvents();
> > 	Event *e = l.first();
> > 	e->setDescription("Moose");
> > 	calendar.save();
>
> Yes, it changes the calendar.

Could we add 

const QList<Event> &CalendarLocal::getAllEvents() 
{ return *mCal 

... oh, rats. The internal data structure isn't a list at all. I'm just 
wondering about how we can make things like searching in a calendar fast for 
applications in general. What KPilot does now is:

1) get the list of all events
2) search it to find an Event * with a particular Pilot id
3) throw it away

perhaps a find() function could be implemented in Calendar?

> This comment is probably outdated (It is at least two years old).

OK, I'll take your word for it :)


> The intended behaviour is the following: As soon as an event (or any
> other subclass of Incidence) object is added to the Calendar by
> addEvent() it is owned by the Calendar object. The Calendar takes care
> of deleting it. All Events returned by the query functions are returned
> as pointers, that means all changes to the returned events are
> immediately visible in the Calendar. You shouldn't delete any Event
> object you get from Calendar.

Excellent. Can we add that as a comment to calendar.h? 
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://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