making string conversions explicit

This commit is contained in:
scc%netscape.com 2000-04-23 11:12:53 +00:00
parent 5af36c0b61
commit bf9664fd87
6 changed files with 19 additions and 19 deletions

View File

@ -217,7 +217,7 @@ nsFolderCompactState::FinishCompact()
// add the node back the tree
nsCOMPtr<nsIMsgFolder> child;
nsAutoString folderName = (const char*) idlName;
nsAutoString folderName; folderName.AssignWithConversion((const char*) idlName);
rv = parentFolder->AddSubfolder(&folderName, getter_AddRefs(child));
if (child)
{
@ -491,7 +491,7 @@ nsMsgLocalMailFolder::CreateSubFolders(nsFileSpec &path)
nsFileSpec currentFolderPath = (nsFileSpec&)dir;
folderName = currentFolderPath.GetLeafName();
currentFolderNameStr = folderName;
currentFolderNameStr.AssignWithConversion(folderName);
if (nsShouldIgnoreFile(currentFolderNameStr))
{
PL_strfree(folderName);
@ -519,8 +519,8 @@ NS_IMETHODIMP nsMsgLocalMailFolder::AddSubfolder(nsAutoString *name,
if(NS_FAILED(rv)) return rv;
nsAutoString uri;
uri.Append(mURI);
uri.Append('/');
uri.AppendWithConversion(mURI);
uri.AppendWithConversion('/');
uri.Append(*name);
nsCOMPtr<nsIRDFResource> res;
@ -544,15 +544,15 @@ NS_IMETHODIMP nsMsgLocalMailFolder::AddSubfolder(nsAutoString *name,
//Only set these is these are top level children.
if(NS_SUCCEEDED(rv) && isServer)
{
if(name->Compare("Inbox", PR_TRUE) == 0)
if(name->CompareWithConversion("Inbox", PR_TRUE) == 0)
{
flags |= MSG_FOLDER_FLAG_INBOX;
mBiffState = nsMsgBiffState_Unknown;
}
else if(name->Compare("Trash", PR_TRUE) == 0)
else if(name->CompareWithConversion("Trash", PR_TRUE) == 0)
flags |= MSG_FOLDER_FLAG_TRASH;
else if(name->Compare("Unsent Messages", PR_TRUE) == 0
|| name->Compare("Outbox", PR_TRUE) == 0)
else if(name->CompareWithConversion("Unsent Messages", PR_TRUE) == 0
|| name->CompareWithConversion("Outbox", PR_TRUE) == 0)
flags |= MSG_FOLDER_FLAG_QUEUE;
#if 0
//These should probably be read in from a preference. Hacking in here for the moment.
@ -630,7 +630,7 @@ nsMsgLocalMailFolder::AddDirectorySeparator(nsFileSpec &path)
// unfortunately we can't just say:
// path += sep;
// here because of the way nsFileSpec concatenates
nsAutoString str((nsFilePath)path);
nsAutoString str; str.AssignWithConversion(NS_STATIC_CAST(nsFilePath, path));
str += sep;
path = nsFilePath(str);
@ -1281,13 +1281,13 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName)
parentFolder->PropagateDelete(this, PR_FALSE);
}
nsCAutoString newNameStr(aNewName);
nsCAutoString newNameStr; newNameStr.AssignWithConversion(aNewName);
oldPathSpec->Rename(newNameStr.GetBuffer());
newNameStr += ".msf";
oldSummarySpec.Rename(newNameStr.GetBuffer());
if (NS_SUCCEEDED(rv) && cnt > 0)
{
nsCAutoString newNameDirStr(aNewName);
nsCAutoString newNameDirStr; newNameDirStr.AssignWithConversion(aNewName);
newNameDirStr += ".sbd";
dirSpec.Rename(newNameDirStr.GetBuffer());
}

View File

@ -158,7 +158,7 @@ nsLocalMoveCopyMsgTxn::UndoImapDeleteFlag(nsIMsgFolder* folder,
{
if (msgIds.Length() > 0)
msgIds.Append(',');
msgIds.Append((PRInt32) keyArray.GetAt(i));
msgIds.AppendInt((PRInt32) keyArray.GetAt(i));
}
nsCOMPtr<nsIEventQueue> eventQueue;
NS_WITH_SERVICE(nsIEventQueueService, pEventQService,

View File

@ -162,7 +162,7 @@ nsLocalURI2Path(const char* rootURI, const char* uriStr,
}
// verify that uristr starts with rooturi
nsAutoString uri = uriStr;
nsAutoString uri; uri.AssignWithConversion(uriStr);
if (uri.Find(rootURI) != 0)
return NS_ERROR_FAILURE;

View File

@ -388,7 +388,7 @@ NS_IMETHODIMP nsMailboxUrl::SetSpec(const char * aSpec)
{
nsresult rv = nsMsgMailNewsUrl::SetSpec(aSpec);
if (NS_SUCCEEDED(rv))
rv = ParseUrl("");
rv = ParseUrl(nsAutoString());
return rv;
}

View File

@ -229,9 +229,9 @@ void nsMsgMailboxParser::UpdateStatusText (PRUint32 stringID)
{
// all this ugly conversion stuff is necessary because we can't sprintf a value
// with a PRUnichar string.
nsCAutoString cstr (statusString);
nsCAutoString cstr; cstr.AssignWithConversion(statusString);
char * finalString = PR_smprintf(cstr.GetBuffer(), (const char *) m_folderName);
nsAutoString uniFinalString(finalString);
nsAutoString uniFinalString; uniFinalString.AssignWithConversion(finalString);
m_statusFeedback->ShowStatusString(uniFinalString.GetUnicode());
PL_strfree(finalString);
}
@ -1712,7 +1712,7 @@ NS_IMETHODIMP nsParseNewMailState::ApplyFilterHit(nsIMsgFilter *filter, PRBool *
// so we use an nsString from above.
PRUnichar *folderName = nsnull;
rv = trash->GetName(&folderName);
trashNameVal = nsCAutoString(folderName);
trashNameVal.AssignWithConversion(folderName);
PR_FREEIF(folderName);
value = (void *) trashNameVal.GetBuffer();
}

View File

@ -1970,9 +1970,9 @@ nsPop3Protocol::SendRetr()
{
// all this ugly conversion stuff is necessary because we can't sprintf a value
// with a PRUnichar string.
nsCAutoString cstr (statusString);
nsCAutoString cstr; cstr.AssignWithConversion(statusString);
char * finalString = PR_smprintf(cstr.GetBuffer(),m_pop3ConData->real_new_counter, m_pop3ConData->really_new_messages);
nsAutoString uniFinalString(finalString);
nsAutoString uniFinalString; uniFinalString.AssignWithConversion(finalString);
if (m_statusFeedback)
m_statusFeedback->ShowStatusString(uniFinalString.GetUnicode());
PL_strfree(finalString);