Version: 1.9.51 (using 4.00.81 (KDE 4.0.81 >= 20080527), compiled sources) Compiler: gcc OS: Linux (i686) release 2.6.25-ARCH KMail quits fter these steps: 1. start kmail; 2. click "new" button to create new message; 3. then close main window to tray; 4. and finnaly close message window.
*** Bug 163154 has been marked as a duplicate of this bug. ***
Confirmed. Probably a regression in Qt4.4, the behaviour of quitOnLastWindowClosed() seems to have changed.
OK, here's what dfaure suggested on IRC: 1. disable Qt's quitOnLastWindowClosed() in KMail and Kontact 2. Make it optional that KJobs do KGlobal::ref()/deref() -> KJob::allowQuitWhileJobsAreRunning(bool) 3. KGlobal::deref() will then take care of quitting the event loop. Both the mainwindows and the systemtray hold refs. Instead of 1), it might also be possible to disable the WA_QuitOnClose flags for KDE mainwindows. I'll need to investigate which jobs shouldn't be killed when quitting KMail, those jobs should call ref().
2) is not needed after all; the abortMailCheck and cancelMailCheck in the kmmainwin and kmailpart destructors take care of allowing kmail to quit even while a mailcheck is happening.
SVN commit 830027 by tmcguire: Fix detection when to quit the main loop, by disabling Qt's quitOnLastWindowClosed(), which would cause KMail to exit when the user OK'd a message box while KMail was mimimized to the systray. Implement cancelMailCheck() for POP accounts, so that those stop when quitting KMail. Also abort mail checks when using File->Quit in the menu and the systray is active. BUG: 163479 M +2 -2 kmail/kmcommands.cpp M +1 -1 kmail/kmmainwin.cpp M +7 -0 kmail/main.cpp M +6 -0 kmail/popaccount.cpp M +5 -0 kmail/popaccount.h M +8 -0 kontact/src/main.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=830027
SVN commit 831845 by tmcguire: Also quit the event loop when a part still holds a reference to a KGlobal object, probably by a KJob which wasn't properly deleted. This fixes that the Kontact process was still running (without a window) after viewing an article in Akregator. The real fix would be to fix Akregator, it should take care of properly cleaning up each KJob. @David: maybe KJob::allowQuitWhileJobsAreRunning(bool) wasn't such a bad idea after all? CCBUG: 163479 BUG: 166367 M +6 -0 mainwindow.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=831845