aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-24 11:04:20 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-24 11:04:20 (GMT)
commit0be717bce2493999df2c4e89801fc924a0e96503 (patch)
tree028bd28d99bcd87721170a86db4631625216a684
parent9b959ab779e2d329b833cde75aecc9241aa71581 (diff)
start to cleanup the view activation mess, less direct function calls, more relying on the signals we have anyway
-rw-r--r--kate/src/kateviewmanager.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/kate/src/kateviewmanager.cpp b/kate/src/kateviewmanager.cpp
index 0559d10..4028213 100644
--- a/kate/src/kateviewmanager.cpp
+++ b/kate/src/kateviewmanager.cpp
@@ -402,19 +402,22 @@ void KateViewManager::documentsDeleted(const QList<KTextEditor::Document *> &)
if (!activeView() && !KateApp::self()->documentManager()->documentList().isEmpty()) {
createView(KateApp::self()->documentManager()->documentList().last());
}
-
- KTextEditor::View *const newActiveView = activeView();
/**
- * check if we have any empty viewspaces and give them a view
+ * if we have one now, show them in all viewspaces that got empty!
*/
- Q_FOREACH(KateViewSpace * vs, m_viewSpaceList) {
- if (!vs->currentView()) {
- createView(newActiveView->document(), vs);
+ if (KTextEditor::View *const newActiveView = activeView()) {
+ /**
+ * check if we have any empty viewspaces and give them a view
+ */
+ Q_FOREACH(KateViewSpace * vs, m_viewSpaceList) {
+ if (!vs->currentView()) {
+ createView(newActiveView->document(), vs);
+ }
}
- }
- emit viewChanged(newActiveView);
+ emit viewChanged(newActiveView);
+ }
/**
* enable updates hard (we can't use KateUpdateDisabler here, we have delayed signal