fixing code that relied on implicit string construction

This commit is contained in:
scc%mozilla.org 2000-08-20 01:55:20 +00:00
Родитель 3c206c9cc7
Коммит 65e5687a72
7 изменённых файлов: 21 добавлений и 21 удалений

Просмотреть файл

@ -777,7 +777,7 @@ NS_IMETHODIMP nsIMAPHostSessionList::AddShellToCacheForHost(const char *serverKe
NS_IMETHODIMP nsIMAPHostSessionList::FindShellInCacheForHost(const char *serverKey, const char *mailboxName, const char *UID,
IMAP_ContentModifiedType modType, nsIMAPBodyShell **shell)
{
nsCString uidString = UID;
nsCString uidString(UID);
PR_EnterMonitor(gCachedHostInfoMonitor);
nsIMAPHostInfo *host = FindHost(serverKey);

Просмотреть файл

@ -244,7 +244,7 @@ nsImapIncomingServer::GetServerDirectory(char **serverDirectory)
NS_IMETHODIMP
nsImapIncomingServer::SetServerDirectory(const char *serverDirectory)
{
nsCAutoString dirString = serverDirectory;
nsCAutoString dirString(serverDirectory);
if (dirString.Length() > 0)
{
@ -872,7 +872,7 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const char *folderPath,
return rv;
}
nsCAutoString dupFolderPath = folderPath;
nsCAutoString dupFolderPath(folderPath);
if (dupFolderPath.Last() == '/')
{
dupFolderPath.SetLength(dupFolderPath.Length()-1);

Просмотреть файл

@ -238,9 +238,9 @@ NS_IMETHODIMP nsImapMailFolder::AddSubfolderWithPath(nsAutoString *name, nsIFile
//Only set these is these are top level children.
if(NS_SUCCEEDED(rv) && isServer)
{
if(name->EqualsIgnoreCase(NS_ConvertASCIItoUCS2("Inbox").GetUnicode()))
if(name->EqualsIgnoreCase(NS_ConvertASCIItoUCS2("Inbox")))
flags |= MSG_FOLDER_FLAG_INBOX;
else if(name->EqualsIgnoreCase(kTrashName))
else if(name->EqualsIgnoreCase(nsAutoString(kTrashName)))
flags |= MSG_FOLDER_FLAG_TRASH;
#if 0
else if(name->EqualsIgnoreCase(kSentName))
@ -696,7 +696,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateStorageIfMissing(nsIUrlListener* urlListen
// and not by folder discovery. So, we have to compute the parent.
if (!msgParent)
{
nsCAutoString folderName = mURI;
nsCAutoString folderName(mURI);
nsCAutoString uri;
@ -761,7 +761,7 @@ NS_IMETHODIMP nsImapMailFolder::GetOnlineDelimiter(char** onlineDelimiter)
nsresult rv;
PRUnichar delimiter = 0;
rv = GetHierarchyDelimiter(&delimiter);
nsAutoString aString = delimiter;
nsAutoString aString(delimiter);
*onlineDelimiter = aString.ToNewCString();
return rv;
}
@ -980,7 +980,7 @@ NS_IMETHODIMP nsImapMailFolder::PrepareToRename()
NS_IMETHODIMP nsImapMailFolder::RenameLocal(const char *newName)
{
nsCAutoString leafname = newName;
nsCAutoString leafname(newName);
// newName always in the canonical form "greatparent/parentname/leafname"
PRInt32 leafpos = leafname.RFindChar('/');
if (leafpos >0)

Просмотреть файл

@ -5121,7 +5121,7 @@ PRBool nsImapProtocol::RenameHierarchyByHand(const char *oldParentMailboxName,
}
if (ns)
{
nsCString pattern = oldParentMailboxName;
nsCString pattern(oldParentMailboxName);
pattern += ns->GetDelimiter();
pattern += "*";
PRBool isUsingSubscription = PR_FALSE;
@ -5163,7 +5163,7 @@ PRBool nsImapProtocol::RenameHierarchyByHand(const char *oldParentMailboxName,
}
// calculate the new name and do the rename
nsCString newChildName = newParentMailboxName;
nsCString newChildName(newParentMailboxName);
newChildName += (currentName + PL_strlen(oldParentMailboxName));
RenameMailboxRespectingSubscriptions(currentName,
newChildName.GetBuffer(),
@ -5189,7 +5189,7 @@ PRBool nsImapProtocol::DeleteSubFolders(const char* selectedMailbox)
if (m_deletableChildren)
{
m_hierarchyNameState = kDeleteSubFoldersInProgress;
nsCString pattern = selectedMailbox;
nsCString pattern(selectedMailbox);
char onlineDirSeparator = kOnlineHierarchySeparatorUnknown;
m_runningUrl->GetOnlineSubDirSeparator(&onlineDirSeparator);
pattern.Append(onlineDirSeparator);
@ -5354,7 +5354,7 @@ void nsImapProtocol::OnMoveFolderHierarchy(const char * sourceMailbox)
m_runningUrl->GetOnlineSubDirSeparator(&onlineDirSeparator);
newBoxName = destinationMailbox;
nsCString oldBoxName = sourceMailbox;
nsCString oldBoxName(sourceMailbox);
PRInt32 leafStart = oldBoxName.RFindChar(onlineDirSeparator);
PRInt32 length = oldBoxName.Length();
nsCString leafName;
@ -5471,10 +5471,10 @@ void nsImapProtocol::DiscoverAllAndSubscribedBoxes()
HandleMemoryFailure();
}
nsCAutoString allPattern = prefix;
nsCAutoString allPattern(prefix);
allPattern += '*';
nsCAutoString topLevelPattern = prefix;
nsCAutoString topLevelPattern(prefix);
topLevelPattern += '%';
nsCAutoString secondLevelPattern;

Просмотреть файл

@ -306,8 +306,8 @@ NS_IMETHODIMP nsImapService::OpenAttachment(const char *aContentType,
// or it may already be downloaded for us....the only way i can tell to
// distinguish the two events is to search for ?section or ?part
nsCAutoString uri = aMessageUri;
nsCAutoString urlString = aUrl;
nsCAutoString uri(aMessageUri);
nsCAutoString urlString(aUrl);
urlString.ReplaceSubstring("/;section", "?section");
// more stuff i don't understand
@ -1988,7 +1988,7 @@ nsImapService::RenameLeaf(nsIEventQueue* eventQueue, nsIMsgFolder* srcFolder,
char *utfNewName = CreateUtf7ConvertedStringFromUnicode( newLeafName);
nsCAutoString cStrFolderName = (const char *) folderName;
nsCAutoString cStrFolderName(NS_STATIC_CAST(const char *, folderName));
PRInt32 leafNameStart =
cStrFolderName.RFindChar('/'); // ** troublesome hierarchyseparator
if (leafNameStart != -1)
@ -2775,7 +2775,7 @@ NS_IMETHODIMP nsImapService::NewURI(const char *aSpec, nsIURI *aBaseURI, nsIURI
{
// now extract lots of fun information...
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aImapUrl);
nsCAutoString unescapedSpec = aSpec;
nsCAutoString unescapedSpec(aSpec);
nsUnescape(unescapedSpec);
mailnewsUrl->SetSpec((char *) unescapedSpec); // set the url spec...

Просмотреть файл

@ -1050,7 +1050,7 @@ NS_IMETHODIMP nsImapUrl::GetUri(char** aURI)
PRUint32 key = m_listOfMessageIds ? atoi(m_listOfMessageIds) : 0;
nsXPIDLCString theFile;
CreateCanonicalSourceFolderPathString(getter_Copies(theFile));
nsCString fullFolderPath = "/";
nsCString fullFolderPath("/");
fullFolderPath += (const char *) m_userName;
char *hostName = nsnull;
rv = GetHost(&hostName);

Просмотреть файл

@ -50,7 +50,7 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
if (NS_FAILED(rv))
return rv;
nsCAutoString uri = uriStr;
nsCAutoString uri(uriStr);
if (uri.Find(rootURI) != 0) // if doesn't start with rootURI
return NS_ERROR_FAILURE;
@ -183,7 +183,7 @@ nsresult nsParseImapMessageURI(const char* uri, nsCString& folderURI, PRUint32 *
if(!key)
return NS_ERROR_NULL_POINTER;
nsCAutoString uriStr = uri;
nsCAutoString uriStr(uri);
PRInt32 keySeparator = uriStr.FindChar('#');
if(keySeparator != -1)
{