diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-08-04 00:11:47 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-08-04 00:11:47 +0200 |
commit | 2859f022fabb281a61ea986e6e6d80ade1fab95b (patch) | |
tree | 47adae17fee6619e8e42005c89e375ce05cffdd3 /src | |
parent | Wrong headers fixes! (diff) | |
download | rekonq-2859f022fabb281a61ea986e6e6d80ade1fab95b.tar.xz |
Reverting loadUrl function at previous behaviour.
Next release (with something new..) we'll fix this "strange"
colon/space bug.
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 ); |