IMAP doesn't need it's own implementation of GetName

This commit is contained in:
alecf%netscape.com 1999-08-10 00:47:44 +00:00
parent ef175cd013
commit 2c821c57bc
2 changed files with 4 additions and 57 deletions

View File

@ -616,57 +616,6 @@ NS_IMETHODIMP nsImapMailFolder::Rename (const char *newName)
return rv;
}
NS_IMETHODIMP nsImapMailFolder::GetName(PRUnichar ** name)
{
nsresult result = NS_OK;
if(!name)
return NS_ERROR_NULL_POINTER;
if (!m_haveReadNameFromDB)
{
if (mDepth == 0)
{
char *hostName = nsnull;
GetHostname(&hostName);
nsString unicodeHostName(hostName);
SetName((PRUnichar *) unicodeHostName.GetUnicode());
PR_FREEIF(hostName);
m_haveReadNameFromDB = PR_TRUE;
*name = mName.ToNewUnicode();
return NS_OK;
}
#if 0
// ** Is this right if we just retrieve the name from the uri?
else
{
//Need to read the name from the database
result = GetDatabase();
if (NS_SUCCEEDED(result) && mDatabase)
{
nsString folderName;
nsCOMPtr<nsIDBFolderInfo> dbFolderInfo;
if (mDatabase) {
mDatabase->GetDBFolderInfo(getter_AddRefs(dbFolderInfo));
if (dbFolderInfo) {
dbFolderInfo->GetMailboxName(folderName);
m_haveReadNameFromDB = PR_TRUE;
*name = folderName.ToNewCString();
return NS_OK;
}
}
}
}
#endif
}
nsAutoString folderName;
nsImapURI2Name(kImapRootURI, mURI, folderName);
*name = folderName.ToNewUnicode();
return result;
}
NS_IMETHODIMP nsImapMailFolder::GetPrettyName(PRUnichar ** prettyName)
{
return GetName(prettyName);
@ -2790,8 +2739,8 @@ nsImapMailFolder::SetAppendMsgUid(nsIImapProtocol* aProtocol,
if (NS_FAILED(rv)) return rv;
if (mailCopyState->m_undoMsgTxn) // CopyMessages()
{
nsImapMailCopyState* mailCopyState =
(nsImapMailCopyState*) copyState;
// nsImapMailCopyState* mailCopyState =
// (nsImapMailCopyState*) copyState;
nsCOMPtr<nsImapMoveCopyMsgTxn> msgTxn;
msgTxn = do_QueryInterface(mailCopyState->m_undoMsgTxn, &rv);
if (NS_SUCCEEDED(rv))

View File

@ -73,10 +73,10 @@ public:
// be Nntp, Mailbox, or Imap
PRBool m_isMove; // is a move
PRBool m_selectedState; // needs to be in selected state; append msg
PRBool m_streamCopy;
PRUint32 m_curIndex; // message index to the message array which we are
// copying
PRUint32 m_totalCount;// total count of messages we have to do
PRBool m_streamCopy;
char *m_dataBuffer; // temporary buffer for this copy operation
};
@ -117,9 +117,7 @@ public:
NS_IMETHOD Delete ();
NS_IMETHOD Rename (const char *newName);
NS_IMETHOD Adopt(nsIMsgFolder *srcFolder, PRUint32 *outPos);
// this override pulls the value from the db
NS_IMETHOD GetName(PRUnichar ** name); // Name of this folder (as presented to user).
NS_IMETHOD GetPrettyName(PRUnichar ** prettyName); // Override of the base, for top-level mail folder
NS_IMETHOD BuildFolderURL(char **url);