┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphintabwidget.cpp
diff options
context:
space:
mode:
authorEugene Popov <[email protected]>2021-09-13 18:34:40 +0300
committerEugene Popov <[email protected]>2021-11-13 18:20:59 +0200
commit1657216474020b9b345409f423d75ee34156e1d3 (patch)
treeedd78b5ca93e62fd847d235e3d65b1cfd189ea96 /src/dolphintabwidget.cpp
parent4b4f9880785cef91fc97fa94c7ad82a1f95e35e5 (diff)
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.
Diffstat (limited to 'src/dolphintabwidget.cpp')
-rw-r--r--src/dolphintabwidget.cpp7
1 files changed, 7 insertions, 0 deletions
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) {