Commit f4b885a8 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

Correctly restore view config of all split views

BUG: 353852
REVIEW: 128163
parent 9b8fbe6a
...@@ -430,10 +430,10 @@ void KateViewManager::documentSavedOrUploaded(KTextEditor::Document *doc, bool) ...@@ -430,10 +430,10 @@ void KateViewManager::documentSavedOrUploaded(KTextEditor::Document *doc, bool)
} }
} }
bool KateViewManager::createView(KTextEditor::Document *doc, KateViewSpace *vs) KTextEditor::View *KateViewManager::createView(KTextEditor::Document *doc, KateViewSpace *vs)
{ {
if (m_blockViewCreationAndActivation) { if (m_blockViewCreationAndActivation) {
return false; return nullptr;
} }
// create doc // create doc
...@@ -472,7 +472,7 @@ bool KateViewManager::createView(KTextEditor::Document *doc, KateViewSpace *vs) ...@@ -472,7 +472,7 @@ bool KateViewManager::createView(KTextEditor::Document *doc, KateViewSpace *vs)
activateView(view); activateView(view);
} }
return true; return view;
} }
bool KateViewManager::deleteView(KTextEditor::View *view) bool KateViewManager::deleteView(KTextEditor::View *view)
......
...@@ -113,9 +113,10 @@ Q_SIGNALS: ...@@ -113,9 +113,10 @@ Q_SIGNALS:
public: public:
/** /**
* create and activate a new view for doc, if doc == 0, then * create and activate a new view for doc, if doc == 0, then
* create a new document * create a new document.
* Can return NULL.
*/ */
bool createView(KTextEditor::Document *doc = 0L, KateViewSpace *vs = nullptr); KTextEditor::View *createView(KTextEditor::Document *doc = 0L, KateViewSpace *vs = nullptr);
private: private:
bool deleteView(KTextEditor::View *view); bool deleteView(KTextEditor::View *view);
......
...@@ -653,9 +653,10 @@ void KateViewSpace::restoreConfig(KateViewManager *viewMan, const KConfigBase *c ...@@ -653,9 +653,10 @@ void KateViewSpace::restoreConfig(KateViewManager *viewMan, const KConfigBase *c
QString vgroup = QString::fromLatin1("%1 %2").arg(groupname).arg(fn); QString vgroup = QString::fromLatin1("%1 %2").arg(groupname).arg(fn);
KConfigGroup configGroup(config, vgroup); KConfigGroup configGroup(config, vgroup);
viewMan->createView(doc, this); auto view = viewMan->createView(doc, this);
if (view) {
viewMan->activeView()->readSessionConfig(configGroup); view->readSessionConfig(configGroup);
}
} }
} }
......
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