From 7b1df614ebfdbdb7d12c1d5618a74b8cdc308133 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Thu, 26 Nov 2009 09:47:08 +0000
Subject: Make sure window title's update on tab close.

This is a speculative fix for a problem that I couldn't reproduce but was hitting Steve reproducably. This should ensure that whenever a tab is closed, it'll cause the title to be updated.

diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp
index e30478c..f9a42a4 100644
--- a/Swift/QtUI/QtChatTabs.cpp
+++ b/Swift/QtUI/QtChatTabs.cpp
@@ -80,6 +80,7 @@ void QtChatTabs::handleTabClosing() {
 	if (tabs_->count() == 0) {
 		hide();
 	}
+	handleTabTitleUpdated(tabs_->currentWidget());
 }
 
 void QtChatTabs::handleTabCloseRequested(int index) {
@@ -89,6 +90,10 @@ void QtChatTabs::handleTabCloseRequested(int index) {
 
 void QtChatTabs::handleTabTitleUpdated() {
 	QWidget* widget = qobject_cast<QWidget*>(sender());
+	handleTabTitleUpdated(widget);
+}
+
+void QtChatTabs::handleTabTitleUpdated(QWidget* widget) {
 	if (!widget) {
 		return;
 	}
diff --git a/Swift/QtUI/QtChatTabs.h b/Swift/QtUI/QtChatTabs.h
index feb8ebc..c51b88d 100644
--- a/Swift/QtUI/QtChatTabs.h
+++ b/Swift/QtUI/QtChatTabs.h
@@ -24,6 +24,7 @@ namespace Swift {
 		private slots:
 			void handleTabClosing();
 			void handleTabTitleUpdated();
+			void handleTabTitleUpdated(QWidget* widget);
 			void handleTabCloseRequested(int index);
 			void handleWidgetShown();
 			void handleWantsToActivate();
-- 
cgit v0.10.2-6-g49f6