Open Bug 263684 Opened 20 years ago Updated 2 years ago

nsMsgCompose should use the IO Service to go from file -> uri

Categories

(MailNews Core :: Composition, defect)

defect

Tracking

(Not tracked)

People

(Reporter: Biesinger, Unassigned)

Details

http://lxr.mozilla.org/seamonkey/source/mailnews/compose/src/nsMsgCompose.cpp#3433

3433       sigOutput.AppendLiteral("<img src=\"file:///");
3434            /* XXX pp This gives me 4 slashes on Unix, that's at least one to
3435               much. Better construct the URL with some service. */
3436       sigOutput.AppendWithConversion(testSpec);

this could use nsNetUtil.h's nice function NS_NewFileURI, and nsIURI::GetSpec.
Also, this code could use nsIFile::Exists, to eliminate one further use of
testSpec (an nsFileSpec)

sigFile should probably be a function-scoped variable.


(all this is in nsMsgCompose::ProcessSignature)
actually, an even better way to go from nsIFile -> URL Spec is
NS_GetURLSpecFromFile, also part of nsNetUtil.h.
Product: MailNews → Core
sorry for the spam.  making bugzilla reflect reality as I'm not working on these bugs.  filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
QA Contact: composition
Product: Core → MailNews Core
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.