summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Morozov <dev@gres.biz>2019-11-17 12:23:22 +0300
committerSergey Morozov <dev@gres.biz>2019-11-18 16:29:42 +0000
commit78012fcb66471e55b0255cc2c6e0ace956f1031e (patch)
treea2db7edacecc4e31495bad47ca1d4c30326ab207
parent02b7a529dd002406774f4a6a67aa87cb4a00b335 (diff)
downloadqt-creator-78012fcb66471e55b0255cc2c6e0ace956f1031e.tar.gz
Core: Fix wrong current view after session restore
Fixes: QTCREATORBUG-23233 Change-Id: I4e5a854769d6aa00f5601b8bd8282523681d0458 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--src/plugins/coreplugin/editormanager/editorview.cpp7
-rw-r--r--src/plugins/coreplugin/editormanager/editorview.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp
index c9adba0206..fc6e8a296a 100644
--- a/src/plugins/coreplugin/editormanager/editorview.cpp
+++ b/src/plugins/coreplugin/editormanager/editorview.cpp
@@ -713,7 +713,7 @@ EditorView *SplitterOrView::takeView()
return oldView;
}
-void SplitterOrView::split(Qt::Orientation orientation)
+void SplitterOrView::split(Qt::Orientation orientation, bool activateView)
{
Q_ASSERT(m_view && m_splitter == nullptr);
m_splitter = new MiniSplitter(this);
@@ -744,7 +744,8 @@ void SplitterOrView::split(Qt::Orientation orientation)
otherView->view()->setCloseSplitIcon(Utils::Icons::CLOSE_SPLIT_BOTTOM.icon());
}
- EditorManagerPrivate::activateView(otherView->view());
+ if (activateView)
+ EditorManagerPrivate::activateView(otherView->view());
emit splitStateChanged();
}
@@ -911,7 +912,7 @@ void SplitterOrView::restoreState(const QByteArray &state)
qint32 orientation;
QByteArray splitter, first, second;
stream >> orientation >> splitter >> first >> second;
- split((Qt::Orientation)orientation);
+ split((Qt::Orientation) orientation, false);
m_splitter->restoreState(splitter);
static_cast<SplitterOrView*>(m_splitter->widget(0))->restoreState(first);
static_cast<SplitterOrView*>(m_splitter->widget(1))->restoreState(second);
diff --git a/src/plugins/coreplugin/editormanager/editorview.h b/src/plugins/coreplugin/editormanager/editorview.h
index a3fae51ff6..ebced7ec17 100644
--- a/src/plugins/coreplugin/editormanager/editorview.h
+++ b/src/plugins/coreplugin/editormanager/editorview.h
@@ -171,7 +171,7 @@ public:
explicit SplitterOrView(EditorView *view);
~SplitterOrView() override;
- void split(Qt::Orientation orientation);
+ void split(Qt::Orientation orientation, bool activateView = true);
void unsplit();
inline bool isView() const { return m_view != nullptr; }