nsSearchService.restoreDefaultEngines should also restore the default order
Categories
(Firefox :: Search, task, P3)
Tracking
()
People
(Reporter: whimboo, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sng][search-tech-debt])
Updated•11 years ago
|
Comment 1•10 years ago
|
||
Updated•10 years ago
|
Updated•5 years ago
|
Comment 2•3 years ago
|
||
When reviewing bug 1499095, I noticed that preferences is spinning its own reset engines loop, when really it should be using the search service's restoreDefaultEngines - which is exactly what this bug is about.
I think we should change this code and the code being added in bug 1499095 to be contained within SearchService.restoreDefaultEngines
.
The revised function will:
- unhide any application provided engines, except for those defined as hidden by enterprise policies
- restore the order of the search engines
The first part can be done by moving the enterprise code across and extending the existing loop within SearchService.restoreDefaultEngines
.
For the second part, I think we should reset the user's useSavedOrder
setting and use that to our advantage. The setting is there to indicate that we should use the order from the saved settings, but resetting that attribute here as well is a reasonable thing to do IMO.
Doing it this way also means we also don't have to mess around with reordering the engines - we can use the existing code to set the order. So this would look something like:
setAttribute(useSavedOrder, false);
this.__sortedEngines = null; // Note: two underscores
// Maybe call this._saveSortedEngineList(false) here (see below)
for (let engine of this._sortedEngines) { // Note: one underscore
// Notify engine modified (just in case, unless there's an easy way to skip notifications we know we don't need).
}
I put the maybe call this._saveSortedEngineList(false)
in as a comment as I think we should probably update the saved orders for the engines in settings even if we're not actively using them - I'm a little concerned that if we don't we might have old orders saved, and so if the user subsequently moves an engine, we might get an incorrect order.
The first two lines could also potentially be moved into _saveSortedEngineList
.
Updated•1 years ago
|
Updated•1 years ago
|
Description
•