mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
fixed bug 25988 -- IMAP Subfolders appearing at 1st level instead of 2nd level; bug 26061 -- Rename a pop3 folder and its subfolders disappear; a=phil,r=bienvenu
This commit is contained in:
parent
f4cd0a1c67
commit
8142d351ad
@ -116,6 +116,33 @@ NS_IMETHODIMP nsMsgDBFolder::Shutdown(PRBool shutdownChildren)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgDBFolder::ForceDBClosed ()
|
||||
{
|
||||
PRUint32 cnt = 0, i;
|
||||
if (mSubFolders)
|
||||
{
|
||||
nsCOMPtr<nsISupports> aSupport;
|
||||
nsCOMPtr<nsIMsgFolder> child;
|
||||
mSubFolders->Count(&cnt);
|
||||
if (cnt > 0)
|
||||
for (i = 0; i < cnt; i++)
|
||||
{
|
||||
aSupport = getter_AddRefs(mSubFolders->ElementAt(i));
|
||||
child = do_QueryInterface(aSupport);
|
||||
if (child)
|
||||
child->ForceDBClosed();
|
||||
}
|
||||
}
|
||||
if (mDatabase)
|
||||
{
|
||||
mDatabase->ForceClosed();
|
||||
mDatabase = null_nsCOMPtr();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsMsgDBFolder::StartFolderLoading(void)
|
||||
{
|
||||
if(mDatabase)
|
||||
|
@ -74,6 +74,7 @@ public:
|
||||
NS_IMETHOD MarkAllMessagesRead(void);
|
||||
|
||||
NS_IMETHOD Shutdown(PRBool shutdownChildren);
|
||||
NS_IMETHOD ForceDBClosed();
|
||||
|
||||
protected:
|
||||
virtual nsresult ReadDBFolderInfo(PRBool force);
|
||||
|
@ -655,6 +655,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName
|
||||
onlineName += folderNameStr;
|
||||
imapFolder->SetVerifiedAsOnlineFolder(PR_TRUE);
|
||||
imapFolder->SetOnlineName(onlineName.GetBuffer());
|
||||
imapFolder->SetHierarchyDelimiter(hierarchyDelimiter);
|
||||
}
|
||||
|
||||
unusedDB->SetSummaryValid(PR_TRUE);
|
||||
@ -906,31 +907,6 @@ NS_IMETHODIMP nsImapMailFolder::Rename (const PRUnichar *newName)
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapMailFolder::ForceDBClosed()
|
||||
{
|
||||
PRUint32 cnt = 0, i;
|
||||
if (mSubFolders)
|
||||
{
|
||||
nsCOMPtr<nsISupports> aSupport;
|
||||
nsCOMPtr<nsIMsgFolder> child;
|
||||
mSubFolders->Count(&cnt);
|
||||
if (cnt > 0)
|
||||
for (i = 0; i < cnt; i++)
|
||||
{
|
||||
aSupport = getter_AddRefs(mSubFolders->ElementAt(i));
|
||||
child = do_QueryInterface(aSupport);
|
||||
if (child)
|
||||
child->ForceDBClosed();
|
||||
}
|
||||
}
|
||||
if (mDatabase)
|
||||
{
|
||||
mDatabase->ForceClosed();
|
||||
mDatabase = null_nsCOMPtr();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImapMailFolder::RenameLocal(const char *newName)
|
||||
{
|
||||
|
@ -118,7 +118,6 @@ public:
|
||||
NS_IMETHOD CreateSubfolder(const PRUnichar *folderName);
|
||||
NS_IMETHOD AddSubfolder(nsAutoString *name, nsIMsgFolder **child);
|
||||
|
||||
NS_IMETHOD ForceDBClosed();
|
||||
NS_IMETHOD Compact();
|
||||
NS_IMETHOD EmptyTrash(nsIMsgWindow *msgWindow);
|
||||
NS_IMETHOD Delete ();
|
||||
|
@ -768,7 +768,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName)
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = GetParent(getter_AddRefs(parent));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
Shutdown(PR_TRUE);
|
||||
ForceDBClosed();
|
||||
nsCOMPtr<nsIMsgFolder> parentFolder = do_QueryInterface(parent);
|
||||
nsCOMPtr<nsISupports> parentSupport = do_QueryInterface(parent);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user