Commit 4bcf28f1 authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen
Browse files

Merge branch 'fix-close'

parents bd4782f6 18ca6e9c
......@@ -269,6 +269,7 @@ void KMainWindowPrivate::init(KMainWindow *_q)
letDirtySettings = true;
sizeApplied = false;
suppressCloseEvent = false;
}
static bool endsWithHashNumber(const QString &s)
......@@ -532,6 +533,10 @@ void KMainWindow::appHelpActivated()
void KMainWindow::closeEvent(QCloseEvent *e)
{
K_D(KMainWindow);
if (suppressCloseEvent) {
e->accept();
return;
}
// Save settings if auto-save is enabled, and settings have changed
if (d->settingsTimer && d->settingsTimer->isActive()) {
......@@ -556,6 +561,9 @@ void KMainWindow::closeEvent(QCloseEvent *e)
} else {
e->ignore(); //if the window should not be closed, don't close it
}
// If saving session, we are processing a fake close event, and might get the real one later.
if (e->isAccepted() && qApp->isSavingSession())
suppressCloseEvent = true;
}
bool KMainWindow::queryClose()
......
......@@ -33,6 +33,7 @@ public:
bool settingsDirty: 1;
bool autoSaveWindowSize: 1;
bool sizeApplied: 1;
bool suppressCloseEvent: 1
KConfigGroup autoSaveGroup;
QTimer *settingsTimer;
QTimer *sizeTimer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment