Question about way of adding timezones support to clock

Sebastian Kuegler sebas at kde.org
Mon Mar 17 12:35:58 CET 2008


On Monday 17 March 2008 12:29:45 Rafał Miłecki wrote:
> I wish to add support for displaying list of choosen timezones in
> clock's tooltip.

Cool, apparently it's a much wanted feature :)

> Currently we use
> dataEngine("time")->connectSource(timezone, ...);
> and we don't care about time in timezone anymore. It is given to us by
> timer and "data" argument in
> void Clock::dataUpdated(const QString& source, const
> Plasma::DataEngine::Data &data);
>
> My idea is to change every "timezone" argument to hard-coded string
> "Local". That would still allow me to reveice timer's calling
> "dataUpdated" so I won't need to create my own timer. The bad side of
> this idea is that I'll have to manage timezones myself (I can't use
> other sources from dataEngine("time").
>
> So as result:
> 1) I connect "Local" source from dataEngine("time")
> 2) In dataUpdate I use local time and QDataTime for getting time for
> choosen timezones
>
> Is my idea acceptable? Or could it be resolved in other, better way?
> It's may first time using DataEngine and I am new in C++ and
> developing KDE so I'm not really sure of that.

Why don't you just connect to the dataSource for all the timezones you want? 
The requests should be bundled by the DataEngine anyway, and you get nice and 
clean data out of the DataEngine that way.
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080317/0116de62/attachment.pgp 


More information about the Panel-devel mailing list