Closed Bug 445403 Opened 16 years ago Closed 16 years ago

imap saved searches with spaces in the name display escaped name

Categories

(MailNews Core :: Search, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.1a1

People

(Reporter: Bienvenu, Assigned: Bienvenu)

References

Details

Attachments

(1 file)

Attached patch proposed fix Splinter Review
If I create an imap saved search called "saved search", we end up creating folders on disk for "saved%20search" and often display that in the UI.

The basic issue is that nsImapURI2Path doesn't handle escaped paths well - it doesn't deal with unescaping them at all. Luckily, nsImapURI2Path isn't used that often, which is why this isn't a problem in general. Usually, IMAP will explicitly call SetFilePath, so that GetFilePath never has to parse the imap uri to figure out the path.

I made nsImapURI2Path look a lot more like nsLocalURI2Path. IMAP Saved searches now handle spaces in the name much better...

An alternative is to make nsImapMailFolder::AddSubfolder call SetPath explicitly on the folder it creates, like nsImapMailFolder::AddSubfolderWithPath does, but that would be just as much work, and nsImapURI2Path should work.
Attachment #329738 - Flags: superreview?(neil)
Attachment #329738 - Flags: review?(neil)
Comment on attachment 329738 [details] [diff] [review]
proposed fix 

>@@ -84,71 +84,64 @@ nsImapURI2Path(const char* rootURI, cons
Is it worth trying to merge this with nsLocalURI2Path in nsMsgUtils.cpp?
Attachment #329738 - Flags: superreview?(neil)
Attachment #329738 - Flags: superreview+
Attachment #329738 - Flags: review?(neil)
Attachment #329738 - Flags: review+
OS: Windows XP → All
Hardware: PC → All
(In reply to comment #1)
> (From update of attachment 329738 [details] [diff] [review])
> >@@ -84,71 +84,64 @@ nsImapURI2Path(const char* rootURI, cons
> Is it worth trying to merge this with nsLocalURI2Path in nsMsgUtils.cpp?
> 
It would be nice, but it looked to me like they wanted different results - one wanted an nsILocalFile, and one wanted a string representation of the path for a uri, so it wasn't trivially obvious how they could be combined, other than to perhaps share code.
fixed (for new saved searches going forward)
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1a1
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: