[PATCH] ksystemtray.cpp

Martijn Klingens klingens at kde.org
Sat Apr 13 12:09:01 BST 2002


On Saturday 13 April 2002 09:22, Simon Hausmann wrote:
> I think it is a bad idea to call qApp->quit() from a library class,
> because it unconditionally aborts the application, completely
> disobeying KApplication's reference counting (which exists for the
> very reason of preventing leaving the event loop in case there are
> still background jobs like KIO tranfers) .
>
> What was wrong with closeAllWindows() ?

Closing the main window in the case of a systray app should usually leave the 
app running in the tray. So essentially you'll override closeEvent() to hide 
the window instead of closing it and everybody's happy... unless you select 
'quit' from the tray which now no longer quits and acts like a window close.

And that's the problem we have with Kopete. I figured there could be two cases 
here, either the libs are broken or our app is broken. Since I always thought 
that 'quit' means 'quit', and not 'close all windows' I wrote this patch. 
Your remark on background KIO transfers makes sense though, in which case 
apparently Kopete is borked. I wonder what the solution is in that case, 
though. The only solution I see is to have an additional invisible main 
window, so the closing of the first doesn't trigger the quit yet. Ugly as 
well. Any better idea?

Martijn





More information about the kde-core-devel mailing list