[Kget] [PATCH] Global percentage support in system tray icon

Lukas Appelhans l.appelhans at gmx.de
Sat Apr 18 15:51:34 CEST 2009


On Samstag 18 April 2009 13:34:12 Nikhil Marathe wrote:
> Hi,
>
> I've added the observer classes to allow the system tray to receive
> transfer related events. This should allow the implementation of a
> detailed tooltip and also an amarok-like gradually filling icon. At
> the moment I've set it to display the global percentage when downloads
> are running.
>
> I'm not sure if Tray should be a friend of MainWindow just to get the
> percentage, but I wanted to avoid the repeated calculation code.
>
> Patch can be applied in kdenetwork/kget.
>
> Thanks,
> Nikhil
Hey!

Looks quite ok to me, but the Tray class needs to inherit from ModelObserver 
to be one actually... :)

Also:
void slotUpdatePercent() {updatePercent();}

Why not just merge both methods?

Also the friendship seems a bit too hackish to me, just make 
MainWindow::transfersPercent() public, or do the calculation in KGet:: 
class...

Lukas


More information about the Kget mailing list