diff options
-rw-r--r-- | tools/assistant/tools/assistant/indexwindow.cpp | 13 |
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); } } |