diff options
Diffstat (limited to 'demos/declarative/webbrowser/content/FlickableWebView.qml')
-rw-r--r-- | demos/declarative/webbrowser/content/FlickableWebView.qml | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/demos/declarative/webbrowser/content/FlickableWebView.qml b/demos/declarative/webbrowser/content/FlickableWebView.qml index 30a5d78a98..759cff6694 100644 --- a/demos/declarative/webbrowser/content/FlickableWebView.qml +++ b/demos/declarative/webbrowser/content/FlickableWebView.qml @@ -25,21 +25,19 @@ Flickable { pixelCacheSize: 4000000 transformOrigin: Item.TopLeft - Script { - function fixUrl(url) - { - if (url == "") return url - if (url[0] == "/") return "file://"+url - if (url.indexOf(":")<0) { - if (url.indexOf(".")<0 || url.indexOf(" ")>=0) { - // Fall back to a search engine; hard-code Wikipedia - return "http://en.wikipedia.org/w/index.php?search="+url - } else { - return "http://"+url - } + function fixUrl(url) + { + if (url == "") return url + if (url[0] == "/") return "file://"+url + if (url.indexOf(":")<0) { + if (url.indexOf(".")<0 || url.indexOf(" ")>=0) { + // Fall back to a search engine; hard-code Wikipedia + return "http://en.wikipedia.org/w/index.php?search="+url + } else { + return "http://"+url } - return url } + return url } url: fixUrl(webBrowser.urlString) |