Commit e8f055a3 authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Christoph Cullmann
Browse files

KateApp: Respect modCloseAfterLast setting when closing document

CCBUG: 454924
parent 9b73fd36
......@@ -362,7 +362,7 @@ public Q_SLOTS:
*/
bool closeDocument(KTextEditor::Document *document)
{
return m_docManager.closeDocument(document);
return closeDocuments({document});
}
/**
......@@ -374,7 +374,16 @@ public Q_SLOTS:
*/
bool closeDocuments(const QList<KTextEditor::Document *> &documents)
{
return m_docManager.closeDocumentList(documents);
bool shutdownKate =
KateApp::self()->activeKateMainWindow()->modCloseAfterLast() && KateApp::self()->documentManager()->documentList().size() == documents.size();
bool success = m_docManager.closeDocumentList(documents);
if (success && shutdownKate) {
KateApp::self()->shutdownKate(KateApp::self()->activeKateMainWindow());
return true;
}
return success;
}
/**
......
Supports Markdown
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