Last Comment Bug 515232 - "distribution" searchplugins dont work for complex general.useragent.locale
: "distribution" searchplugins dont work for complex general.useragent.locale
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Search (show other bugs)
: unspecified
: x86 Linux
: -- normal (vote)
: Firefox 14
Assigned To: Mike Hommey [:glandium]
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-08 13:32 PDT by Alexander Sack
Modified: 2012-03-09 05:05 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch 1 (4.60 KB, patch)
2009-09-08 13:33 PDT, Alexander Sack
no flags Details | Diff | Splinter Review
patch 1 without garbage (4.16 KB, patch)
2009-09-08 13:33 PDT, Alexander Sack
no flags Details | Diff | Splinter Review
patch 2 - use global chrome registry selectedLocale (3.89 KB, patch)
2009-09-08 16:03 PDT, Alexander Sack
no flags Details | Diff | Splinter Review
Try getting general.useragent.locale as a complex value first in DirectoryProvider.cpp (2.13 KB, patch)
2012-02-26 02:59 PST, Mike Hommey [:glandium]
benjamin: review+
Details | Diff | Splinter Review

Description Alexander Sack 2009-09-08 13:32:14 PDT
currently the localized searchengines feature for "distribution/searchplugins" is broken for builds that use a complex pref for general.useragent.locale - which is what we don in ubuntu

Also its not possible to overload searchplugins in the "common" directory in the locale folder, which could be fixed by changing the order of the searchplugindirs returned in browser/components/dirprovider/nsBrowserDirectoryProvider.cpp ... which I would like to address in the same patch.
Comment 1 Alexander Sack 2009-09-08 13:33:01 PDT
Created attachment 399299 [details] [diff] [review]
patch 1
Comment 2 Alexander Sack 2009-09-08 13:33:44 PDT
Created attachment 399302 [details] [diff] [review]
patch 1 without garbage
Comment 3 Alexander Sack 2009-09-08 16:03:08 PDT
Created attachment 399338 [details] [diff] [review]
patch 2 - use global chrome registry selectedLocale
Comment 4 Mike Hommey [:glandium] 2012-02-26 02:59:43 PST
Created attachment 600753 [details] [diff] [review]
Try getting general.useragent.locale as a complex value first in DirectoryProvider.cpp

Only the first paragraph of comment 0 still applies. Instead of using Alex's approach of using chrome registry, I'm just using GetComplexValue, fallbacking to GetChar if that fails, which is what all other code paths getting general.user-agent.locale are using.
Comment 5 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-02-29 16:24:52 PST
Comment on attachment 600753 [details] [diff] [review]
Try getting general.useragent.locale as a complex value first in DirectoryProvider.cpp

It might be nice to make this use mozilla::Preferences while we're changing this.
Comment 6 Mike Hommey [:glandium] 2012-02-29 23:37:56 PST
Comment on attachment 600753 [details] [diff] [review]
Try getting general.useragent.locale as a complex value first in DirectoryProvider.cpp

[It's annoying when hg bzexport silently doesn't put the requested review flag for some reason]
Comment 7 Mike Hommey [:glandium] 2012-02-29 23:38:29 PST
(In reply to Gavin Sharp (use gavin@gavinsharp.com for email) from comment #5)
> Comment on attachment 600753 [details] [diff] [review]
> Try getting general.useragent.locale as a complex value first in
> DirectoryProvider.cpp
> 
> It might be nice to make this use mozilla::Preferences while we're changing
> this.

Unfortunately, mozilla::Preferences is an internal API, and as such is not available from browser.
Comment 8 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-03-06 13:14:13 PST
Comment on attachment 600753 [details] [diff] [review]
Try getting general.useragent.locale as a complex value first in DirectoryProvider.cpp

of course - I forgot this was in browsercomps
Comment 10 Marco Bonardo [::mak] 2012-03-09 05:05:10 PST
https://hg.mozilla.org/mozilla-central/rev/5689de2cf0f8

Note You need to log in before you can comment on or make changes to this bug.