forked from qt-creator/qt-creator
Just use the path as the url can have an anchor attached etc...
Fixes the broken topic chooser and keyword resolving. Reviewed-by: ck
This commit is contained in:
@@ -109,10 +109,11 @@ bool HelpViewer::canOpenPage(const QString &url)
|
|||||||
return !mimeFromUrl(url).isEmpty();
|
return !mimeFromUrl(url).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString HelpViewer::mimeFromUrl(const QString &url)
|
QString HelpViewer::mimeFromUrl(const QUrl &url)
|
||||||
{
|
{
|
||||||
const int index = url.lastIndexOf(QLatin1Char('.'));
|
const QString &path = url.path();
|
||||||
const QByteArray &ext = url.mid(index).toUtf8().toLower();
|
const int index = path.lastIndexOf(QLatin1Char('.'));
|
||||||
|
const QByteArray &ext = path.mid(index).toUtf8().toLower();
|
||||||
|
|
||||||
const ExtensionMap *e = extensionMap;
|
const ExtensionMap *e = extensionMap;
|
||||||
while (e->extension) {
|
while (e->extension) {
|
||||||
|
@@ -91,7 +91,7 @@ public:
|
|||||||
|
|
||||||
static bool isLocalUrl(const QUrl &url);
|
static bool isLocalUrl(const QUrl &url);
|
||||||
static bool canOpenPage(const QString &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);
|
static bool launchWithExternalApp(const QUrl &url);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
Reference in New Issue
Block a user