switch to using nsCOMPtr and the new GetLocalPath() api instead of doing something server-type-specific

This commit is contained in:
alecf%netscape.com 1999-04-26 21:32:47 +00:00
Родитель 4b8fd298bf
Коммит 837bd0a754
1 изменённых файлов: 13 добавлений и 20 удалений

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

@ -535,27 +535,20 @@ void nsMsgAppCore::InitializeFolderRoot()
NS_WITH_SERVICE(nsIMsgMailSession, mailSession, kCMsgMailSessionCID, &rv);
if (NS_FAILED(rv)) return;
nsIMsgIncomingServer* server = nsnull;
rv = mailSession->GetCurrentServer(&server);
if (NS_SUCCEEDED(rv) && server) {
char * folderRoot = nsnull;
nsIPop3IncomingServer *popServer;
rv = server->QueryInterface(nsIPop3IncomingServer::GetIID(),
(void **)&popServer);
if (NS_SUCCEEDED(rv)) {
popServer->GetRootFolderPath(&folderRoot);
if (folderRoot) {
// everyone should have a inbox so let's
// tack that folder name on to the root path...
m_folderPath = folderRoot;
m_folderPath += "Inbox";
} // if we have a folder root for the current identity
NS_IF_RELEASE(popServer);
}
NS_IF_RELEASE(server);
} // if we have an server
nsCOMPtr<nsIMsgIncomingServer> server;
rv = mailSession->GetCurrentServer(getter_AddRefs(server));
char * folderRoot;
if (NS_SUCCEEDED(rv))
rv = server->GetLocalPath(&folderRoot);
if (NS_SUCCEEDED(rv)) {
// everyone should have a inbox so let's
// tack that folder name on to the root path...
m_folderPath = folderRoot;
m_folderPath += "Inbox";
} // if we have a folder root for the current server
return;
}
NS_IMETHODIMP