mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
small changes to clients of string converting routines
This commit is contained in:
parent
898f9bb454
commit
b6d6427bb1
@ -629,7 +629,7 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const char *folderPath,
|
||||
|
||||
GetServerURI(getter_Copies(serverUri));
|
||||
|
||||
uri = serverUri;
|
||||
uri.Assign(serverUri);
|
||||
|
||||
PRInt32 leafPos = folderName.RFindChar('/');
|
||||
|
||||
|
@ -353,13 +353,13 @@ nsresult nsImapMailFolder::CreateSubFolders(nsFileSpec &path)
|
||||
|
||||
|
||||
// take the full unicode folder name and find the unicode leaf name.
|
||||
currentFolderNameStr = unicodeName;
|
||||
currentFolderNameStr.Assign(unicodeName);
|
||||
PRInt32 leafPos = currentFolderNameStr.RFindChar('/');
|
||||
if (leafPos > 0)
|
||||
currentFolderNameStr.Cut(0, leafPos + 1);
|
||||
|
||||
// take the utf7 full online name, and determine the utf7 leaf name
|
||||
utf7LeafName = onlineFullUtf7Name;
|
||||
utf7LeafName.Assign(onlineFullUtf7Name);
|
||||
leafPos = utf7LeafName.RFindChar('/');
|
||||
if (leafPos > 0)
|
||||
utf7LeafName.Cut(0, leafPos + 1);
|
||||
@ -658,7 +658,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName
|
||||
nsCAutoString onlineName = m_onlineFolderName;
|
||||
if (onlineName.Length() > 0)
|
||||
onlineName += hierarchyDelimiter;
|
||||
onlineName += folderNameStr;
|
||||
onlineName.Append(folderNameStr);
|
||||
imapFolder->SetVerifiedAsOnlineFolder(PR_TRUE);
|
||||
imapFolder->SetOnlineName(onlineName.GetBuffer());
|
||||
imapFolder->SetHierarchyDelimiter(hierarchyDelimiter);
|
||||
@ -1155,7 +1155,7 @@ NS_IMETHODIMP nsImapMailFolder::ReadFromFolderCacheElem(nsIMsgFolderCacheElement
|
||||
m_hierarchyDelimiter = (PRUnichar) hierarchyDelimiter;
|
||||
rv = element->GetStringProperty("onlineName", getter_Copies(onlineName));
|
||||
if (NS_SUCCEEDED(rv) && (const char *) onlineName && nsCRT::strlen((const char *) onlineName))
|
||||
m_onlineFolderName = onlineName;
|
||||
m_onlineFolderName.Assign(onlineName);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -1263,7 +1263,7 @@ nsImapMailFolder::GetDBFolderInfoAndDB(nsIDBFolderInfo **folderInfo, nsIMsgDatab
|
||||
if (NS_SUCCEEDED((*folderInfo)->GetCharPtrProperty("onlineName", getter_Copies(onlineName))))
|
||||
{
|
||||
if ((const char*) onlineName && nsCRT::strlen((const char *) onlineName) > 0)
|
||||
m_onlineFolderName = onlineName;
|
||||
m_onlineFolderName.Assign(onlineName);
|
||||
else
|
||||
{
|
||||
char *uri = nsnull;
|
||||
@ -1274,7 +1274,7 @@ nsImapMailFolder::GetDBFolderInfoAndDB(nsIDBFolderInfo **folderInfo, nsIMsgDatab
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsXPIDLCString name;
|
||||
rv = nsImapURI2FullName(kImapRootURI, hostname, uri, getter_Copies(name));
|
||||
m_onlineFolderName = name;
|
||||
m_onlineFolderName.Assign(name);
|
||||
nsAutoString autoOnlineName(name);
|
||||
rv = (*folderInfo)->SetProperty("onlineName", &autoOnlineName);
|
||||
PR_FREEIF(uri);
|
||||
|
@ -2932,7 +2932,7 @@ void nsImapProtocol::ProcessMailboxUpdate(PRBool handlePossibleUndo)
|
||||
nsCAutoString undoIds;
|
||||
|
||||
GetCurrentUrl()->CreateListOfMessageIdsString(getter_Copies(undoIdsStr));
|
||||
undoIds = undoIdsStr;
|
||||
undoIds.Assign(undoIdsStr);
|
||||
if (undoIds.Length() > 0)
|
||||
{
|
||||
char firstChar = (char) undoIds.CharAt(0);
|
||||
|
@ -268,7 +268,7 @@ NS_IMETHODIMP nsImapService::GetUrlForUri(const char *aMessageURI, nsIURI **aURL
|
||||
nsCOMPtr<nsIURI> url = do_QueryInterface(imapUrl);
|
||||
nsXPIDLCString currentSpec;
|
||||
url->GetSpec(getter_Copies(currentSpec));
|
||||
urlSpec = currentSpec;
|
||||
urlSpec.Assign(currentSpec);
|
||||
|
||||
urlSpec.Append("fetch>");
|
||||
urlSpec.Append(uidString);
|
||||
@ -561,7 +561,7 @@ nsImapService::FetchMessage(nsIImapUrl * aImapUrl,
|
||||
nsXPIDLCString currentSpec;
|
||||
nsCOMPtr<nsIURI> url = do_QueryInterface(aImapUrl);
|
||||
url->GetSpec(getter_Copies(currentSpec));
|
||||
urlSpec = currentSpec;
|
||||
urlSpec.Assign(currentSpec);
|
||||
|
||||
PRUnichar hierarchySeparator = GetHierarchyDelimiter(aImapMailFolder);
|
||||
|
||||
|
@ -998,7 +998,7 @@ nsImapUrl::GetURI(char** aURI)
|
||||
fullFolderPath += '@';
|
||||
fullFolderPath += hostName;
|
||||
fullFolderPath += '/';
|
||||
fullFolderPath += theFile;
|
||||
fullFolderPath.Append(theFile);
|
||||
|
||||
PR_FREEIF(hostName);
|
||||
char * baseMessageURI;
|
||||
|
@ -143,7 +143,7 @@ nsImapURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
|
||||
parentName.Right(leafName, parentName.Length() - dirEnd -1);
|
||||
parentName.Truncate(dirEnd);
|
||||
NS_MsgHashIfNecessary(parentName);
|
||||
parentName += sbdSep;
|
||||
parentName.Append(sbdSep);
|
||||
pathResult += (const char *) parentName;
|
||||
// this fixes a strange purify warning.
|
||||
parentName = (const char *) leafName;
|
||||
@ -172,7 +172,7 @@ nsImapURI2FullName(const char* rootURI, const char* hostname, char* uriStr,
|
||||
PRInt32 hostEnd = uri.FindChar('/');
|
||||
if (hostEnd <= 0) return NS_ERROR_FAILURE;
|
||||
uri.Right(fullName, uri.Length() - hostEnd - 1);
|
||||
if (fullName == "") return NS_ERROR_FAILURE;
|
||||
if (fullName.IsEmpty()) return NS_ERROR_FAILURE;
|
||||
*name = fullName.ToNewCString();
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user