From 0bf31bd847d28485d3a2115b0ce9e794654a053b Mon Sep 17 00:00:00 2001 From: ambar chakravartty Date: Thu, 30 Jan 2025 17:29:32 +0530 Subject: changes saveState() and restoreState() to restore renamed tabs (if any) --- src/dolphintabpage.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/dolphintabpage.cpp') 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) -- cgit v1.3