diff options
author | kh <qtc-committer@nokia.com> | 2009-04-24 14:54:33 (GMT) |
---|---|---|
committer | kh <qtc-committer@nokia.com> | 2009-04-24 14:54:33 (GMT) |
commit | deffb8578757550e57ea3058e95a758155632226 (patch) | |
tree | dac5175e1cd47ef321d85a05e1d5d3e4e6a2565f /tools/assistant | |
parent | d6d25c3978360bd8c30b3dcce3bfa4117d37f5d8 (diff) | |
download | Qt-deffb8578757550e57ea3058e95a758155632226.zip Qt-deffb8578757550e57ea3058e95a758155632226.tar.gz Qt-deffb8578757550e57ea3058e95a758155632226.tar.bz2 |
fixes empty tab titles after restart
Diffstat (limited to 'tools/assistant')
-rw-r--r-- | tools/assistant/tools/assistant/centralwidget.cpp | 23 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/helpviewer.cpp | 1 |
2 files changed, 10 insertions, 14 deletions
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index aa8887c..0a94a3d 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -678,26 +678,21 @@ void CentralWidget::activateTab(bool onlyHelpViewer) void CentralWidget::setTabTitle(const QUrl& url) { - int tab = lastTabPage; - HelpViewer* viewer = currentHelpViewer(); - + Q_UNUSED(url) #if !defined(QT_NO_WEBKIT) - if (!viewer || viewer->source() != url) { - QTabBar *tabBar = qFindChild<QTabBar*>(tabWidget); - for (tab = 0; tab < tabBar->count(); ++tab) { - viewer = qobject_cast<HelpViewer*>(tabWidget->widget(tab)); - if (viewer && viewer->source() == url) - break; - } + QTabBar *tabBar = qFindChild<QTabBar*>(tabWidget); + for (int tab = 0; tab < tabBar->count(); ++tab) { + HelpViewer* viewer = qobject_cast<HelpViewer*>(tabWidget->widget(tab)); + if (viewer) + tabWidget->setTabText(tab, viewer->documentTitle().trimmed()); } #else - Q_UNUSED(url) -#endif - + HelpViewer* viewer = currentHelpViewer(); if (viewer) { - tabWidget->setTabText(tab, + tabWidget->setTabText(lastTabPage, quoteTabTitle(viewer->documentTitle().trimmed())); } +#endif } void CentralWidget::currentPageChanged(int index) diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 5ce6e14..5726136 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -393,6 +393,7 @@ void HelpViewer::mousePressEvent(QMouseEvent *event) void HelpViewer::setLoadFinished(bool ok) { loadFinished = ok; + emit sourceChanged(url()); } #else // !defined(QT_NO_WEBKIT) |