зеркало из https://github.com/mozilla/gecko-dev.git
added imap resource to the factory
This commit is contained in:
Родитель
494b3a11bb
Коммит
f831513a5a
|
@ -25,6 +25,7 @@
|
|||
#include "nsImapService.h"
|
||||
#include "pratom.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsImapMailFolder.h"
|
||||
|
||||
// include files for components this factory creates...
|
||||
#include "nsImapUrl.h"
|
||||
|
@ -36,6 +37,7 @@ static NS_DEFINE_CID(kCImapProtocol, NS_IMAPPROTOCOL_CID);
|
|||
static NS_DEFINE_CID(kCImapHostSessionList, NS_IIMAPHOSTSESSIONLIST_CID);
|
||||
static NS_DEFINE_CID(kCImapIncomingServer, NS_IMAPINCOMINGSERVER_CID);
|
||||
static NS_DEFINE_CID(kCImapService, NS_IMAPSERVICE_CID);
|
||||
static NS_DEFINE_CID(kCImapResource, NS_IMAPRESOURCE_CID);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -136,6 +138,21 @@ nsresult nsImapFactory::CreateInstance(nsISupports *aOuter, const nsIID &aIID, v
|
|||
{
|
||||
inst = NS_STATIC_CAST(nsIImapService *, new nsImapService());
|
||||
}
|
||||
else if (mClassID.Equals(kCImapResource))
|
||||
{
|
||||
nsImapMailFolder* aImapMailFolder = new nsImapMailFolder();
|
||||
if (aImapMailFolder)
|
||||
{
|
||||
rv = aImapMailFolder->QueryInterface(aIID, aResult);
|
||||
if (NS_FAILED(rv))
|
||||
delete aImapMailFolder;
|
||||
return rv;
|
||||
}
|
||||
else
|
||||
{
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
if (inst == nsnull)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -213,6 +230,13 @@ NSRegisterSelf(nsISupports* aServMgr, const char* path)
|
|||
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
// register our RDF resource factories:
|
||||
rv = compMgr->RegisterComponent(kCImapResource,
|
||||
"Mail/News Imap Resource Factory",
|
||||
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "imap",
|
||||
path, PR_TRUE, PR_TRUE);
|
||||
if (NS_FAILED(rv)) goto done;
|
||||
|
||||
rv = compMgr->RegisterComponent(kCImapService, nsnull, nsnull,
|
||||
path, PR_TRUE, PR_TRUE);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче