mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-09 05:14:24 +00:00
code cleanup --> use nsAutoCString instead of .newCString.
This commit is contained in:
parent
ba61bc1d4c
commit
bda36d538f
@ -192,26 +192,16 @@ nsresult nsMsgLocalMailFolder::AddSubfolder(nsAutoString name, nsIMsgFolder **ch
|
||||
uri.Append('/');
|
||||
|
||||
uri.Append(name);
|
||||
char* uriStr = uri.ToNewCString();
|
||||
if (uriStr == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsCOMPtr<nsIRDFResource> res;
|
||||
rv = rdf->GetResource(uriStr, getter_AddRefs(res));
|
||||
rv = rdf->GetResource((const char *) nsAutoCString(uri), getter_AddRefs(res));
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
delete[] uriStr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(res, &rv));
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
delete[] uriStr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
delete[] uriStr;
|
||||
folder->SetFlag(MSG_FOLDER_FLAG_MAIL);
|
||||
|
||||
if(name == "Inbox")
|
||||
|
Loading…
Reference in New Issue
Block a user