Closed
Bug 371542
Opened 18 years ago
Closed 18 years ago
Tidy up nsIImportABDescriptor.idl and associated code
Categories
(MailNews Core :: Import, defect)
MailNews Core
Import
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)
23.38 KB,
patch
|
standard8
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
24.04 KB,
patch
|
Details | Diff | 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)
Assignee | ||
Comment 1•18 years ago
|
||
Comment 2•18 years ago
|
||
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.
Assignee | ||
Comment 3•18 years ago
|
||
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)
Assignee | ||
Comment 4•18 years ago
|
||
Attachment #256308 -
Attachment is obsolete: true
Attachment #256350 -
Attachment is obsolete: true
Comment 5•18 years ago
|
||
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+
Assignee | ||
Comment 6•18 years ago
|
||
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+
Assignee | ||
Comment 7•18 years ago
|
||
Attachment #256370 -
Attachment is obsolete: true
Comment 8•18 years ago
|
||
Comment on attachment 256924 [details] [diff] [review]
The fix v3 (diff -w)
thx, Mark!
Attachment #256924 -
Flags: superreview?(bienvenu) → superreview+
Assignee | ||
Comment 9•18 years ago
|
||
Patch checked in -> fixed (including missed nit)
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•