From 2a76253265415f352ad7b80f8b7e837e3e89306c Mon Sep 17 00:00:00 2001
From: Kevin Harris <kevin@studiotectorum.com>
Date: Fri, 16 Aug 2013 14:53:01 -0500
Subject: [PATCH] Address bar searches now use configured search string with
%s replacement.
---
src/apps/webpositive/BrowserWindow.cpp | 13 ++++---------
src/apps/webpositive/SettingsKeys.cpp | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/apps/webpositive/BrowserWindow.cpp b/src/apps/webpositive/BrowserWindow.cpp
index b833da0..235efe4 100644
a
|
b
|
BrowserWindow::_VisitURL(const BString& url)
|
2261 | 2261 | void |
2262 | 2262 | BrowserWindow::_VisitSearchEngine(const BString& search) |
2263 | 2263 | { |
2264 | | // TODO: Google Code-In Task to make default search |
2265 | | // engine modifiable from Settings? :) |
2266 | | |
2267 | | BString engine = "http://www.google.com/search?q="; |
2268 | | engine += _EncodeURIComponent(search); |
2269 | | // We have to take care of some of the escaping before |
2270 | | // we hand over the string to WebKit, if we want queries |
2271 | | // like "4+3" to not be searched as "4 3". |
2272 | | |
| 2264 | BString engine = ""; |
| 2265 | engine.SetToFormat(fSearchPageURL, |
| 2266 | _EncodeURIComponent(search).String()); |
| 2267 | |
2273 | 2268 | _VisitURL(engine); |
2274 | 2269 | } |
2275 | 2270 | |
diff --git a/src/apps/webpositive/SettingsKeys.cpp b/src/apps/webpositive/SettingsKeys.cpp
index 7d106d1..c724682 100644
a
|
b
|
const char* kSettingsKeySearchPageURL = "search page url";
|
23 | 23 | const char* kDefaultDownloadPath = "/boot/home/Desktop/"; |
24 | 24 | const char* kDefaultStartPageURL |
25 | 25 | = "file:///boot/home/config/settings/WebPositive/LoaderPages/Welcome"; |
26 | | const char* kDefaultSearchPageURL = "http://www.google.com"; |
| 26 | const char* kDefaultSearchPageURL = "http://www.google.com/search?q=%s"; |
27 | 27 | |
28 | 28 | const char* kSettingsKeyUseProxy = "use http proxy"; |
29 | 29 | const char* kSettingsKeyProxyAddress = "http proxy address"; |