From 2859f022fabb281a61ea986e6e6d80ade1fab95b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 4 Aug 2009 00:11:47 +0200 Subject: Reverting loadUrl function at previous behaviour. Next release (with something new..) we'll fix this "strange" colon/space bug. --- src/application.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/application.cpp') 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 ); -- cgit v1.2.1