From 837bd0a754eac9f53491b0c542d07ff32daa027d Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Mon, 26 Apr 1999 21:32:47 +0000 Subject: [PATCH] switch to using nsCOMPtr and the new GetLocalPath() api instead of doing something server-type-specific --- mailnews/base/src/nsMsgAppCore.cpp | 33 ++++++++++++------------------ 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/mailnews/base/src/nsMsgAppCore.cpp b/mailnews/base/src/nsMsgAppCore.cpp index d71641e88fc..13a7cbb3045 100644 --- a/mailnews/base/src/nsMsgAppCore.cpp +++ b/mailnews/base/src/nsMsgAppCore.cpp @@ -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 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