File D25106.patch of Package kxmlgui
diff --git a/src/kmainwindow.cpp b/src/kmainwindow.cpp
index d100e2e..6b4943f 100644
--- a/src/kmainwindow.cpp
+++ b/src/kmainwindow.cpp
@@ -35,6 +35,7 @@
#include "ktoolbar.h"
#include <QApplication>
+#include <QDebug>
#include <QList>
#include <QObject>
#include <QTimer>
@@ -168,9 +169,11 @@
void KMWSessionManager::commitData(QSessionManager &sm)
{
+qDebug() << "Wolfi: KMWSessionManager::commitData() called, qApp->isSavingSession() =" << qApp->isSavingSession() << ", qApp->closingDown() =" << qApp->closingDown();
if (!sm.allowsInteraction()) {
return;
}
+qDebug() << "sm.allowsInteraction() is true, continuing";
/*
Purpose of this exercise: invoke queryClose() without actually closing the
@@ -524,14 +527,19 @@ void KMainWindow::closeEvent(QCloseEvent *e)
d->_k_slotSaveAutoSaveSize();
}
+qDebug() << "Wolfi: KMainWindow::closeEvent() called, type:" << e->type() << ", letDirtySettings =" << d->letDirtySettings << ", qApp->closingDown() =" << qApp->closingDown();
+if (!qApp->closingDown())// if (d->letDirtySettings) // if letDirtySettings is false, queryClose() already returned true and it makes no sense to call it again
if (queryClose()) {
+qDebug() << "queryClose() returned true, accepting";
// widgets will start destroying themselves at this point and we don't
// want to save state anymore after this as it might be incorrect
d->autoSaveSettings = false;
d->letDirtySettings = false;
e->accept();
} else {
+qDebug() << "queryClose() returned false, ignoring";
e->ignore(); //if the window should not be closed, don't close it
+ } else { e->accept(); qDebug() << "qApp->closingDown() is true => accept without calling queryClose()"; //qDebug() << "letDirtySettings is false => accept without calling queryClose()";
}
}