Closed Bug 371542 Opened 18 years ago Closed 18 years ago

Tidy up nsIImportABDescriptor.idl and associated code

Categories

(MailNews Core :: Import, 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

(2 files, 5 obsolete files)

Attached patch The fix (diff -w) (obsolete) — Splinter Review
I've been working on reducing duplicated import code (bug 131040). ReportError (used in various locations) would be a lot easier to tidy if GetPreferredName and SetPreferredName were just an attribute of type nsAString. We'd also avoid some extra string copies, allocs and frees. As part of doing that I thought I may as well switch the interface to nsIFile while I was there. Although that means some extra translation code, it will start to help bug 323211. I'm attaching -w and non -w versions. Neil would you also be able to check if this compiles on Windows for me? (I'll find someone to do mac before check-in)
Attachment #256307 - Flags: review?(neil)
Attached file build failure (obsolete) —
I applied the patch on my suiterunner tree and did a "make" in objdir/mailnews. It appears that the build fails. Mac OS 10.3.9, using the 10.3.0 sdk with gcc3.3.
Attached patch The fix v2 (diff -w) (obsolete) — Splinter Review
Fixes mac build problems as found by Stefan. Thanks to Stefan for helping with this.
Attachment #256307 - Attachment is obsolete: true
Attachment #256369 - Flags: review?(neil)
Attachment #256307 - Flags: review?(neil)
Attached patch The fix v2 (full patch) (obsolete) — Splinter Review
Attachment #256308 - Attachment is obsolete: true
Attachment #256350 - Attachment is obsolete: true
Comment on attachment 256369 [details] [diff] [review] The fix v2 (diff -w) >- inFile->GetNativePath( &pPath); >+ inFileSpec->GetNativePath(&pPath); Might as well use the nsIFile here; saves converting again later. >+ rv = NS_FileSpecToIFile(fileSpec, getter_AddRefs(fileLoc)); Should be &fileSpace here. >-#include "nscore.h" > #include "nsImportABDescriptor.h" >+#include "nscore.h" Any reason for this? >+ /* readonly attribute nsIFile fileSpec; */ >+ NS_IMETHOD GetAbFile(nsIFile **aFile) { >+ return mFile->Clone(aFile); >+ } >+ >+ NS_IMETHOD SetAbFile(nsIFile *aFile) { >+ return aFile->Clone(getter_AddRefs(mFile)); >+ } These need to be null-checked. I don't know how you want to deal with null files, you've got a choice of returning an error if you don't give a file to set or have a file to set, or returning null or clearing the internal file. r=me with these fixed.
Attachment #256369 - Flags: review?(neil) → review+
Fixes Neil's nits, carrying forward his r and requesting sr.
Attachment #256369 - Attachment is obsolete: true
Attachment #256924 - Flags: superreview?(bienvenu)
Attachment #256924 - Flags: review+
Attachment #256370 - Attachment is obsolete: true
Comment on attachment 256924 [details] [diff] [review] The fix v3 (diff -w) thx, Mark!
Attachment #256924 - Flags: superreview?(bienvenu) → superreview+
Patch checked in -> fixed (including missed nit)
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
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: