[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.1/kdelibs
From: Rafael Fernández López <ereslibre () kde ! org>
Date: 2008-08-01 0:14:54
Message-ID: 1217549694.632025.19674.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 840377 by ereslibre:
When the tagging was done, the problematic patch did get into. This is a backport of \
the fix for this problem. This commit has been into 4.2 (trunk) for several days now, \
so I am backporting it.
BUG: 167826
M +13 -5 kdecore/kernel/kglobal.cpp
M +5 -0 kdeui/widgets/kmainwindow.cpp
--- branches/KDE/4.1/kdelibs/kdecore/kernel/kglobal.cpp #840376:840377
@@ -251,11 +251,14 @@
/**
* This counter indicates when to quit the application.
- * It starts at 1, is decremented in KMainWindow when the last window is closed, but
- * is incremented by operations that should outlive the last window closed
- * (e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail \
client). + * It starts at 0, is incremented by KMainWindow, systray icons, running \
jobs, etc. + * and decremented again when those things are destroyed.
+ * This mechanism allows dialogs and jobs to outlive the last window closed
+ * e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail \
client, + * the job progress widget with "keep open" checked, etc.
*/
-static int s_refCount = 1;
+static int s_refCount = 0;
+static bool s_allowQuit = false;
void KGlobal::ref()
{
@@ -267,9 +270,14 @@
{
--s_refCount;
//kDebug() << "KGlobal::deref() : refCount = " << s_refCount;
- if (s_refCount <= 0) {
+ if (s_refCount <= 0 && s_allowQuit) {
QCoreApplication::instance()->quit();
}
}
+void KGlobal::setAllowQuit(bool allowQuit)
+{
+ s_allowQuit = allowQuit;
+}
+
#undef PRIVATE_DATA
--- branches/KDE/4.1/kdelibs/kdeui/widgets/kmainwindow.cpp #840376:840377
@@ -226,6 +226,11 @@
{
KGlobal::ref();
+ // We set allow quit to true, so when the refcounting reaches 0 the application \
instance will + // be exited. This has a similar purpose than \
setQuitOnLastWindowClosed (from + // QApplication), but it honors (de)refing from \
KGlobal. + KGlobal::setAllowQuit(true);
+
q = _q;
q->setAnimated(KGlobalSettings::graphicEffectsLevel() & \
KGlobalSettings::SimpleAnimationEffects);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic