mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-23 14:26:12 +03:00
ui: Refactor WebView::isUrlExternal
This commit is contained in:
parent
2cfc816621
commit
f127d0a7b3
@ -306,6 +306,11 @@ QWebHitTestResult WebView::hitTestContent(const QPoint &pos) const
|
||||
|
||||
bool WebView::isUrlExternal(const QUrl &url)
|
||||
{
|
||||
static const QStringList localSchemes = {
|
||||
QStringLiteral("file"),
|
||||
QStringLiteral("qrc"),
|
||||
};
|
||||
|
||||
const QString scheme = url.scheme();
|
||||
return !scheme.isEmpty() && scheme != QLatin1String("file") && scheme != QLatin1String("qrc");
|
||||
return !scheme.isEmpty() && !localSchemes.contains(scheme);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user