diff options
author | megabigbug <megabigbug@arrakis.(none)> | 2009-07-30 13:55:22 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-08-01 02:11:39 +0200 |
commit | b570fd3c4e56c05d65e21c18c441153bfbe756f4 (patch) | |
tree | c11f3a8127025d5e6ff8562b53d17c109ccb545f /src | |
parent | Some comments updated (diff) | |
download | rekonq-b570fd3c4e56c05d65e21c18c441153bfbe756f4.tar.xz |
fix Webshortcuts, works with space and colon delimiter
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 27 | ||||
-rw-r--r-- | src/webview.cpp | 4 |
2 files changed, 14 insertions, 17 deletions
diff --git a/src/application.cpp b/src/application.cpp index ff52d935..60205772 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -262,27 +262,25 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) KToolInvocation::invokeMailer(url); return; } - - KUrl loadingUrl(url); - if (loadingUrl.isRelative()) + KUrl loadingUrl(url); + if (loadingUrl.isRelative() && loadingUrl.path().contains(".")) { QString fn = loadingUrl.url(KUrl::RemoveTrailingSlash); - if(loadingUrl.path().contains('.')) - { - loadingUrl.setUrl("//" + fn); - loadingUrl.setScheme("http"); - } - else + loadingUrl.setUrl("//" + fn); + loadingUrl.setScheme("http"); + } + else if(loadingUrl.scheme()!="http") + { + // this should let rekonq to support the beautiful KDE web browsing shortcuts + KUriFilterData data(loadingUrl.pathOrUrl()); + data.setCheckForExecutables (false); //if true, querries like "rekonq" or "dolphin" are considered as executables + if (KUriFilter::self()->filterUri(data)) { - loadingUrl.setUrl(fn); - loadingUrl.setScheme("gg"); + loadingUrl = data.uri().url(); } } - // this should let rekonq to support the beautiful KDE web browsing shortcuts - loadingUrl = KUriFilter::self()->filteredUri(loadingUrl); - WebView *webView; switch(type) @@ -310,7 +308,6 @@ 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 ); diff --git a/src/webview.cpp b/src/webview.cpp index a8a45077..51874627 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -164,7 +164,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) QStringList favoriteEngines; favoriteEngines << "wikipedia" << "google"; //defaults favoriteEngines = cg.readEntry("FavoriteSearchEngines", favoriteEngines); - const char keywordDelimiter = cg.readEntry("KeywordDelimiter", static_cast<int>(':')); + QString keywordDelimiter = cg.readEntry("KeywordDelimiter", ":"); KService::Ptr service; KUriFilterData data; foreach (QString engine, favoriteEngines) @@ -208,7 +208,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) QStringList favoriteEngines; favoriteEngines << "wikipedia" << "google"; //defaults favoriteEngines = cg.readEntry("FavoriteSearchEngines", favoriteEngines); - const char keywordDelimiter = cg.readEntry("KeywordDelimiter", static_cast<int>(':')); + QString keywordDelimiter = cg.readEntry("KeywordDelimiter", ":"); KService::Ptr service; KUriFilterData data; foreach (QString engine, favoriteEngines) |