change db open for idl
This commit is contained in:
Родитель
b926e593b9
Коммит
966a4db9f6
|
@ -402,7 +402,7 @@ nsresult nsImapMailFolder::GetDatabase()
|
|||
|
||||
rv = nsComponentManager::CreateInstance(kCImapDB, nsnull, nsIMsgDatabase::GetIID(), (void **) getter_AddRefs(mailDBFactory));
|
||||
if (NS_SUCCEEDED(rv) && mailDBFactory)
|
||||
folderOpen = mailDBFactory->Open(pathSpec, PR_TRUE, getter_AddRefs(mDatabase), PR_TRUE);
|
||||
folderOpen = mailDBFactory->Open(pathSpec, PR_TRUE, PR_TRUE, getter_AddRefs(mDatabase));
|
||||
|
||||
if(mDatabase)
|
||||
{
|
||||
|
@ -531,7 +531,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateSubfolder(const char *folderName)
|
|||
nsCOMPtr<nsIMsgDatabase> unusedDB;
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(path, getter_AddRefs(dbFileSpec));
|
||||
rv = mailDBFactory->Open(dbFileSpec, PR_TRUE, (nsIMsgDatabase **) getter_AddRefs(unusedDB), PR_TRUE);
|
||||
rv = mailDBFactory->Open(dbFileSpec, PR_TRUE, PR_TRUE, (nsIMsgDatabase **) getter_AddRefs(unusedDB));
|
||||
|
||||
if (NS_SUCCEEDED(rv) && unusedDB)
|
||||
{
|
||||
|
@ -547,7 +547,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateSubfolder(const char *folderName)
|
|||
//Now let's create the actual new folder
|
||||
rv = AddSubfolder(folderNameStr, getter_AddRefs(child));
|
||||
unusedDB->SetSummaryValid(PR_TRUE);
|
||||
unusedDB->Commit(kLargeCommit);
|
||||
unusedDB->Commit(nsMsgDBCommitType::kLargeCommit);
|
||||
unusedDB->Close(PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
@ -865,7 +865,7 @@ nsresult nsImapMailFolder::GetDBFolderInfoAndDB(
|
|||
rv = GetPath(getter_AddRefs(pathSpec));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
openErr = mailDBFactory->Open(pathSpec, PR_FALSE, (nsIMsgDatabase **) &mailDB, PR_FALSE);
|
||||
openErr = mailDBFactory->Open(pathSpec, PR_FALSE, PR_FALSE, (nsIMsgDatabase **) &mailDB);
|
||||
}
|
||||
|
||||
*db = mailDB;
|
||||
|
@ -1017,10 +1017,10 @@ NS_IMETHODIMP nsImapMailFolder::DeleteMessages(nsISupportsArray *messages,
|
|||
rv = undoMsgTxn->SetUndoString(&undoString);
|
||||
rv = undoMsgTxn->SetRedoString(&redoString);
|
||||
}
|
||||
if (mDatabase)
|
||||
{
|
||||
mDatabase->DeleteMessages(&srcKeyArray, nsnull);
|
||||
}
|
||||
// if (mDatabase)
|
||||
// {
|
||||
// mDatabase->DeleteMessages(&srcKeyArray, nsnull);
|
||||
// }
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
|
@ -1164,8 +1164,8 @@ NS_IMETHODIMP nsImapMailFolder::UpdateImapMailboxInfo(
|
|||
{
|
||||
// if we pass in PR_TRUE for upgrading, the db code will ignore the
|
||||
// summary out of date problem for now.
|
||||
rv = mailDBFactory->Open(pathSpec, PR_TRUE, (nsIMsgDatabase **)
|
||||
getter_AddRefs(mDatabase), PR_TRUE);
|
||||
rv = mailDBFactory->Open(pathSpec, PR_TRUE, PR_TRUE, (nsIMsgDatabase **)
|
||||
getter_AddRefs(mDatabase));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
if (!mDatabase)
|
||||
|
@ -1204,7 +1204,7 @@ NS_IMETHODIMP nsImapMailFolder::UpdateImapMailboxInfo(
|
|||
|
||||
// Create a new summary file, update the folder message counts, and
|
||||
// Close the summary file db.
|
||||
rv = mailDBFactory->Open(pathSpec, PR_TRUE, getter_AddRefs(mDatabase), PR_TRUE);
|
||||
rv = mailDBFactory->Open(pathSpec, PR_TRUE, PR_TRUE, getter_AddRefs(mDatabase));
|
||||
|
||||
// ********** Important *************
|
||||
// David, help me here I don't know this is right or wrong
|
||||
|
@ -2497,7 +2497,7 @@ NS_IMETHODIMP
|
|||
nsImapMailFolder::HeaderFetchCompleted(nsIImapProtocol* aProtocol)
|
||||
{
|
||||
if (mDatabase)
|
||||
mDatabase->Commit(kLargeCommit);
|
||||
mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
|
||||
#ifdef DOING_FILTERS
|
||||
if (m_moveCoalescer)
|
||||
{
|
||||
|
|
|
@ -250,7 +250,7 @@ nsIMAP4TestDriver::~nsIMAP4TestDriver()
|
|||
NS_IF_RELEASE(m_eventQueue);
|
||||
NS_IF_RELEASE(m_url);
|
||||
if (m_mailDB)
|
||||
m_mailDB->Commit(kLargeCommit);
|
||||
m_mailDB->Commit(nsMsgDBCommitType::kLargeCommit);
|
||||
NS_IF_RELEASE(m_mailDB);
|
||||
NS_IF_RELEASE (m_inbox);
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ NS_IMETHODIMP nsMsgMailboxParser::OnStartRequest(nsIURI* aURL, const char *aCont
|
|||
{
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(dbName, getter_AddRefs(dbFileSpec));
|
||||
rv = mailDB->Open(dbFileSpec, PR_TRUE, (nsIMsgDatabase **) getter_AddRefs(m_mailDB), PR_TRUE);
|
||||
rv = mailDB->Open(dbFileSpec, PR_TRUE, PR_TRUE, (nsIMsgDatabase **) getter_AddRefs(m_mailDB));
|
||||
}
|
||||
NS_ASSERTION(m_mailDB, "failed to open mail db parsing folder");
|
||||
printf("url file = %s\n", fileName);
|
||||
|
@ -255,7 +255,7 @@ void nsMsgMailboxParser::UpdateDBFolderInfo(nsIMsgDatabase *mailDB, const char *
|
|||
{
|
||||
// ### wrong - use method on db.
|
||||
mailDB->SetSummaryValid(PR_TRUE);
|
||||
mailDB->Commit(kLargeCommit);
|
||||
mailDB->Commit(nsMsgDBCommitType::kLargeCommit);
|
||||
// m_mailDB->Close();
|
||||
}
|
||||
|
||||
|
@ -1368,7 +1368,7 @@ nsParseNewMailState::Init(nsIFolder *rootFolder, nsFileSpec &folder, nsIOFileStr
|
|||
{
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(folder, getter_AddRefs(dbFileSpec));
|
||||
rv = mailDB->Open(dbFileSpec, PR_TRUE, (nsIMsgDatabase **) getter_AddRefs(m_mailDB), PR_FALSE);
|
||||
rv = mailDB->Open(dbFileSpec, PR_TRUE, PR_FALSE, (nsIMsgDatabase **) getter_AddRefs(m_mailDB));
|
||||
}
|
||||
// rv = nsMailDatabase::Open(folder, PR_TRUE, &m_mailDB, PR_FALSE);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -1815,7 +1815,7 @@ nsresult nsParseNewMailState::MoveIncorporatedMessage(nsIMsgDBHdr *mailHdr,
|
|||
{
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(destFolderSpec, getter_AddRefs(dbFileSpec));
|
||||
rv = mailDBFactory->Open(dbFileSpec, PR_TRUE, (nsIMsgDatabase **) getter_AddRefs(destMailDB), PR_TRUE);
|
||||
rv = mailDBFactory->Open(dbFileSpec, PR_TRUE, PR_TRUE, (nsIMsgDatabase **) getter_AddRefs(destMailDB));
|
||||
}
|
||||
NS_ASSERTION(destMailDB, "failed to open mail db parsing folder");
|
||||
// don't force upgrade in place - open the db here before we start writing to the
|
||||
|
|
|
@ -130,7 +130,7 @@ nsNNTPNewsgroupList::CleanUp() {
|
|||
PR_Free(m_groupName);
|
||||
|
||||
if (m_newsDB) {
|
||||
m_newsDB->Commit(kSessionCommit);
|
||||
m_newsDB->Commit(nsMsgDBCommitType::kSessionCommit);
|
||||
m_newsDB->Close(PR_TRUE);
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,7 @@ nsNNTPNewsgroupList::GetDatabase(const char *uri, nsIMsgDatabase **db)
|
|||
if (NS_SUCCEEDED(rv) && newsDBFactory) {
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(path, getter_AddRefs(dbFileSpec));
|
||||
newsDBOpen = newsDBFactory->Open(dbFileSpec, PR_TRUE, (nsIMsgDatabase **) db, PR_FALSE);
|
||||
newsDBOpen = newsDBFactory->Open(dbFileSpec, PR_TRUE, PR_FALSE, (nsIMsgDatabase **) db);
|
||||
#ifdef DEBUG_NEWS
|
||||
if (NS_SUCCEEDED(newsDBOpen)) {
|
||||
printf ("newsDBFactory->Open() succeeded\n");
|
||||
|
@ -825,7 +825,7 @@ nsNNTPNewsgroupList::FinishXOVERLINE(int status, int *newstatus)
|
|||
#ifdef DEBUG_NEWS
|
||||
printf("committing summary file changes\n");
|
||||
#endif
|
||||
m_newsDB->Commit(kSessionCommit);
|
||||
m_newsDB->Commit(nsMsgDBCommitType::kSessionCommit);
|
||||
m_newsDB->Close(PR_TRUE);
|
||||
m_newsDB = nsnull;
|
||||
}
|
||||
|
|
|
@ -510,7 +510,7 @@ nsresult nsMsgNewsFolder::GetDatabase()
|
|||
rv = nsComponentManager::CreateInstance(kCNewsDB, nsnull, nsIMsgDatabase::GetIID(), getter_AddRefs(newsDBFactory));
|
||||
if (NS_SUCCEEDED(rv) && newsDBFactory)
|
||||
{
|
||||
folderOpen = newsDBFactory->Open(pathSpec, PR_TRUE, getter_AddRefs(mDatabase), PR_FALSE);
|
||||
folderOpen = newsDBFactory->Open(pathSpec, PR_TRUE, PR_FALSE, getter_AddRefs(mDatabase));
|
||||
#ifdef DEBUG_NEWS
|
||||
if (NS_SUCCEEDED(folderOpen)) {
|
||||
printf ("newsDBFactory->Open() succeeded\n");
|
||||
|
@ -728,7 +728,7 @@ NS_IMETHODIMP nsMsgNewsFolder::CreateSubfolder(const char *folderName)
|
|||
rv = nsComponentManager::CreateInstance(kCNewsDB, nsnull, nsIMsgDatabase::GetIID(), getter_AddRefs(newsDBFactory));
|
||||
if (NS_SUCCEEDED(rv) && newsDBFactory) {
|
||||
nsIMsgDatabase *unusedDB = nsnull;
|
||||
rv = newsDBFactory->Open(path, PR_TRUE, (nsIMsgDatabase **) &unusedDB, PR_TRUE);
|
||||
rv = newsDBFactory->Open(path, PR_TRUE, PR_TRUE, (nsIMsgDatabase **) &unusedDB);
|
||||
|
||||
if (NS_SUCCEEDED(rv) && unusedDB) {
|
||||
//need to set the folder name
|
||||
|
@ -958,7 +958,7 @@ nsresult nsMsgNewsFolder::GetDBFolderInfoAndDB(nsIDBFolderInfo **folderInfo, ns
|
|||
if (NS_SUCCEEDED(rv) && newsDBFactory) {
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(*mPath, getter_AddRefs(dbFileSpec));
|
||||
openErr = newsDBFactory->Open(dbFileSpec, PR_FALSE, (nsIMsgDatabase **) &newsDB, PR_FALSE);
|
||||
openErr = newsDBFactory->Open(dbFileSpec, PR_FALSE, PR_FALSE, (nsIMsgDatabase **) &newsDB);
|
||||
}
|
||||
else {
|
||||
return rv;
|
||||
|
|
|
@ -224,7 +224,7 @@ nsresult nsNntpService::ConvertNewsMessageURI2NewsURI(const char *messageURI, ns
|
|||
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(pathResult, getter_AddRefs(dbFileSpec));
|
||||
rv = newsDBFactory->Open(dbFileSpec, PR_TRUE, getter_AddRefs(newsDB), PR_FALSE);
|
||||
rv = newsDBFactory->Open(dbFileSpec, PR_TRUE, PR_FALSE, getter_AddRefs(newsDB));
|
||||
|
||||
if (NS_FAILED(rv) || (!newsDB)) {
|
||||
return rv;
|
||||
|
|
|
@ -542,7 +542,7 @@ NS_IMETHODIMP nsNntpUrl::GetMessageHeader(nsIMsgDBHdr ** aMsgHdr)
|
|||
|
||||
nsCOMPtr <nsIFileSpec> dbFileSpec;
|
||||
NS_NewFileSpecWithSpec(pathResult, getter_AddRefs(dbFileSpec));
|
||||
rv = newsDBFactory->Open(dbFileSpec, PR_TRUE, getter_AddRefs(newsDB), PR_FALSE);
|
||||
rv = newsDBFactory->Open(dbFileSpec, PR_TRUE, PR_FALSE, getter_AddRefs(newsDB));
|
||||
|
||||
if (NS_FAILED(rv) || (!newsDB)) {
|
||||
return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче