From 863f8850124a29cb486452a50e6e9f35e1d60ab8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel <dirk@hohndel.org> Date: Mon, 9 Jun 2014 13:42:16 -0700 Subject: [PATCH] Make sure Windows can find the user manual This worked before without the "file:///" prefix, but something else that I did broke that. Oh well, now it works again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org> --- qt-ui/usermanual.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qt-ui/usermanual.cpp b/qt-ui/usermanual.cpp index 3985b6cd4..0f3167823 100644 --- a/qt-ui/usermanual.cpp +++ b/qt-ui/usermanual.cpp @@ -41,8 +41,13 @@ UserManual::UserManual(QWidget *parent) : QMainWindow(parent), manual.setFileName(prefix + "_" + lang.left(2) + ".html"); if (!manual.exists()) manual.setFileName(prefix + ".html"); - QUrl url(manual.fileName()); - ui->webView->setUrl(url); + if (!manual.exists()) { + ui->webView->setHtml(tr("Cannot find the Subsurface manual")); + } else { + QString urlString = QString("file:///") + manual.fileName(); + QUrl url(urlString, QUrl::TolerantMode); + ui->webView->setUrl(url); + } } else { ui->webView->setHtml(tr("Cannot find the Subsurface manual")); }