summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-04-19 09:53:12 +0200
committerGitHub <noreply@github.com>2018-04-19 09:53:12 +0200
commit3833d859856e2662bbb8dc80d28f7789c47f66c3 (patch)
tree637f8f51ff047a8a36dbeabc5778ea4fb5f04c76 /application
parente16685fee90fe7a9cc28977a9b9aaa9ea26b338c (diff)
parentf30a2606d45993b434a19e2f02c77dfab55c370e (diff)
downloadUXP-3833d859856e2662bbb8dc80d28f7789c47f66c3.tar
UXP-3833d859856e2662bbb8dc80d28f7789c47f66c3.tar.gz
UXP-3833d859856e2662bbb8dc80d28f7789c47f66c3.tar.lz
UXP-3833d859856e2662bbb8dc80d28f7789c47f66c3.tar.xz
UXP-3833d859856e2662bbb8dc80d28f7789c47f66c3.zip
Merge pull request #205 from janekptacijarabaci/pm_engine-manager_keyword_1
[PALEMOON] Engine Manager throws a warning (deprecated)
Diffstat (limited to 'application')
-rw-r--r--application/palemoon/components/search/content/engineManager.js17
-rw-r--r--application/palemoon/components/search/content/engineManager.xul2
2 files changed, 10 insertions, 9 deletions
diff --git a/application/palemoon/components/search/content/engineManager.js b/application/palemoon/components/search/content/engineManager.js
index 92b6d59b7..993d48b06 100644
--- a/application/palemoon/components/search/content/engineManager.js
+++ b/application/palemoon/components/search/content/engineManager.js
@@ -2,7 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
+ "resource://gre/modules/PlacesUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "Task",
+ "resource://gre/modules/Task.jsm");
const Ci = Components.interfaces;
const Cc = Components.classes;
@@ -105,7 +110,7 @@ var gEngineManagerDialog = {
document.getElementById("engineList").focus();
},
- editKeyword: function engineManager_editKeyword() {
+ editKeyword: Task.async(function* engineManager_editKeyword() {
var selectedEngine = gEngineView.selectedEngine;
if (!selectedEngine)
return;
@@ -121,12 +126,8 @@ var gEngineManagerDialog = {
var dupName = "";
if (alias.value != "") {
- try {
- let bmserv = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- if (bmserv.getURIForKeyword(alias.value))
- bduplicate = true;
- } catch(ex) {}
+ // Check for duplicates in Places keywords.
+ bduplicate = !!(yield PlacesUtils.keywords.fetch(alias.value));
// Check for duplicates in changes we haven't committed yet
let engines = gEngineView._engineStore.engines;
@@ -154,7 +155,7 @@ var gEngineManagerDialog = {
break;
}
}
- },
+ }),
onSelect: function engineManager_onSelect() {
// Buttons only work if an engine is selected and it's not the last engine,
diff --git a/application/palemoon/components/search/content/engineManager.xul b/application/palemoon/components/search/content/engineManager.xul
index 50181c066..1152ef8db 100644
--- a/application/palemoon/components/search/content/engineManager.xul
+++ b/application/palemoon/components/search/content/engineManager.xul
@@ -36,7 +36,7 @@
oncommand="gEngineManagerDialog.bump(-1);"
disabled="true"/>
<command id="cmd_editkeyword"
- oncommand="gEngineManagerDialog.editKeyword();"
+ oncommand="gEngineManagerDialog.editKeyword().catch(Components.utils.reportError);"
disabled="true"/>
</commandset>