Commit d946b239 authored by Christoph Cullmann's avatar Christoph Cullmann

allow splitters to survive without views

parent faeedafa
......@@ -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
......
......@@ -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);
......
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