mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Fixes 22570. r=alecf. Use base class mPath so that counts show up correctly.
This commit is contained in:
parent
4363b1057f
commit
823521f8ff
@ -83,7 +83,6 @@ nsImapMailFolder::nsImapMailFolder() :
|
||||
m_verifiedAsOnlineFolder(PR_FALSE),
|
||||
m_explicitlyVerify(PR_FALSE)
|
||||
{
|
||||
m_pathName = nsnull;
|
||||
m_appendMsgMonitor = nsnull; // since we're not using this (yet?) make it null.
|
||||
// if we do start using it, it should be created lazily
|
||||
|
||||
@ -103,8 +102,6 @@ nsImapMailFolder::nsImapMailFolder() :
|
||||
|
||||
nsImapMailFolder::~nsImapMailFolder()
|
||||
{
|
||||
if (m_pathName)
|
||||
delete m_pathName;
|
||||
if (m_appendMsgMonitor)
|
||||
PR_DestroyMonitor(m_appendMsgMonitor);
|
||||
|
||||
@ -161,38 +158,6 @@ NS_IMETHODIMP nsImapMailFolder::QueryInterface(REFNSIID aIID, void** aInstancePt
|
||||
return nsMsgDBFolder::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
#if 0
|
||||
NS_IMETHODIMP nsImapMailFolder::GetPath(nsIFileSpec** aPathName)
|
||||
{
|
||||
nsresult rv;
|
||||
if (! m_pathName)
|
||||
{
|
||||
m_pathName = new nsNativeFileSpec("");
|
||||
if (! m_pathName)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
rv = nsImapURI2Path(kImapRootURI, mURI, *m_pathName);
|
||||
// printf("constructing path %s\n", (const char *) *m_pathName);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
rv = NS_NewFileSpecWithSpec(*m_pathName, aPathName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMailFolder::SetPath(nsIFileSpec * aPathName)
|
||||
{
|
||||
if (!aPathName)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
if (! m_pathName)
|
||||
{
|
||||
m_pathName = new nsFileSpec("");
|
||||
if (! m_pathName)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return aPathName->GetFileSpec(m_pathName);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
NS_IMETHODIMP nsImapMailFolder::Enumerate(nsIEnumerator* *result)
|
||||
|
@ -319,7 +319,6 @@ protected:
|
||||
nsresult BuildIdsAndKeyArray(nsISupportsArray* messages,
|
||||
nsCString& msgIds, nsMsgKeyArray& keyArray);
|
||||
|
||||
nsFileSpec *m_pathName;
|
||||
PRBool m_initialized;
|
||||
PRBool m_haveDiscoveredAllFolders;
|
||||
PRBool m_haveReadNameFromDB;
|
||||
|
@ -109,14 +109,11 @@ nsMsgLocalMailFolder::nsMsgLocalMailFolder(void)
|
||||
mHaveReadNameFromDB(PR_FALSE), mGettingMail(PR_FALSE),
|
||||
mInitialized(PR_FALSE), mCopyState(nsnull), mType(nsnull)
|
||||
{
|
||||
mPath = nsnull;
|
||||
// NS_INIT_REFCNT(); done by superclass
|
||||
}
|
||||
|
||||
nsMsgLocalMailFolder::~nsMsgLocalMailFolder(void)
|
||||
{
|
||||
if (mPath)
|
||||
delete mPath;
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsMsgLocalMailFolder, nsMsgFolder)
|
||||
@ -843,8 +840,6 @@ nsresult nsMsgLocalMailFolder::GetDBFolderInfoAndDB(nsIDBFolderInfo **folderInf
|
||||
if(!db || !folderInfo)
|
||||
return NS_ERROR_NULL_POINTER; //ducarroz: should we use NS_ERROR_INVALID_ARG?
|
||||
|
||||
if (!mPath)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsCOMPtr<nsIMsgDatabase> mailDBFactory;
|
||||
nsCOMPtr<nsIMsgDatabase> mailDB;
|
||||
@ -852,9 +847,7 @@ nsresult nsMsgLocalMailFolder::GetDBFolderInfoAndDB(nsIDBFolderInfo **folderInf
|
||||
nsresult rv = nsComponentManager::CreateInstance(kCMailDB, nsnull, nsIMsgDatabase::GetIID(), getter_AddRefs(mailDBFactory));
|
||||
if (NS_SUCCEEDED(rv) && mailDBFactory)
|
||||
{
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(*mPath, getter_AddRefs(dbFileSpec));
|
||||
openErr = mailDBFactory->Open(dbFileSpec, PR_FALSE, PR_FALSE, (nsIMsgDatabase **) &mailDB);
|
||||
openErr = mailDBFactory->Open(mPath, PR_FALSE, PR_FALSE, (nsIMsgDatabase **) &mailDB);
|
||||
}
|
||||
|
||||
*db = mailDB;
|
||||
|
@ -160,7 +160,6 @@ protected:
|
||||
void ClearCopyState();
|
||||
|
||||
protected:
|
||||
nsNativeFileSpec *mPath;
|
||||
PRUint32 mExpungedBytes;
|
||||
PRBool mHaveReadNameFromDB;
|
||||
PRBool mGettingMail;
|
||||
|
@ -78,7 +78,7 @@ static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsMsgNewsFolder::nsMsgNewsFolder(void) : nsMsgLineBuffer(nsnull, PR_FALSE),
|
||||
mPath(nsnull), mExpungedBytes(0), mGettingNews(PR_FALSE),
|
||||
mExpungedBytes(0), mGettingNews(PR_FALSE),
|
||||
mInitialized(PR_FALSE), mOptionLines(nsnull)
|
||||
{
|
||||
/* we're parsing the newsrc file, and the line breaks are platform specific.
|
||||
@ -92,10 +92,6 @@ nsMsgNewsFolder::nsMsgNewsFolder(void) : nsMsgLineBuffer(nsnull, PR_FALSE),
|
||||
|
||||
nsMsgNewsFolder::~nsMsgNewsFolder(void)
|
||||
{
|
||||
if (mPath) {
|
||||
delete mPath;
|
||||
mPath = nsnull;
|
||||
}
|
||||
|
||||
PR_FREEIF(mOptionLines);
|
||||
mOptionLines = nsnull;
|
||||
@ -690,17 +686,12 @@ nsresult nsMsgNewsFolder::GetDBFolderInfoAndDB(nsIDBFolderInfo **folderInfo, ns
|
||||
if(!db || !folderInfo)
|
||||
return NS_ERROR_NULL_POINTER; //ducarroz: should we use NS_ERROR_INVALID_ARG?
|
||||
|
||||
if (!mPath)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
nsCOMPtr <nsIMsgDatabase> newsDBFactory;
|
||||
nsIMsgDatabase *newsDB;
|
||||
|
||||
nsresult rv = nsComponentManager::CreateInstance(kCNewsDB, nsnull, nsIMsgDatabase::GetIID(), getter_AddRefs(newsDBFactory));
|
||||
if (NS_SUCCEEDED(rv) && newsDBFactory) {
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(*mPath, getter_AddRefs(dbFileSpec));
|
||||
openErr = newsDBFactory->Open(dbFileSpec, PR_FALSE, PR_FALSE, (nsIMsgDatabase **) &newsDB);
|
||||
openErr = newsDBFactory->Open(mPath, PR_FALSE, PR_FALSE, (nsIMsgDatabase **) &newsDB);
|
||||
}
|
||||
else {
|
||||
return rv;
|
||||
|
@ -117,7 +117,6 @@ protected:
|
||||
nsByteArray m_inputStream;
|
||||
|
||||
protected:
|
||||
nsNativeFileSpec *mPath;
|
||||
PRUint32 mExpungedBytes;
|
||||
PRBool mGettingNews;
|
||||
PRBool mInitialized;
|
||||
|
Loading…
Reference in New Issue
Block a user