Bug 429091 – Search Engine Manager doesn't consider pending keyword changes when determining whether a keyword is in conflict. r=gavin

This commit is contained in:
Régis Caspar 2008-08-14 09:49:39 +02:00
Родитель 056f2b8686
Коммит ebf6330e1e
1 изменённых файлов: 12 добавлений и 21 удалений

Просмотреть файл

@ -168,29 +168,20 @@ var gEngineManagerDialog = {
var eduplicate = false;
if (alias.value != "") {
var searchService = Cc["@mozilla.org/browser/search-service;1"].
getService(Ci.nsIBrowserSearchService);
var engine = searchService.getEngineByAlias(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) {}
if (engine) {
if (engine.name != selectedEngine.name)
// Check for duplicates in changes we haven't committed yet
let engines = gEngineView._engineStore.engines;
for each (let engine in engines) {
if (engine.alias == alias.value &&
engine.name != selectedEngine.name) {
eduplicate = true;
} else {
try {
var 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 changes we haven't committed yet
var engines = gEngineView._engineStore.engines;
for each (var engine in engines) {
if (engine.alias == alias.value &&
engine.name != selectedEngine.name) {
eduplicate = true;
break;
}
break;
}
}
}