mirror of
https://github.com/overte-org/overte.git
synced 2025-08-14 01:29:55 +02:00
more DRYing of code
This commit is contained in:
parent
3c41ecd091
commit
e6cefa946c
1 changed files with 5 additions and 12 deletions
|
@ -32,20 +32,13 @@ void DataWebPage::javaScriptConsoleMessage(const QString& message, int lineNumbe
|
|||
}
|
||||
|
||||
bool DataWebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, QWebPage::NavigationType type) {
|
||||
if (!request.url().toString().startsWith(HIFI_URL_SCHEME)) {
|
||||
QString urlString = request.url().toString();
|
||||
if (Application::getInstance()->canAcceptURL(urlString)) {
|
||||
if (Application::getInstance()->acceptURL(urlString)) {
|
||||
return false; // we handled it, so QWebPage doesn't need to handle it
|
||||
}
|
||||
QString urlString = request.url().toString();
|
||||
if (Application::getInstance()->canAcceptURL(urlString)) {
|
||||
if (Application::getInstance()->acceptURL(urlString)) {
|
||||
return false; // we handled it, so QWebPage doesn't need to handle it
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
// this is a hifi URL - have the AddressManager handle it
|
||||
QMetaObject::invokeMethod(DependencyManager::get<AddressManager>().data(), "handleLookupString",
|
||||
Qt::AutoConnection, Q_ARG(const QString&, request.url().toString()));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QString DataWebPage::userAgentForUrl(const QUrl& url) const {
|
||||
|
|
Loading…
Reference in a new issue