From 1657216474020b9b345409f423d75ee34156e1d3 Mon Sep 17 00:00:00 2001 From: Eugene Popov Date: Mon, 13 Sep 2021 18:34:40 +0300 Subject: Fix updating window and tab titles This MR fixes an issue where the window and tab titles don't properly handle creating/deleting/renaming items in the places bar, as well as switching to the Search mode. --- src/dolphintabwidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dolphintabwidget.cpp') diff --git a/src/dolphintabwidget.cpp b/src/dolphintabwidget.cpp index 0e7012d3b..254e654a7 100644 --- a/src/dolphintabwidget.cpp +++ b/src/dolphintabwidget.cpp @@ -162,10 +162,17 @@ void DolphinTabWidget::openNewTab(const QUrl& primaryUrl, const QUrl& secondaryU this, &DolphinTabWidget::activeViewChanged); connect(tabPage, &DolphinTabPage::activeViewUrlChanged, this, &DolphinTabWidget::tabUrlChanged); + connect(tabPage->activeViewContainer(), &DolphinViewContainer::captionChanged, this, [this, tabPage]() { + const int tabIndex = indexOf(tabPage); + Q_ASSERT(tabIndex >= 0); + tabBar()->setTabText(tabIndex, tabName(tabPage)); + }); + int newTabIndex = -1; if (!GeneralSettings::openNewTabAfterLastTab()) { newTabIndex = currentIndex() + 1; } + insertTab(newTabIndex, tabPage, QIcon() /* loaded in tabInserted */, tabName(tabPage)); if (focusWidget) { -- cgit v1.3