Commit b768b902 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Fix assert + handle empty viewspace case

parent 0971ba63
Pipeline #130575 passed with stage
in 4 minutes and 18 seconds
......@@ -494,9 +494,24 @@ KTextEditor::View *KateViewSpace::takeView(KTextEditor::Document *doc)
return nullptr;
}
auto *view = it->second;
// remove it from the stack
stack->removeWidget(view);
m_tabBar->removeDocument(doc);
// remove it from our doc->view mapping
m_docToView.erase(it);
documentDestroyed(doc);
// 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);
}
return view;
}
......
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