feat: implement using the wanted search engine in the browser
This commit is contained in:
parent
1c83ac98a0
commit
ac4404c565
|
@ -106,6 +106,16 @@ Rectangle {
|
|||
Keys.onPressed: {
|
||||
// TODO: disable browsing local files? file://
|
||||
if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return){
|
||||
if (appSettings.browserSearchEngine !== Constants.browserSearchEngineNone && !Utils.isURL(text)) {
|
||||
switch (appSettings.browserSearchEngine) {
|
||||
case Constants.browserSearchEngineGoogle: currentWebView.url = "https://www.google.com/search?q=" + text; break;
|
||||
case Constants.browserSearchEngineYahoo: currentWebView.url = "https://search.yahoo.com/search?p=" + text; break;
|
||||
case Constants.browserSearchEngineDuckDuckGo: currentWebView.url = "https://duckduckgo.com/?q=" + text; break;
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
currentWebView.url = determineRealURL(text);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue