fix creation of special folders to set special folder flag which helps with localized folder name and special folder icons, r/sr=standard8, 467527

This commit is contained in:
David Bienvenu 2009-08-03 07:43:28 -07:00
Родитель 94e92c9228
Коммит 520b2a148e
3 изменённых файлов: 11 добавлений и 1 удалений

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

@ -1334,6 +1334,7 @@ BatchMessageMover.prototype = {
// synchronous.
let isImap = archiveFolder.server.type == "imap";
if (!archiveFolder.parent) {
archiveFolder.setFlag(Ci.nsMsgFolderFlags.Archive);
archiveFolder.createStorageIfMissing(this);
if (isImap)
return;

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

@ -40,6 +40,7 @@
#include "msgCore.h"
#include "nsIMsgHdr.h"
#include "nsMsgUtils.h"
#include "nsMsgFolderFlags.h"
#include "nsStringGlue.h"
#include "nsIServiceManager.h"
#include "nsCOMPtr.h"
@ -901,7 +902,7 @@ GetOrCreateFolder(const nsACString &aURI, nsIUrlListener *aListener)
// force the junk folder name to be Junk so it gets created on disk correctly...
msgFolder->SetName(NS_LITERAL_STRING("Junk"));
msgFolder->SetFlag(nsMsgFolderFlags::Junk);
rv = msgFolder->CreateStorageIfMissing(aListener);
NS_ENSURE_SUCCESS(rv,rv);

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

@ -348,6 +348,8 @@ nsresult
nsMsgCopy::GetUnsentMessagesFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **folder, PRBool *waitForUrl)
{
nsresult ret = LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgQueueForLater, mSavePref, folder);
if (*folder)
(*folder)->SetFlag(nsMsgFolderFlags::Queue);
CreateIfMissing(folder, waitForUrl);
return ret;
}
@ -356,6 +358,8 @@ nsresult
nsMsgCopy::GetDraftsFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **folder, PRBool *waitForUrl)
{
nsresult ret = LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgSaveAsDraft, mSavePref, folder);
if (*folder)
(*folder)->SetFlag(nsMsgFolderFlags::Drafts);
CreateIfMissing(folder, waitForUrl);
return ret;
}
@ -364,6 +368,8 @@ nsresult
nsMsgCopy::GetTemplatesFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **folder, PRBool *waitForUrl)
{
nsresult ret = LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgSaveAsTemplate, mSavePref, folder);
if (*folder)
(*folder)->SetFlag(nsMsgFolderFlags::Templates);
CreateIfMissing(folder, waitForUrl);
return ret;
}
@ -372,6 +378,8 @@ nsresult
nsMsgCopy::GetSentFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **folder, PRBool *waitForUrl)
{
nsresult ret = LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgDeliverNow, mSavePref, folder);
if (*folder)
(*folder)->SetFlag(nsMsgFolderFlags::SentMail);
CreateIfMissing(folder, waitForUrl);
return ret;
}