зеркало из https://github.com/mozilla/pjs.git
154000 r=cavin sr=bienvenu fixing can't move non-ascii imap subfolders and one assertion in AddSubfolderWithPath
on doing such a move.
This commit is contained in:
Родитель
69084cdfb0
Коммит
d36c3d7b48
|
@ -321,7 +321,7 @@ NS_IMETHODIMP nsImapMailFolder::AddSubfolderWithPath(nsAutoString *name, nsIFile
|
||||||
uri.Append(PRUnichar('/'));
|
uri.Append(PRUnichar('/'));
|
||||||
|
|
||||||
uri.Append(*name);
|
uri.Append(*name);
|
||||||
char* uriStr = ToNewCString(uri);
|
char* uriStr = nsCRT::strdup(NS_ConvertUCS2toUTF8(uri.get()).get());
|
||||||
if (uriStr == nsnull)
|
if (uriStr == nsnull)
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
@ -565,6 +565,7 @@ NS_IMETHODIMP nsImapMailFolder::GetSubFolders(nsIEnumerator* *result)
|
||||||
CreateClientSubfolderInfo("INBOX", kOnlineHierarchySeparatorUnknown,0, PR_TRUE);
|
CreateClientSubfolderInfo("INBOX", kOnlineHierarchySeparatorUnknown,0, PR_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateSummaryTotals(PR_FALSE);
|
UpdateSummaryTotals(PR_FALSE);
|
||||||
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
@ -6899,10 +6900,10 @@ NS_IMETHODIMP nsImapMailFolder::RenameSubFolders(nsIMsgWindow *msgWindow, nsIMsg
|
||||||
|
|
||||||
nsXPIDLString folderName;
|
nsXPIDLString folderName;
|
||||||
rv = msgFolder->GetName(getter_Copies(folderName));
|
rv = msgFolder->GetName(getter_Copies(folderName));
|
||||||
if (!folderName || NS_FAILED(rv)) return rv;
|
if (folderName.IsEmpty() || NS_FAILED(rv)) return rv;
|
||||||
nsAutoString utf7LeafName(folderName.get());
|
nsAutoString unicodeLeafName(folderName.get());
|
||||||
|
|
||||||
rv = AddSubfolderWithPath(&utf7LeafName, dbFileSpec, getter_AddRefs(child));
|
rv = AddSubfolderWithPath(&unicodeLeafName, dbFileSpec, getter_AddRefs(child));
|
||||||
|
|
||||||
if (!child || NS_FAILED(rv)) return rv;
|
if (!child || NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
|
@ -6912,7 +6913,9 @@ NS_IMETHODIMP nsImapMailFolder::RenameSubFolders(nsIMsgWindow *msgWindow, nsIMsg
|
||||||
GetOnlineName(getter_Copies(onlineName));
|
GetOnlineName(getter_Copies(onlineName));
|
||||||
nsCAutoString onlineCName(onlineName);
|
nsCAutoString onlineCName(onlineName);
|
||||||
onlineCName.Append(char(hierarchyDelimiter));
|
onlineCName.Append(char(hierarchyDelimiter));
|
||||||
onlineCName.AppendWithConversion(utf7LeafName);
|
char *utf7LeafName = CreateUtf7ConvertedStringFromUnicode(unicodeLeafName.get());
|
||||||
|
onlineCName.Append(utf7LeafName);
|
||||||
|
PR_Free(utf7LeafName);
|
||||||
if (imapFolder)
|
if (imapFolder)
|
||||||
{
|
{
|
||||||
imapFolder->SetVerifiedAsOnlineFolder(verified);
|
imapFolder->SetVerifiedAsOnlineFolder(verified);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче