diff options
| author | Kevin Smith <git@kismith.co.uk> | 2009-11-26 09:47:08 (GMT) | 
|---|---|---|
| committer | Kevin Smith <git@kismith.co.uk> | 2009-11-26 09:47:08 (GMT) | 
| commit | 7b1df614ebfdbdb7d12c1d5618a74b8cdc308133 (patch) | |
| tree | 22e661f79ce1ce01321a2534d75c8cda162814b1 | |
| parent | 5498152b4c9537742019dd45db72c88d7e3dc70c (diff) | |
| download | swift-7b1df614ebfdbdb7d12c1d5618a74b8cdc308133.zip swift-7b1df614ebfdbdb7d12c1d5618a74b8cdc308133.tar.bz2 | |
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.
| -rw-r--r-- | Swift/QtUI/QtChatTabs.cpp | 5 | ||||
| -rw-r--r-- | Swift/QtUI/QtChatTabs.h | 1 | 
2 files changed, 6 insertions, 0 deletions
| 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 @@ -77,21 +77,26 @@ void QtChatTabs::handleTabClosing() {  		return;  	}  	tabs_->removeTab(index);  	if (tabs_->count() == 0) {  		hide();  	} +	handleTabTitleUpdated(tabs_->currentWidget());  }  void QtChatTabs::handleTabCloseRequested(int index) {  	QWidget* widget = tabs_->widget(index);  	widget->close();  }  void QtChatTabs::handleTabTitleUpdated() {  	QWidget* widget = qobject_cast<QWidget*>(sender()); +	handleTabTitleUpdated(widget); +} + +void QtChatTabs::handleTabTitleUpdated(QWidget* widget) {  	if (!widget) {  		return;  	}  	int index = tabs_->indexOf(widget);  	if (index < 0) {  		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 @@ -21,12 +21,13 @@ namespace Swift {  			void resizeEvent(QResizeEvent* event);  			void moveEvent(QMoveEvent* event);  		private slots:  			void handleTabClosing();  			void handleTabTitleUpdated(); +			void handleTabTitleUpdated(QWidget* widget);  			void handleTabCloseRequested(int index);  			void handleWidgetShown();  			void handleWantsToActivate();  		private:  			QTabWidget* tabs_;  	}; | 
 Swift
 Swift