summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh <qtc-committer@nokia.com>2009-04-02 16:00:34 (GMT)
committerkh <qtc-committer@nokia.com>2009-04-02 16:00:34 (GMT)
commit468f189d73fefaeb0769365f78762dc2aa63683d (patch)
tree6d069f0f20207782409efe39f54b0b31643d77e7
parent0c508410dd42714b9854b523c851ef699ebcf7d7 (diff)
downloadQt-468f189d73fefaeb0769365f78762dc2aa63683d.zip
Qt-468f189d73fefaeb0769365f78762dc2aa63683d.tar.gz
Qt-468f189d73fefaeb0769365f78762dc2aa63683d.tar.bz2
fixes empty tab after pdf file open
Task-number: none Reviewed-by: --global
-rw-r--r--tools/assistant/tools/assistant/indexwindow.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp
index 4bd6f4f..0beb5ee 100644
--- a/tools/assistant/tools/assistant/indexwindow.cpp
+++ b/tools/assistant/tools/assistant/indexwindow.cpp
@@ -189,13 +189,20 @@ void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index)
if (model) {
QString keyword = model->data(index, Qt::DisplayRole).toString();
QMap<QString, QUrl> links = model->linksForKeyword(keyword);
+
+ QUrl url;
if (links.count() > 1) {
TopicChooser tc(this, keyword, links);
- if (tc.exec() == QDialog::Accepted)
- CentralWidget::instance()->setSourceInNewTab(tc.link());
+ if (tc.exec() == QDialog::Accepted)
+ url = tc.link();
} else if (links.count() == 1) {
- CentralWidget::instance()->setSourceInNewTab(links.constBegin().value());
+ url = links.constBegin().value();
}
+
+ if (url.path().endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive))
+ CentralWidget::instance()->setSource(url);
+ else
+ CentralWidget::instance()->setSourceInNewTab(url);
}
}