[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdepim
From:       David Faure <dfaure () kdab ! net>
Date:       2009-01-08 16:40:23
Message-ID: 200901081740.24039.dfaure () kdab ! net
[Download RAW message or body]

On Wednesday 07 January 2009, Thomas McGuire wrote:
> +#ifdef Q_WS_MACX
> + // ### This quits the application prematurely, for example when the \
> composer window + // ### is closed while the main application is \
> minimized to the systray +  connect( qApp, SIGNAL(lastWindowClosed()), \
> qApp, SLOT(quit())); +#endif

Yep, the comment is right, this is exactly why you should not have such a \
connect in kmail or kontact... Instead, KDE apps use the KGlobal::ref/deref \
mechanism. Each user-visible thing that should keep the app alive does a \
ref on creation and a deref on destruction, like kmainwindows, systray \
icons, running kio jobs, etc. More info in the apidox for KGlobal::ref().

If the app doesn't exit, then you'll have to debug where the remaining \
ref(s) are. No idea off hand why it would be different on the mac though.
Note that the kdelibs code for this (kglobal, kmainwindow and ksystemtray) \
has been changed until a few months ago, so it would be worth just removing \
the connect and trying again with kdelibs-4.2 or trunk.

-- 
David Faure, faure@kde.org, dfaure@kdab.net
KDE/KOffice developer, Qt consultancy projects
Klarälvdalens Datakonsult AB, Platform-independent software solutions


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic