diff options
author | ck <qt-info@nokia.com> | 2009-12-08 13:51:43 (GMT) |
---|---|---|
committer | ck <qt-info@nokia.com> | 2009-12-08 13:53:15 (GMT) |
commit | d3dbb40fa67cf566288dce71834213dbe8e119e9 (patch) | |
tree | 41c5326a0dd3814cbd2b45612a9c92a2873987b7 /tools/assistant | |
parent | e1c515f73eca4e85211fffc718b3d9e27f21eb19 (diff) | |
download | Qt-d3dbb40fa67cf566288dce71834213dbe8e119e9.zip Qt-d3dbb40fa67cf566288dce71834213dbe8e119e9.tar.gz Qt-d3dbb40fa67cf566288dce71834213dbe8e119e9.tar.bz2 |
Assistant: Don't re-load saved pages that don't exist anymore.
Reviewed-by: kh1
Diffstat (limited to 'tools/assistant')
-rw-r--r-- | tools/assistant/tools/assistant/centralwidget.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 8343ad1..10495ad 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -466,25 +466,27 @@ void CentralWidget::setLastShownPages() setSource(QUrl(QLatin1String("about:blank"))); return; } - QStringList zoomFactors = helpEngine.lastZoomFactors(); while (zoomFactors.count() < pageCount) zoomFactors.append(CollectionConfiguration::DefaultZoomFactor); - QStringList::const_iterator zIt = zoomFactors.constBegin(); - QStringList::const_iterator it = lastShownPageList.constBegin(); - for (; it != lastShownPageList.constEnd(); ++it, ++zIt) - setSourceInNewTab((*it), (*zIt).toFloat()); - - int tab = helpEngine.lastTabPage(); - const bool searchIsAttached = m_searchWidget->isAttached(); const bool searchWasAttached = helpEngine.searchWasAttached(); + int tabToShow = helpEngine.lastTabPage(); if (searchWasAttached && !searchIsAttached) - --tab; + --tabToShow; else if (!searchWasAttached && searchIsAttached) - ++tab; - tabWidget->setCurrentIndex(tab); + ++tabToShow; + + for (int curTab = 0; curTab < pageCount; ++curTab) { + const QString &curFile = lastShownPageList.at(curTab); + if (helpEngine.findFile(curFile).isValid()) + setSourceInNewTab(curFile, zoomFactors.at(curTab).toFloat()); + else if (curTab + searchIsAttached <= tabToShow) + --tabToShow; + } + + tabWidget->setCurrentIndex(tabToShow); } bool CentralWidget::hasSelection() const |