[Panel-devel] Combining startup notifications and tasks

Jason Stubbs j.stubbs at linkthink.co.jp
Thu Dec 20 03:05:13 CET 2007


On Thursday 20 December 2007 01:55:34 Aaron J. Seigo wrote:
> the annoyance with this approach is that now the WindowTaskItem class will
> get filled with "if (startup)" type code. we had this situation in kicker's
> taskbar as well and it doesn't make for pretty code.
>
> i see why you're doing what you've done here (re-use the existing startup
> task graphical item) ... i wonder if it couldn't simply replace the startup
> item with the new task item rather than make them the same literal object.
> ...
> going the delegate-does-the-painting route is probably the best solution,
> but is a fair amount more coding and changing things around. your patch is
> ok for now, but perhaps you could put a comment in the code at an
> appropriate point about this? =)

Yep, I entertained the notion too but went for the minimal-change approach. 
I'll code up the delegate approach and resubmit. I'm giving myself Sunday as 
a deadline for each task I choose in a week and this shouldn't take longer 
than that. ;)

> i don't like that the constructor has yet another parameter, however. would
> be nicer to see a setStartupId(const KStartupInfoId &) instead.

That's what I originally had too, but I don't really like it being part of the 
public API.

> keeping the startupid around forever is also a bit unfortunate.
> ...
> so i'd instead add a list to Startup of related windowIDs (or even
> TaskPtrs?). then one simply calls startup->matches(task); and it looks in
> its internal list.
> ...
> this way the bookkeeping information is only kept around as long as the
> startup item is in libtaskmanager. which makes more sense to me at least.

This sounds good to me too. Will have another patch in a jiffy (offset by work 
hours and travel time ;)

> (oh, btw, instead of moving the whole Startup class in the header, you
> could have simply forward declared it with "class Startup;" =)

I moved the whole class to get access to the Startup::StartupPtr typedef. Is 
there a way to forward declare that?

-- 
LINKTHINK INC.
東京都渋谷区桜ヶ丘町22-14 N.E.S S棟 3F
TEL 03-5728-4772  FAX 03-5728-4773
Jason Stubbs <j.stubbs at linkthink.co.jp>


More information about the Panel-devel mailing list