Commit 4f9493e3 authored by Christoph Cullmann's avatar Christoph Cullmann 🍨
Browse files

fix empty viewspace detection for close all documents

parent 63f1beef
Pipeline #237163 failed with stage
in 13 minutes and 35 seconds
......@@ -384,6 +384,18 @@ void KateViewSpace::removeView(KTextEditor::View *v)
m_viewManager->activateView(m_tabBar->tabDocument(idx));
}
}
// Did we just loose our last doc?
// Send a delayed signal. Delay is important as we want to kill
// the viewspace after the view transfer was done
if (m_tabBar->count() == 0 && m_registeredDocuments.empty()) {
QMetaObject::invokeMethod(
this,
[this] {
Q_EMIT viewSpaceEmptied(this);
},
Qt::QueuedConnection);
}
}
bool KateViewSpace::showView(KTextEditor::Document *document)
......@@ -564,13 +576,6 @@ void KateViewSpace::closeDocument(KTextEditor::Document *doc)
documentDestroyed(doc);
}
}
/**
* if this was the last doc, let viewManager know we are empty
*/
if (m_registeredDocuments.isEmpty() && m_tabBar->count() == 0) {
Q_EMIT viewSpaceEmptied(this);
}
}
bool KateViewSpace::acceptsDroppedTab(const QMimeData *md)
......
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