part of messenger Mac landing

git-svn-id: svn://10.0.0.236/trunk@25940 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ducarroz%netscape.com 1999-04-01 23:19:59 +00:00
parent 19585f4a1a
commit b3b08bcf5c
4 changed files with 42 additions and 20 deletions

View File

@ -57,6 +57,7 @@
#include "nsIAppShellService.h"
#include "nsAppShellCIDs.h"
#include "nsINetService.h"
#include "nsCopyMessageStreamListener.h"
#include "nsICopyMessageListener.h"
@ -70,9 +71,9 @@ static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID);
static NS_DEFINE_CID(kCPop3ServiceCID, NS_POP3SERVICE_CID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID);
static NS_DEFINE_CID(kNetServiceCID, NS_NETSERVICE_CID);
static NS_DEFINE_IID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID);
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
// that doesn't allow you to call ::nsISupports::GetIID() inside of a class
// that multiply inherits from nsISupports
@ -351,14 +352,21 @@ nsMsgAppCore::Open3PaneWindow()
rv = nsServiceManager::GetService(kAppShellServiceCID,
nsIAppShellService::GetIID(),
(nsISupports**)&appShell);
nsIURL* url;
nsIWebShellWindow* newWindow;
rv = NS_NewURL(&url, urlstr);
if (NS_FAILED(rv)) {
goto done;
nsIURL* url = nsnull;
nsINetService * pNetService;
rv = nsServiceManager::GetService(kNetServiceCID, nsINetService::GetIID(), (nsISupports **)&pNetService);
if (NS_SUCCEEDED(rv) && pNetService) {
rv = pNetService->CreateURL(&url, urlstr);
NS_RELEASE(pNetService);
if (NS_FAILED(rv))
goto done;
}
else
goto done;
nsIWebShellWindow* newWindow;
controllerCID = "6B75BB61-BD41-11d2-9D31-00805F8ADDDE";
appShell->CreateTopLevelWindow(nsnull, // parent
url,

View File

@ -49,11 +49,6 @@ char *INTL_Strstr(int16 charSetID, const char *s1, const char *s2)
#undef FREEIF
#define FREEIF(obj) do { if (obj) { PR_Free (obj); obj = 0; }} while (0)
extern "C"
{
extern int MK_OUT_OF_MEMORY;
}
#define CS_APP_DEFAULT INTL_DefaultWinCharSetID(NULL)
#define COPY_CHAR(_CSID,_D,_S) do { if (!_S || !*_S) { *_D++ = 0; }\
@ -323,13 +318,13 @@ static int msg_parse_rfc822_addresses (PRInt16 csid, const char *line, char **na
name_buf = (char *)PR_Malloc(line_length * 2 + 10);
if (!name_buf)
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
addr_buf = (char *)PR_Malloc(line_length * 2 + 10);
if (!addr_buf)
{
FREEIF(name_buf);
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
}
line_end = line;

View File

@ -1189,7 +1189,8 @@ NS_IMETHODIMP nsMsgFolder::ReadDBFolderInfo(PRBool force)
{
nsIDBFolderInfo *folderInfo;
nsMsgDatabase *db;
if((result = NS_SUCCEEDED(GetDBFolderInfoAndDB(&folderInfo, &db))))
result = NS_SUCCEEDED(GetDBFolderInfoAndDB(&folderInfo, &db));
if(result)
{
mIsCachable = TRUE;
if (folderInfo)
@ -1405,7 +1406,18 @@ nsGetMailboxRoot(nsFileSpec &result)
if (prefs && NS_SUCCEEDED(rv)) {
rv = prefs->Startup("prefs.js");
if (NS_SUCCEEDED(rv)) {
rv = prefs->CopyPathPref(kMsgRootFolderPref, &gMailboxRoot);
#if defined(XP_MAC)
char prefValue[1024];
PRInt32 prefLength = 1024;
rv = prefs->GetCharPref(kMsgRootFolderPref, prefValue, &prefLength);
if (NS_SUCCEEDED(rv) && prefLength > 0) {
gMailboxRoot = PL_strdup(prefValue);
}
#else
rv = prefs->CopyPathPref(kMsgRootFolderPref, &gMailboxRoot);
#endif
}
}
(void)nsServiceManager::ReleaseService(kPrefCID, prefs);
@ -1453,7 +1465,7 @@ nsURI2Path(const char* rootURI, const char* uriStr, nsFileSpec& pathResult)
rv = nsGetMailboxRoot(root);
if (NS_FAILED(rv)) return rv;
nsAutoString path(root);
nsAutoString path((nsFilePath)root);
uri.Cut(0, nsCRT::strlen(rootURI));
PRInt32 uriLen = uri.Length();

View File

@ -471,17 +471,22 @@ char*
nsMsgGroupRecord::GetSaveString()
{
char* pretty = NULL;
char* result = nsnull;
if (m_prettyname) {
pretty = nsEscape(m_prettyname, url_XAlphas);
if (!pretty) return NULL;
}
char* fullname = GetFullName();
if (!fullname) return NULL;
char* result = PR_smprintf("%s,%s,%lx,%lx,%lx" LINEBREAK,
if (!fullname) return NULL; {
long nAddTime;
LL_L2I(nAddTime, m_addtime);
result = PR_smprintf("%s,%s,%lx,%lx,%lx" LINEBREAK,
fullname, pretty ? pretty : "",
(long) (m_flags & ~RUNTIMEFLAGS),
(long) m_addtime,
nAddTime,
(long) m_uniqueId);
}
delete [] fullname;
if (pretty) PR_Free(pretty);
m_flags &= ~F_DIRTY;
@ -575,7 +580,9 @@ nsMsgGroupRecord::Create(nsMsgGroupRecord* parent, const char* saveline,
ptr = endptr;
uniqueid = strtol(ptr, NULL, 16);
result = Create(parent, partname, addtime, uniqueid, fileoffset);
PRInt64 llAddtime;
LL_I2L(llAddtime, addtime);
result = Create(parent, partname, llAddtime, uniqueid, fileoffset);
if (result) {
PRBool maybeCategoryContainer = flags & F_CATCONT;
flags &= ~F_CATCONT;