89698 r=bienvenu sr=mscott. Make rename imap folder work for backslash and

change the alert wording
99150 r/sr=bienvenu Make rename Cyrus imap folder work correctly for '/'
This commit is contained in:
naving%netscape.com 2001-09-14 04:39:28 +00:00
Родитель 36bdd08511
Коммит cbc928d65f
3 изменённых файлов: 19 добавлений и 18 удалений

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

@ -349,4 +349,4 @@
## @name IMAP_SPECIAL_CHAR
## @loc None
5065= The folder name cannot contain the %c character. Please choose another name.
5065= The %c character is reserved on this imap server. Please choose another name.

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

@ -1313,12 +1313,12 @@ NS_IMETHODIMP nsImapMailFolder::RenameLocal(const char *newName, nsIMsgFolder *p
nsFileSpec fileSpec;
oldPathSpec->GetFileSpec(&fileSpec);
nsLocalFolderSummarySpec oldSummarySpec(fileSpec);
nsCAutoString newNameStr = leafname;
newNameStr += ".msf";
nsCAutoString newNameStr;
oldSummarySpec.Delete(PR_FALSE);
if (cnt > 0)
{
newNameStr = leafname;
NS_MsgHashIfNecessary(newNameStr);
newNameStr += ".sbd";
char *leafName = dirSpec.GetLeafName();
if (nsCRT::strcmp(leafName, newNameStr) != 0 )
@ -5815,31 +5815,29 @@ NS_IMETHODIMP nsImapMailFolder::RenameSubFolders(nsIMsgFolder *oldFolder)
NS_NewFileSpecWithSpec(newPath, getter_AddRefs(dbFileSpec));
nsCOMPtr<nsIMsgFolder> child;
char *leafName;
leafName = newPath.GetLeafName();
nsAutoString currentFolderNameStr;
currentFolderNameStr.AssignWithConversion(leafName);
nsAutoString utf7LeafName = currentFolderNameStr;
nsXPIDLString unicodeName;
nsXPIDLString folderName;
rv = msgFolder->GetName(getter_Copies(folderName));
if (!folderName || NS_FAILED(rv)) return rv;
nsAutoString utf7LeafName(folderName.get());
rv = AddSubfolderWithPath(&utf7LeafName, dbFileSpec, getter_AddRefs(child));
if (!child || NS_FAILED(rv)) return rv;
rv = CreateUnicodeStringFromUtf7(leafName, getter_Copies(unicodeName));
if (NS_SUCCEEDED(rv) && unicodeName)
child->SetName(unicodeName);
child->SetName(folderName);
nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(child);
nsXPIDLCString onlineName;
GetOnlineName(getter_Copies(onlineName));
nsCAutoString onlineCName(onlineName);
onlineCName.AppendWithConversion(hierarchyDelimiter);
onlineCName.Append(leafName);
onlineCName.AppendWithConversion(utf7LeafName);
if (imapFolder)
{
imapFolder->SetVerifiedAsOnlineFolder(verified);
imapFolder->SetOnlineName(onlineCName.get());
imapFolder->SetHierarchyDelimiter(hierarchyDelimiter);
imapFolder->SetBoxFlags(boxflags);
m_initialized = PR_TRUE;
PRBool changed = PR_FALSE;
msgFolder->ChangeFilterDestination(child, PR_FALSE /*caseInsensitive*/, &changed);
@ -5850,10 +5848,8 @@ NS_IMETHODIMP nsImapMailFolder::RenameSubFolders(nsIMsgFolder *oldFolder)
NotifyItemAdded(parentSupport, childSupport, "folderView");
child->RenameSubFolders(msgFolder);
m_initialized = PR_TRUE;
}
rv = aEnumerator->Next();
PL_strfree(leafName);
}
return rv;

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

@ -2397,9 +2397,14 @@ nsImapService::RenameLeaf(nsIEventQueue* eventQueue, nsIMsgFolder* srcFolder,
cStrFolderName.SetLength(leafNameStart+1);
urlSpec.Append(cStrFolderName);
}
urlSpec.Append(utfNewName);
char *escapedNewName = nsEscape(utfNewName, url_Path);
if (!escapedNewName) return NS_ERROR_NULL_POINTER;
char* escapedSlashName = nsnull;
rv = nsImapUrl::EscapeSlashes((const char *) escapedNewName, &escapedSlashName);
if (!escapedSlashName) return NS_ERROR_NULL_POINTER;
urlSpec.Append(escapedSlashName);
PR_FREEIF(escapedNewName);
PR_FREEIF(escapedSlashName);
nsCRT::free(utfNewName);
rv = uri->SetSpec(urlSpec.get());