Closed
Bug 42102
Opened 26 years ago
Closed 18 years ago
File preferences should be stored as nsIFile objects not nsIFileSpec objects
Categories
(MailNews Core :: Backend, defect)
MailNews Core
Backend
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: alecf, Assigned: mscott)
References
Details
(Keywords: intl)
Attachments
(1 file)
|
6.18 KB,
patch
|
Details | Diff | Splinter Review |
prefs needs to switch it's interface for GetFilePref/SetFilePref() to use
nsIFile instead, because nsIFileSpec is not i18n friendly.
In order for this to happen, bug 42099 must be fixed - because we need to be
able to persistently store an nsIFile the same way nsIFileSpecs could.
The biggest consumer of GetFilePref() is mail, specifically in my own code, so I
will tackle this one.
| Reporter | ||
Comment 1•26 years ago
|
||
inserting into dependancy tree.
Moving nsbeta3 keyword nomination from Status Whiteboard to Keyword field. Put
in wrong field. :-(
Keywords: nsbeta3
Whiteboard: nsbeta3
+ per mail triage. We had talked to alec on this one.
Whiteboard: [nsbeta3+]
| Reporter | ||
Updated•26 years ago
|
Priority: P3 → P1
| Reporter | ||
Comment 4•26 years ago
|
||
marking in progress so others don't waste time on this
Whiteboard: [nsbeta3+] → [nsbeta3+] Working on a fix
| Reporter | ||
Comment 5•26 years ago
|
||
good news - after conrad's landing we're down to only 12 occurances of
GetFilePref and 13 occurances of SetFilePref. The next stage is to convert these
to Get/SetFileXPref.. working on this now
Comment 6•26 years ago
|
||
PDT doesn't understand what bad thing happens if we don't fix this. The pref
file name can't be localized? No big deal. Setting to P3 and leaving [PDTP3]
breadcrumb. We assume you'll let us know if we've misunderstood :-)
Priority: P1 → P3
Whiteboard: [nsbeta3+] Working on a fix → [nsbeta3+] Working on a fix [PDTP3]
| Reporter | ||
Comment 7•26 years ago
|
||
you've misunderstood :)
The problem is that you can't store international characters in prefs - which
means any pref (such as your cache dir, signature dir, etc) does not get stored
correctly.
| Reporter | ||
Comment 8•26 years ago
|
||
ok, I've checked in all fixes except:
- mailnews
- profile migration
because I'm getting platform testing done on each of these.
we're real close, but my fixes definately need a few days to bake and make sure
they don't break anything, so I'm not checking in until probably 4-Sep or 5-Sep
Whiteboard: [nsbeta3+] Working on a fix [PDTP3] → [nsbeta3+] Fix in hand, testing [PDTP3]
Comment 9•26 years ago
|
||
Alec, can you check this in yet? Moving to P2, removing PDTP3 crumb.
Priority: P3 → P2
Whiteboard: [nsbeta3+] Fix in hand, testing [PDTP3] → [nsbeta3+]
| Reporter | ||
Comment 10•26 years ago
|
||
re-marking "Fix in hand" - doing linux testing today, should be ready to land
very soon
Whiteboard: [nsbeta3+] → [nsbeta3+] Fix in hand, testing
Comment 11•26 years ago
|
||
PDT agrees P2
Whiteboard: [nsbeta3+] Fix in hand, testing → [nsbeta3+] [PDTP2] Fix in hand, testing
| Reporter | ||
Comment 12•26 years ago
|
||
ok, platform details seem to have been flushed out. I'll will try to check this
in monday, 9/18.
| Reporter | ||
Comment 13•26 years ago
|
||
| Reporter | ||
Comment 14•26 years ago
|
||
My patch is huge. it scares me. I'm now too scared to checkin.
Now that I know embedding is going to be on the trunk, I'm going to let this get
triaged away for N6 and will checkin to the trunk when the time comes.
Comment 15•26 years ago
|
||
Not holding PR3 for this. Marking nsbeta3-. If something needs to happen here
before we ship, please nominate for rtm.
Whiteboard: [nsbeta3+] [PDTP2] Fix in hand, testing → [nsbeta3-] [PDTP2] Fix in hand, testing
| Reporter | ||
Comment 16•26 years ago
|
||
nominating for rtm. I'll land this as soon as the tree opens for RTM so we have
maximum testing time.
Keywords: rtm
Comment 17•26 years ago
|
||
rtm+, need to be able to store prefs correctly.
Whiteboard: [nsbeta3-] [PDTP2] Fix in hand, testing → [nsbeta3-] [PDTP2][rtm+] Fix in hand, testing
Comment 18•26 years ago
|
||
Alec, do you have an r= and sr= for this? is this something we want to land on
the trunk first to try out before landing on the branch?
Comment 19•26 years ago
|
||
Alec, is this fix really just for embedding? In which case it doesn't need to be
on the branch. PDT is scared by your 9/21 comments.
| Reporter | ||
Comment 20•26 years ago
|
||
Heh, I think that checking this fix in on the trunk first is a good idea. I
was just too scared to check in for nsbeta3.
The main reason for this fix is for i18n-friendly paths - otherwise alot of mail
stuff gets all confused when mail folder paths and the signature are stored in a
directory that has a non-ASCII name.
I'll get a reviewer and superreviewer ASAP.
Updated•26 years ago
|
Whiteboard: [nsbeta3-] [PDTP2][rtm+] Fix in hand, testing → [nsbeta3-] [PDTP2][rtm+ need info] Fix in hand, testing
Comment 21•26 years ago
|
||
need info until review and super review are done
Comment 22•26 years ago
|
||
Alec and I agree: minus for RTM.
Whiteboard: [nsbeta3-] [PDTP2][rtm+ need info] Fix in hand, testing → [nsbeta3-] [PDTP2][rtm-] Fix in hand, testing
Comment 23•26 years ago
|
||
Alec, Can you itemize which pathname prefs still cannot support non-ASCII?
On 2000-09-01 you listed only 2 that are not fixed yet:
- mailnews (can you be more specific)
- profile migration (Just migration? Creating new non-ASCII profiles works?)
On localized MacOSes, standard folders (e.g., System Folder, Preferences)
are localized often in non-ASCII. Will these cause problems? Or do we use
file handles for standard Mac folders?
Comment 24•26 years ago
|
||
On the Mac, file specification data is not stored as a path but as a file system
alias. It's not affected by character set issues. Or at least the OS handles
that for us.
Comment 25•26 years ago
|
||
To try and answer my own question, the only configurable file path I see in
the mailnews UI is the path for the signature. Is that the only mailnews
file path pref that is affected?
| Reporter | ||
Updated•26 years ago
|
Target Milestone: M18 → mozilla0.6
| Reporter | ||
Updated•26 years ago
|
Target Milestone: mozilla0.6 → mozilla0.9
| Reporter | ||
Comment 26•25 years ago
|
||
clearing out old cruft
Comment 28•25 years ago
|
||
>because nsIFileSpec is not i18n friendly.
I am not 100% sure that is still the case.
Comment 29•25 years ago
|
||
>because nsIFileSpec is not i18n friendly.
That is not the only thing wrong with nsIFileSpec. Two other things:
(1) nsIDirectoryService does not use nsIFileSpec - only nsIFile.
(2) The conversion between file path <-> URL using nsFileSpec and nsFilePath
does not produce the same results as Necko.
| Reporter | ||
Comment 31•25 years ago
|
||
Ugh.. this is just too much work for me.. all the consumers of nsIFileSpec are
now in mail
reassigning to putterman for mail triage, and CC'ing bnesse. With bnesse's work
on complex pref types, we might not have to remove the nsIFileSpec type in order
to freeze interfaces appropriately
Assignee: alecf → putterman
Status: ASSIGNED → NEW
Comment 32•25 years ago
|
||
If the way mail uses prefs to store files gets revamped, I'd like to be
involved. Or, at least contribute my 2 cents. What I really think mail should do
with its file prefs is to store them using XP, relative paths. We would then be
able to regain the ability to move profile dirs (thus mail folders). The full
paths that get stored by prefs on behalf of mail is one of the major things
keeping us from doing this.
| Reporter | ||
Comment 33•25 years ago
|
||
conrad - that would be great, but it seems like we need to fix this in a global
way - i.e. all prefs done through the pref API should be stored relative to the
profile dir, if the path in question is actually in the profile dir....
we've been talking in the new world of prefs to have a new way of getting prefs:
void getComplexPref(in string prefName, in nsIID aIID, [retval] out nsQIResult
value);
which would attempt to do the conversion based on the IID of the object that was
passed in.. the conversion for "nsIFile" should be the place where we check if
the file is within the profile path, and if so store it in a relative format.
it should be transparent to the callers, including mailnews
Comment 34•25 years ago
|
||
The current get/setComplexPref implementations take and return nsIFiles, but are
still converting to nsIFileSpecs internally. This should change eventually but,
as Alec noted, it will be "under the covers".
| Reporter | ||
Comment 35•25 years ago
|
||
the other thing we can do with get/setComplexPref is understand the nsIFileSpec
type in addition to nsIFile... then we can accept both types (deprecated or not)
without any interfaces mentioning the deprecated types...
Comment 36•25 years ago
|
||
I can certainly add this functionality if it is deemed to be desirable. The
problem, of course, is that if it's there, people will use it...
Comment 37•25 years ago
|
||
reassigning to racham. removing mozilla0.9 milestone. Is there anything besides
the signature pref that's not correct? I don't expect this bug to get fixed any
time soon just for that given what it appears the complexity of the fix it.
Assignee: putterman → racham
Target Milestone: mozilla0.9 → ---
| Reporter | ||
Comment 38•25 years ago
|
||
signature was fixed... now you have the actual paths to the servers
Comment 39•25 years ago
|
||
Actually, the code is already written to suppport nsIFile (via
Get/SetComplexValue). The real problem here is that all of the consumers of
Get/SetFilePref will have to be changed to use nsIFile. Based on my conversion
with Alec yesterday, Get/SetComplexValue now handles both nsIFile and
nsIFileSpec. When this lands all of the consumers will need to call the
ComplexValue methods. They can be individually swiched to nsIFile at the module
owners whim.
Taking the bug because it is really covered by work I've already done.
Assignee: racham → bnesse
Comment 40•25 years ago
|
||
Replacing the .9 milestone and accepting.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Comment 41•25 years ago
|
||
> The real problem here is that all of the consumers of Get/SetFilePref will
> have to be changed to use nsIFile.
nsIPref has had for a while Get/SetFileXPref which takes an nsILocalFile. When I
made the shift from nsIFileLocations -> nsIDirectoryService, I changed a bunch
of file pref consumers to use nsILocalFile, so some of this is already done - if
that's any consolation :-)
| Reporter | ||
Comment 42•25 years ago
|
||
mailnews is the only consumer, that's why I assigned this to putterman... but if
you want to do the work... :)
Comment 43•25 years ago
|
||
Oh... well I took it because it was assigned to Prefs:Backend and the summary
implied a nsPrefs change. If the intention is otherwise, maybe we should change
the bug :)
Updated•25 years ago
|
Target Milestone: mozilla0.9 → mozilla0.9.1
Updated•25 years ago
|
Priority: P2 → P3
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Comment 44•25 years ago
|
||
Alec - What's the user or development impact of this bug?
Comment 47•24 years ago
|
||
Giving a summary more fitting to the task and over to Mail/News for
implementation as per alecf's earlier comments.
Assignee: bnesse → mscott
Status: ASSIGNED → NEW
Component: Preferences: Backend → Mail Back End
Priority: P3 → --
Product: Browser → MailNews
QA Contact: sairuh → esther
Summary: Need to convert Get/SetFilePref() to use nsIFile → File preferences should be stored as nsIFile objects not nsIFileSpec objects
Target Milestone: mozilla1.0 → ---
Updated•21 years ago
|
Product: MailNews → Core
Comment 48•20 years ago
|
||
Mozilla user for years, suddenly everytime I restart machine all preferances and window layouts of Mozilla go back to default, I can not copy this bug in Linux
Comment 49•18 years ago
|
||
This was fixed as part of bug 33451 and its dependencies. Adding dep & marking fixed.
Updated•18 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•