Closed Bug 369913 Opened 17 years ago Closed 17 years ago

Remove Duplicated code in nsIImportService and nsMsgI18N.h/cpp

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: standard8, Assigned: standard8)

References

(Blocks 1 open bug)

Details

(Keywords: memory-footprint)

Attachments

(6 files)

The import service defines SystemStringToUnicode and SystemStringFromUnicode:

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/mailnews/import/src/nsImportService.cpp&rev=1.53&mark=141-205,207-269#140

The nsMsgI18N.h/cpp implementations of these are very similar:

http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/mailnews/base/util/nsMsgI18N.cpp&rev=1.96&mark=71-131,133-197#70

and there's a couple of helper functions that'll add the missing parts.

If we change the code that uses the import service to use the nsMsgI18N code, then we reduce duplication, and stop mailnews/addrbook/src and mailnews/base/search/src needing to require mailnews/import (not anything major, but still nice tidy up ;-) )
This removes the "duplication" of SystemStringFromUnicode and uses the msg base util implementation.

Note that SystemStringFromUnicode uses kPlatformCharsetSel_FileName for getting the file name which is why I've used nsMsgI18NFileSystemCharset() for getting the system charset to supply to the msg base util implementation.
Attachment #254671 - Flags: superreview?(bienvenu)
Attachment #254671 - Flags: review?(bienvenu)
Comment on attachment 254671 [details] [diff] [review]
Removes duplication of SystemStringFromUnicode v1 (checked in)

thx, Mark!
Attachment #254671 - Flags: superreview?(bienvenu)
Attachment #254671 - Flags: superreview+
Attachment #254671 - Flags: review?(bienvenu)
Attachment #254671 - Flags: review+
Comment on attachment 254671 [details] [diff] [review]
Removes duplication of SystemStringFromUnicode v1 (checked in)

I checked this patch in with an additional uuid update in nsIImportService that we'd both missed.
Attachment #254671 - Attachment description: Removes duplication of SystemStringFromUnicode v1 → Removes duplication of SystemStringFromUnicode v1 (checked in)
Depends on: 371542
Part 2 swaps the use of the functions in mailnews/base/search from the import versions to the nsMsgI18n versions. The added benefit is we remove the mailnews/import dependency that mailnews/base/search has.
Attachment #257142 - Flags: superreview?(bienvenu)
Attachment #257142 - Flags: review?(bienvenu)
Comment on attachment 257142 [details] [diff] [review]
Part 2 - use the nsMsgI18n versions in mailnews/base/search (checked in)

thx, Mark
Attachment #257142 - Flags: superreview?(bienvenu)
Attachment #257142 - Flags: superreview+
Attachment #257142 - Flags: review?(bienvenu)
Attachment #257142 - Flags: review+
Attachment #257142 - Attachment description: Part 2 - use the nsMsgI18n versions in mailnews/base/search → Part 2 - use the nsMsgI18n versions in mailnews/base/search (checked in)
Blocks: 334354
David, non -w patch coming up in a mo. Could you test this on windows for me please?
Attachment #258012 - Flags: superreview?(bienvenu)
Attachment #258012 - Flags: review?(bienvenu)
Mark, I had to wrap a few char * params with nsDependentCString to get nsOESettings.cpp to compile

If you generate a new patch with those changes, I can review that...
Comment on attachment 258012 [details] [diff] [review]
Final Part - rest of duplicated code in mailnews/import (diff -w)

nsOutlookSettings.cpp didn't have the corresponding changes - I'll try to apply the same pattern as your other changes to that file.
Attachment #258012 - Flags: superreview?(bienvenu)
Attachment #258012 - Flags: superreview-
Attachment #258012 - Flags: review?(bienvenu)
Attachment #258012 - Flags: review-
Mark, I had to make a few more changes - this patch compiles for me. Do you want to make your own diff from this, or just have me land this (after I review it)?
(In reply to comment #10)
> Created an attachment (id=258055) [details]
> patch that compiles for me.
> 
> Mark, I had to make a few more changes - this patch compiles for me. Do you
> want to make your own diff from this, or just have me land this (after I review
> it)?
> 

David, I've had a look at your changes and I'm happy with it as it is, so feel free to review & land. Thanks.
fix landed on trunk, Thx, Mark!
Assignee: bugzilla → nobody
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
re-opening to fix assignment.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: nobody → bugzilla
Status: REOPENED → NEW
Status: NEW → RESOLVED
Closed: 17 years ago17 years ago
Resolution: --- → FIXED
Thanks David.
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: