forked from qt-creator/qt-creator
Core: Fix wrong current view after session restore
Fixes: QTCREATORBUG-23233 Change-Id: I4e5a854769d6aa00f5601b8bd8282523681d0458 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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,6 +744,7 @@ void SplitterOrView::split(Qt::Orientation orientation)
|
||||
otherView->view()->setCloseSplitIcon(Utils::Icons::CLOSE_SPLIT_BOTTOM.icon());
|
||||
}
|
||||
|
||||
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);
|
||||
|
@@ -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; }
|
||||
|
Reference in New Issue
Block a user