Taskmanager with grouping support preview version
Aaron J. Seigo
aseigo at kde.org
Wed Jul 9 02:55:37 CEST 2008
On Tuesday 08 July 2008, christian mollekopf wrote:
> I'm not comletely sure but i believe you told me that i shouldn't make the
> AbstractGroupableItem guarded. If i would do that, i would pass
> AbstractGroupableItem pointers to GroupingStrategy which should store all
> items. This would result in a list of unguarded Task pointers and thats
> obviously not what we want.
not at all. as long as TaskItem holds a TaskPtr (and NOT a Task* via
TaskPtr::data()) then the TaskPtr will last as long as the TaskItem does. as
long as TaskItem has clear ownership (e.g. "always owned by the group it is
in") then there will be no problems.
> Would you just not derive the Task from AbstractGroupableItem but rather
> let the AbstractGroupableItem hold TaskPtr?
that's one possibility.
the other is to get rid of AbstractGroupableItem altogether and have just
TaskGroup which contains collections of TaskPtrs and not put any grouping
logic into Task itself.
either way works, but Task should not be tied into grouping directly.
> If this is the case one would
> have to do abstractGroupableItem->taskPtr()->someTaskFuncion(); which
> wouldn't be nice as i think.
not really. you could either forward the API (so abstractGroupableItem-
>someTaskFuntion() is implemented as:
returnType AbstractGroupableItem::someTaskFunction()
{
return d->task->someTaskFunction();
}
or just make groups manage TaskPtrs directly and keep all bookeeping in
GroupingStrategy and TaskGroup.
it's really about clear lines of ownership. i'd suggest that:
Task is "owned" by the windowing system (so it can come or go at *any* time),
ergo TaskPtr. each Task object can be used simultaneously by any combination
of TaskGroup, GroupingStrategy or visualization (which may use TaskPtr
directly; the pager is an example of that)
GroupingStrategy is owned by the visualization (e.g. a taskbar, or a kasbar,
or .... )
TaskGroup is owned by the GroupingStrategy (making them ultimately owned by
the visualization)
A visualization is a self-contained non-shared unit
--
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43
KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080708/b2cc673a/attachment-0001.pgp
More information about the Panel-devel
mailing list