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

Add single shot timer

parent e8f055a3
Pipeline #195619 passed with stage
in 8 minutes and 24 seconds
......@@ -41,6 +41,7 @@
#include <QLoggingCategory>
#include <QRegularExpression>
#include <QTextCodec>
#include <QTimer>
#include <QUrlQuery>
#include <signal_watcher.h>
......@@ -576,6 +577,22 @@ KateMainWindow *KateApp::mainWindow(int n)
return nullptr;
}
bool KateApp::closeDocuments(const QList<KTextEditor::Document *> &documents)
{
bool shutdownKate =
KateApp::self()->activeKateMainWindow()->modCloseAfterLast() && KateApp::self()->documentManager()->documentList().size() == documents.size();
bool success = m_docManager.closeDocumentList(documents);
if (success && shutdownKate) {
QTimer::singleShot(0, this, []() {
KateApp::self()->shutdownKate(KateApp::self()->activeKateMainWindow());
});
return true;
}
return success;
}
KTextEditor::Plugin *KateApp::plugin(const QString &name)
{
return m_pluginManager.plugin(name);
......
......@@ -372,19 +372,7 @@ public Q_SLOTS:
* \param documents list of documents to be closed
* \return \e true on success, otherwise \e false
*/
bool closeDocuments(const QList<KTextEditor::Document *> &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;
}
bool closeDocuments(const QList<KTextEditor::Document *> &documents);
/**
* Get a plugin for the plugin with with identifier \p name.
......
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