summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/assistant/tools/assistant/helpviewer.cpp7
-rw-r--r--tools/assistant/tools/assistant/helpviewer.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp
index 85e4e71..22b3f30 100644
--- a/tools/assistant/tools/assistant/helpviewer.cpp
+++ b/tools/assistant/tools/assistant/helpviewer.cpp
@@ -132,11 +132,12 @@ bool AbstractHelpViewer::canOpenPage(const QString &url)
return !mimeFromUrl(url).isEmpty();
}
-QString AbstractHelpViewer::mimeFromUrl(const QString &url)
+QString AbstractHelpViewer::mimeFromUrl(const QUrl &url)
{
TRACE_OBJ
- const int index = url.lastIndexOf(QLatin1Char('.'));
- const QByteArray &ext = url.mid(index).toUtf8().toLower();
+ const QString &path = url.path();
+ const int index = path.lastIndexOf(QLatin1Char('.'));
+ const QByteArray &ext = path.mid(index).toUtf8().toLower();
const ExtensionMap *e = extensionMap;
while (e->extension) {
diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h
index 9c3971f..80a6f87 100644
--- a/tools/assistant/tools/assistant/helpviewer.h
+++ b/tools/assistant/tools/assistant/helpviewer.h
@@ -74,7 +74,7 @@ public:
static bool isLocalUrl(const QUrl &url);
static bool canOpenPage(const QString &url);
- static QString mimeFromUrl(const QString &url);
+ static QString mimeFromUrl(const QUrl &url);
static bool launchWithExternalApp(const QUrl &url);
};