Changes to keyword.URL require restarting Firefox

RESOLVED FIXED in mozilla1.8beta1

Status

()

--
minor
RESOLVED FIXED
15 years ago
13 years ago

People

(Reporter: jruderman, Assigned: darin.moz)

Tracking

({helpwanted})

Trunk
mozilla1.8beta1
helpwanted
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug], URL)

Attachments

(2 attachments)

(Reporter)

Description

15 years ago
If you change keyword.URL but don't restart Firefox, keyword searches (triggered
by typing non-URLs into the address bar) still use the old keyword.URL.
(Assignee)

Comment 2

15 years ago
yeah, this should be easy to fix.  
Keywords: helpwanted
Whiteboard: [good first bug]
Target Milestone: --- → Future
(Reporter)

Comment 3

15 years ago
Should this be fixed by getting rid of init() and the member variable, or by
observing changes to preferences and calling init() again?
(Assignee)

Comment 4

15 years ago
since keyword URLs are not loaded that often, it might be better to just check
the pref each time it is needed instead of implementing an observer scheme.

Comment 5

15 years ago
Posted patch hack v0Splinter Review
Check keyword.URL pref each time it is needed by removing Init() function and
place code inside NewChannel(). 

Also removed redundant mKeywordURL member.

Updated

15 years ago
Attachment #165753 - Flags: review?(cbiesinger)
Comment on attachment 165753 [details] [diff] [review]
hack v0

r=biesi, although I think it would be better to return NS_ERROR_NOT_AVAILABLE
if the pref isn't available or empty.

please ask darin@meer.net for superreview.
Attachment #165753 - Flags: review?(cbiesinger) → review+

Updated

15 years ago
Attachment #165753 - Flags: superreview?(darin)
(Assignee)

Comment 7

15 years ago
Comment on attachment 165753 [details] [diff] [review]
hack v0

>Index: netwerk/protocol/keyword/src/nsKeywordProtocolHandler.cpp

>+    nsXPIDLCString url;
>+    rv = prefs->GetCharPref("keyword.URL", getter_Copies(url));
>+    // if we can't find a keyword.URL keywords won't work.
>+    if (NS_FAILED(rv) || !url || !*url) return NS_ERROR_FAILURE;

I think there is no reason to make this check so complex.  This is
all you need:

      nsXPIDLCString url;
      prefs->GetCharPref("keyword.URL", getter_Copies(url));
      // if we can't find a keyword.URL keywords won't work.
      if (url.IsEmpty())
	  return NS_ERROR_FAILURE;


sr=darin with that change.
Attachment #165753 - Flags: superreview?(darin) → superreview+

Comment 8

15 years ago
Posted patch hack v1Splinter Review
change

Comment 9

15 years ago
Do I need to request r= and sr= again?
(Assignee)

Comment 10

15 years ago
no need to re-request reviews after people gave +

fixed-on-trunk
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
(Assignee)

Updated

15 years ago
Target Milestone: Future → mozilla1.8beta

Comment 11

15 years ago
This wasn't firefox specific, was it?
You need to log in before you can comment on or make changes to this bug.