diff options
author | kh1 <qt-info@nokia.com> | 2010-04-20 16:15:21 +0200 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2010-04-20 16:19:23 +0200 |
commit | 47d1931bcc2fd8d173b03b98381361359b2c170a (patch) | |
tree | edee6e30a110552349b2f89f8cfe6ed3b878ddff | |
parent | fb0b092872588c65da01ff5fc22597c955c44508 (diff) | |
download | qt-creator-47d1931bcc2fd8d173b03b98381361359b2c170a.tar.gz |
Just use the path as the url can have an anchor attached etc...
Fixes the broken topic chooser and keyword resolving.
Reviewed-by: ck
(cherry picked from commit e6900ff03d58a2ec2200ee87ee6b3f5a1d72b8e6)
-rw-r--r-- | src/plugins/help/helpviewer.cpp | 7 | ||||
-rw-r--r-- | src/plugins/help/helpviewer.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/help/helpviewer.cpp b/src/plugins/help/helpviewer.cpp index d8726a99cb..a88393c665 100644 --- a/src/plugins/help/helpviewer.cpp +++ b/src/plugins/help/helpviewer.cpp @@ -109,10 +109,11 @@ bool HelpViewer::canOpenPage(const QString &url) return !mimeFromUrl(url).isEmpty(); } -QString HelpViewer::mimeFromUrl(const QString &url) +QString HelpViewer::mimeFromUrl(const QUrl &url) { - 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/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h index d49f3d1e14..45c33e95d9 100644 --- a/src/plugins/help/helpviewer.h +++ b/src/plugins/help/helpviewer.h @@ -91,7 +91,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); public slots: |