ui: Refactor WebView::isUrlExternal

This commit is contained in:
Oleg Shparber 2018-04-15 17:39:09 +03:00
parent 2cfc816621
commit f127d0a7b3

View File

@ -306,6 +306,11 @@ QWebHitTestResult WebView::hitTestContent(const QPoint &pos) const
bool WebView::isUrlExternal(const QUrl &url) bool WebView::isUrlExternal(const QUrl &url)
{ {
static const QStringList localSchemes = {
QStringLiteral("file"),
QStringLiteral("qrc"),
};
const QString scheme = url.scheme(); const QString scheme = url.scheme();
return !scheme.isEmpty() && scheme != QLatin1String("file") && scheme != QLatin1String("qrc"); return !scheme.isEmpty() && !localSchemes.contains(scheme);
} }