mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
fixing code that relied on implicit string construction
This commit is contained in:
parent
4cac07a743
commit
2482c470f5
@ -513,7 +513,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::AddSubfolder(nsAutoString *name,
|
||||
|
||||
const nsString fileCharset = nsMsgI18NFileSystemCharset();
|
||||
char *convertedName;
|
||||
rv = ConvertFromUnicode(fileCharset, name->GetUnicode(), &convertedName);
|
||||
rv = ConvertFromUnicode(fileCharset, *name, &convertedName);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
@ -541,14 +541,14 @@ NS_IMETHODIMP nsMsgLocalMailFolder::AddSubfolder(nsAutoString *name,
|
||||
//Only set these is these are top level children.
|
||||
if(NS_SUCCEEDED(rv) && isServer)
|
||||
{
|
||||
if(name->EqualsIgnoreCase(kInboxName))
|
||||
if(name->EqualsIgnoreCase(nsAutoString(kInboxName)))
|
||||
{
|
||||
flags |= MSG_FOLDER_FLAG_INBOX;
|
||||
mBiffState = nsMsgBiffState_Unknown;
|
||||
}
|
||||
else if (name->EqualsIgnoreCase(kTrashName))
|
||||
else if (name->EqualsIgnoreCase(nsAutoString(kTrashName)))
|
||||
flags |= MSG_FOLDER_FLAG_TRASH;
|
||||
else if (name->EqualsIgnoreCase(kUnsentName)
|
||||
else if (name->EqualsIgnoreCase(nsAutoString(kUnsentName))
|
||||
|| name->CompareWithConversion("Outbox", PR_TRUE) == 0)
|
||||
flags |= MSG_FOLDER_FLAG_QUEUE;
|
||||
#if 0
|
||||
@ -931,7 +931,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CreateStorageIfMissing(nsIUrlListener* urlLi
|
||||
// and not by folder discovery. So, we have to compute the parent.
|
||||
if (!msgParent)
|
||||
{
|
||||
nsCAutoString folderName = mURI;
|
||||
nsCAutoString folderName(mURI);
|
||||
|
||||
nsCAutoString uri;
|
||||
|
||||
@ -980,7 +980,7 @@ nsMsgLocalMailFolder::CreateSubfolder(const PRUnichar *folderName)
|
||||
|
||||
//Now we have a valid directory or we have returned.
|
||||
//Make sure the new folder name is valid
|
||||
path += folderName;
|
||||
path += nsAutoString(folderName);
|
||||
path.MakeUnique();
|
||||
|
||||
nsOutputFileStream outputStream(path);
|
||||
@ -1384,7 +1384,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName)
|
||||
|
||||
const nsString fileCharset = nsMsgI18NFileSystemCharset();
|
||||
char *convertedNewName;
|
||||
if (NS_FAILED(ConvertFromUnicode(fileCharset, aNewName, &convertedNewName)))
|
||||
if (NS_FAILED(ConvertFromUnicode(fileCharset, nsAutoString(aNewName), &convertedNewName)))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCAutoString newNameStr(convertedNewName);
|
||||
|
@ -214,7 +214,7 @@ nsresult nsParseLocalMessageURI(const char* uri,
|
||||
if(!key)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsCAutoString uriStr = uri;
|
||||
nsCAutoString uriStr(uri);
|
||||
PRInt32 keySeparator = uriStr.FindChar('#');
|
||||
if(keySeparator != -1)
|
||||
{
|
||||
|
@ -197,7 +197,7 @@ NS_IMETHODIMP nsMailboxService::OpenAttachment(const char *aContentType,
|
||||
nsIMsgWindow *aMsgWindow,
|
||||
nsIUrlListener *aUrlListener)
|
||||
{
|
||||
nsCAutoString partMsgUrl = aMessageUri;
|
||||
nsCAutoString partMsgUrl(aMessageUri);
|
||||
|
||||
// try to extract the specific part number out from the url string
|
||||
partMsgUrl += "?";
|
||||
|
@ -328,7 +328,7 @@ NS_IMETHODIMP nsPop3Service::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI
|
||||
*((char **)getter_Copies(escapedUsername)) =
|
||||
nsEscape(username, url_XAlphas);
|
||||
|
||||
nsCAutoString popSpec = "pop://";
|
||||
nsCAutoString popSpec("pop://");
|
||||
popSpec += escapedUsername;
|
||||
popSpec += "@";
|
||||
popSpec += hostname;
|
||||
|
@ -243,7 +243,7 @@ nsPop3Sink::IncorporateBegin(const char* uidlString,
|
||||
WriteLineToMailbox(dummyEnvelope);
|
||||
if (uidlString)
|
||||
{
|
||||
nsCAutoString uidlCString = "X-UIDL: ";
|
||||
nsCAutoString uidlCString("X-UIDL: ");
|
||||
uidlCString += uidlString;
|
||||
uidlCString += MSG_LINEBREAK;
|
||||
WriteLineToMailbox(uidlCString);
|
||||
|
Loading…
Reference in New Issue
Block a user