summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2014-01-22 22:52:38 (GMT)
committerChristoph Cullmann <cullmann@kde.org>2014-01-22 22:52:38 (GMT)
commitd946b239d0d84acada5aadc20dfdcc6a68cc380c (patch)
tree63e49a9e2ff3fcb43318b1c4b96b1e25bb4c2bde
parentfaeedafa446c291a64970186aaf93528059e729b (diff)
allow splitters to survive without views
-rw-r--r--kate/app/kateviewmanager.cpp25
-rw-r--r--kate/app/kateviewmanager.h2
2 files changed, 16 insertions, 11 deletions
diff --git a/kate/app/kateviewmanager.cpp b/kate/app/kateviewmanager.cpp
index b2b382c..9deaee8 100644
--- a/kate/app/kateviewmanager.cpp
+++ b/kate/app/kateviewmanager.cpp
@@ -396,7 +396,7 @@ bool KateViewManager::createView ( KTextEditor::Document *doc )
return true;
}
-bool KateViewManager::deleteView (KTextEditor::View *view, bool delViewSpace)
+bool KateViewManager::deleteView (KTextEditor::View *view)
{
if (!view) return true;
@@ -419,10 +419,6 @@ bool KateViewManager::deleteView (KTextEditor::View *view, bool delViewSpace)
delete view;
view = 0L;
- if (delViewSpace)
- if ( viewspace->viewCount() == 0 )
- removeViewSpace( viewspace );
-
return true;
}
@@ -642,7 +638,7 @@ void KateViewManager::closeViews(KTextEditor::Document *doc)
}
while ( !closeList.isEmpty() )
- deleteView( closeList.takeFirst(), true );
+ deleteView( closeList.takeFirst());
if (m_blockViewCreationAndActivation) return;
QTimer::singleShot(0, this, SLOT(slotDelayedViewChanged()));
@@ -650,7 +646,17 @@ void KateViewManager::closeViews(KTextEditor::Document *doc)
void KateViewManager::slotDelayedViewChanged ()
{
- emit viewChanged (activeView());
+ 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())
+ vs->createView (newActiveView->document());
+ }
+
+ emit viewChanged (newActiveView);
}
void KateViewManager::splitViewSpace( KateViewSpace* vs, // = 0
@@ -729,9 +735,8 @@ void KateViewManager::removeViewSpace (KateViewSpace *viewspace)
return;
// delete views of the viewspace
- while (viewspace->viewCount() > 0 && viewspace->currentView())
- {
- deleteView( viewspace->currentView(), false );
+ while (viewspace->currentView()) {
+ deleteView( viewspace->currentView());
}
// cu viewspace
diff --git a/kate/app/kateviewmanager.h b/kate/app/kateviewmanager.h
index 437a400..0edb140 100644
--- a/kate/app/kateviewmanager.h
+++ b/kate/app/kateviewmanager.h
@@ -129,7 +129,7 @@ class KateViewManager : public QSplitter
bool createView ( KTextEditor::Document *doc = 0L );
private:
- bool deleteView ( KTextEditor::View *view, bool delViewSpace = true);
+ bool deleteView ( KTextEditor::View *view);
void moveViewtoSplit (KTextEditor::View *view);
void moveViewtoStack (KTextEditor::View *view);