fix nsFileSpec bustage

This commit is contained in:
bienvenu%netscape.com 1999-03-10 03:55:10 +00:00
parent d5166ef72e
commit 38dde3b863
2 changed files with 12 additions and 9 deletions

View File

@ -419,9 +419,18 @@ nsresult nsMailDatabase::SetFolderInfoValid(nsFileSpec &folderName, int num, int
nsFileSpec summaryPath(summarySpec);
nsresult err;
if (stat((const char*) folderName, &st))
char *nativeFileName = nsCRT::strdup(folderName);
#ifdef XP_PC
UnixToNative(nativeFileName);
#endif
if (!folderName.Exists())
return NS_MSG_ERROR_FOLDER_SUMMARY_MISSING;
stat(nativeFileName, &st);
PR_FREEIF(nativeFileName); // ### use file spec method for size and time stamp when they're written.
// should we have type safe downcast methods again?
nsMailDatabase *pMessageDB = (nsMailDatabase *) nsMailDatabase::FindInCache(summaryPath);
if (pMessageDB == NULL)

View File

@ -237,8 +237,7 @@ int nsMsgDatabase::FindInCache(nsMsgDatabase* pMessageDB)
PRBool nsMsgDatabase::MatchDbName(nsFileSpec &dbName) // returns PR_TRUE if they match
{
// ### we need equality operators for nsFileSpec...
return !strcmp(dbName, m_dbName);
return (m_dbName == dbName);
}
//----------------------------------------------------------------------
@ -259,10 +258,7 @@ void nsMsgDatabase::DumpCache()
{
for (PRUint32 i = 0; i < GetDBCache()->Count(); i++)
{
#ifdef DEBUG_bienvenu
nsMsgDatabase* pMessageDB =
#endif
GetDBCache()->ElementAt(i);
nsMsgDatabase* pMessageDB = NS_STATIC_CAST(nsMsgDatabase*, GetDBCache()->ElementAt(i));
}
}
#endif /* DEBUG */
@ -323,8 +319,6 @@ extern nsIMdbFactory *NS_NewIMdbFactory();
static nsIMdbFactory *gMDBFactory = NULL;
if (!gMDBFactory)
{
// gMDBFactory = new nsIMdbFactory;
// ### hook up class factory code when it's working
gMDBFactory = MakeMdbFactory(); //new nsIMdbFactory;
}
return gMDBFactory;