From 0bf31bd847d28485d3a2115b0ce9e794654a053b Mon Sep 17 00:00:00 2001 From: ambar chakravartty Date: Thu, 30 Jan 2025 17:29:32 +0530 Subject: [PATCH] changes saveState() and restoreState() to restore renamed tabs (if any) --- src/dolphintabpage.cpp | 11 ++++++++++- src/dolphintabwidget.cpp | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/dolphintabpage.cpp b/src/dolphintabpage.cpp index 833e14f1c..7199bcbf3 100644 --- a/src/dolphintabpage.cpp +++ b/src/dolphintabpage.cpp @@ -13,7 +13,6 @@ #include #include #include - DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &secondaryUrl, QWidget *parent) : QWidget(parent) , m_expandingContainer{nullptr} @@ -275,6 +274,10 @@ QByteArray DolphinTabPage::saveState() const stream << m_primaryViewActive; stream << m_splitter->saveState(); + if (!m_title.isEmpty()) { + stream << m_title; + } + return state; } @@ -328,6 +331,12 @@ void DolphinTabPage::restoreState(const QByteArray &state) QByteArray splitterState; stream >> splitterState; m_splitter->restoreState(splitterState); + + if (!stream.atEnd()) { + QString tabTitle; + stream >> tabTitle; + setTitle(tabTitle); + } } void DolphinTabPage::setActive(bool active) diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index 949642f4f..c2fae5170 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -485,6 +485,7 @@ void DolphinTabWidget::renameTab(int index, const QString &name) if (!name.isEmpty()) { tabPageAt(index)->setTitle(name); } + updateTabName(index); } -- 2.47.3