From 60cc39930f1b0a78280712c8fe1447e919f018f8 Mon Sep 17 00:00:00 2001 From: Gleb Kasachou Date: Wed, 20 Aug 2025 13:04:43 +0300 Subject: DolphinTabWidget: Fix segfault when restoring session When a session is being restored, DolphinTabPage::setSplitViewEnabled() is called for each tab. That function assumes the tab page's m_navigatorsWidget is a valid pointer, which is true only for an active tab. That causes a segmentation fault when Dolphin is launched from the command line with more than two URLs and the --split flag. This commit fixes this bug by connecting the DolphinNavigatorsWidgetAction to each tab page before calling restoreState() in DolphinTabWidget::readProperties(). BUG: 462046 --- src/dolphintabwidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/dolphintabwidget.cpp') diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index b2f838a40..49e84ad3f 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -90,13 +90,20 @@ void DolphinTabWidget::saveProperties(KConfigGroup &group) const void DolphinTabWidget::readProperties(const KConfigGroup &group) { + if (m_lastViewedTab) { + m_lastViewedTab->disconnectNavigators(); + m_lastViewedTab = nullptr; + } const int tabCount = group.readEntry("Tab Count", 0); for (int i = 0; i < tabCount; ++i) { if (i >= count()) { openNewActivatedTab(); } const QByteArray state = group.readEntry("Tab Data " % QString::number(i), QByteArray()); - tabPageAt(i)->restoreState(state); + DolphinTabPage *tabPage = tabPageAt(i); + tabPage->connectNavigators(m_navigatorsWidget); + tabPage->restoreState(state); + tabPage->disconnectNavigators(); } const int index = group.readEntry("Active Tab Index", 0); -- cgit v1.3