Closed
Bug 546854
Opened 16 years ago
Closed 15 years ago
Preference Manager should be able to get/set file preferences.
Categories
(Camino Graveyard :: Preferences, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: chris, Assigned: chris)
References
Details
Attachments
(1 file, 5 obsolete files)
|
2.97 KB,
patch
|
chris
:
superreview+
|
Details | Diff | Splinter Review |
Bug 546853 requires getting and setting a complex pref (of type nsILocalFile). It makes sense to add this functionality to the Preference Manager.
Comment 1•16 years ago
|
||
I'd recommend the API be get/setFilePref, have it deal in NSURLs, and do the conversion to and from nsILocalFile internally. That's consistent with the way the rest of the prefs API works, and doesn't force clients to deal in Gecko types to get completely generic support we may never need.
| Assignee | ||
Updated•16 years ago
|
Summary: Preference Manager should be able to get/set complex values. → Preference Manager should be able to get/set file preferences.
| Assignee | ||
Comment 2•16 years ago
|
||
Here's my initial attempt.
Assignee: nobody → trendyhendy2000
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•16 years ago
|
||
This is a bit nicer.
Attachment #428013 -
Attachment is obsolete: true
Attachment #428126 -
Flags: review?
| Assignee | ||
Comment 4•16 years ago
|
||
Sorry, this is the real Fix v1.1.
Attachment #428126 -
Attachment is obsolete: true
Attachment #428140 -
Flags: review?
Attachment #428126 -
Flags: review?
| Assignee | ||
Comment 5•16 years ago
|
||
Now with support for spaces in directory names!
Attachment #428140 -
Attachment is obsolete: true
Attachment #428140 -
Flags: review?
(I suppose this can actually land in cvs now, but it's not actually needed until 1.9.2; not quite sure how I want to track those cases yet.)
Version: Trunk → 1.9.2 Branch
| Assignee | ||
Updated•15 years ago
|
Attachment #428328 -
Flags: review?(stuart.morgan+bugzilla)
Comment 7•15 years ago
|
||
Comment on attachment 428328 [details] [diff] [review]
Fix v1.2
r=me.
However... the more I think about it the more I think the default return value for the getter should be nil. I know that's not consistent with the string method, but a URL based on an empty string isn't a meaningful object in the same way that @"" is. I couldn't even tell you for sure what URL that would construct (and I'm not sure an empty string is a valid init argument, since I don't know if the RFC allows empty string URL).
So I think the first line should be changed to
... = nil;
Attachment #428328 -
Flags: review?(stuart.morgan+bugzilla) → review+
| Assignee | ||
Comment 8•15 years ago
|
||
Same as version 1.2, but with nil initializer for prefValue.
Attachment #428328 -
Attachment is obsolete: true
Attachment #434809 -
Flags: superreview?(mikepinkerton)
Attachment #434809 -
Flags: review+
Comment 9•15 years ago
|
||
+- (NSURL*)getFilePref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
- (NSString*)getStringPref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
- (NSColor*)getColorPref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
- (BOOL)getBooleanPref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
- (int)getIntPref: (const char*)prefName withSuccess:(BOOL*)outSuccess;
why the space after the colon? Can we just fix that? The definition doesn't have the space.
+ (void)mPrefs->SetComplexValue(prefName, NS_GET_IID(nsILocalFile), filePref);
Why the (void)? Do we really do this elsewhere?
sr=pink
Updated•15 years ago
|
Attachment #434809 -
Flags: superreview?(mikepinkerton) → superreview+
| Assignee | ||
Comment 10•15 years ago
|
||
Those two bits of code in the sr review were done to maintain consistency with similar code in the same source file. Changing them doesn't affect the resulting behaviour, so the patch for checkin does that.
Attachment #434809 -
Attachment is obsolete: true
Attachment #440684 -
Flags: superreview+
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•