diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/application.cpp b/src/application.cpp index 6cfdf03c..abf56fbb 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -273,6 +273,21 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) KUrl loadingUrl(url); + if (loadingUrl.isRelative()) + { + QString fn = loadingUrl.url(KUrl::RemoveTrailingSlash); + if(loadingUrl.path().contains('.')) + { + loadingUrl.setUrl("//" + fn); + loadingUrl.setScheme("http"); + } + else + { + loadingUrl.setUrl(fn); + loadingUrl.setScheme("gg"); + } + } + // this should let rekonq filtering URI info and supporting // the beautiful KDE web browsing shortcuts KUriFilterData data(loadingUrl.pathOrUrl()); @@ -283,12 +298,6 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) loadingUrl = data.uri().url(); } - if (loadingUrl.isRelative() && !loadingUrl.path().contains(".")) - { - QString urlString = QString("http://www.google.com/search?q=%1").arg(loadingUrl.path()); - loadingUrl = KUrl(urlString); - } - if ( !KProtocolInfo::isKnownProtocol( loadingUrl ) ) { KMessageBox::error(0, i18n("Protocol not supported\n%1", url.protocol())); @@ -322,6 +331,7 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) } } + void Application::loadUrl(const QString& urlString, const Rekonq::OpenType& type) { return loadUrl( guessUrlFromString(urlString), type ); |