diff options
author | Moonchild <moonchild@palemoon.org> | 2022-02-03 17:11:21 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-02-03 17:11:21 +0000 |
commit | 097fa969802f76530384926e8ef1f56777be3783 (patch) | |
tree | 8f01134d7c464a164707ce81a47d3a418eef0019 /mailnews | |
parent | 56b8a05db34fabefad74e20876309263066b5bce (diff) | |
download | aura-central-097fa969802f76530384926e8ef1f56777be3783.tar.gz |
Issue %3057 - Part 9: Adjust all callsites for no longer using GetNativePath
Depending on context, various solutions were used.
Diffstat (limited to 'mailnews')
-rw-r--r-- | mailnews/addrbook/src/nsAddrDatabase.cpp | 4 | ||||
-rw-r--r-- | mailnews/base/src/nsMessenger.cpp | 12 | ||||
-rw-r--r-- | mailnews/base/src/nsMsgFolderCache.cpp | 4 | ||||
-rw-r--r-- | mailnews/compose/src/nsMsgCompUtils.cpp | 4 | ||||
-rw-r--r-- | mailnews/compose/src/nsMsgCompose.cpp | 4 | ||||
-rw-r--r-- | mailnews/db/msgdb/src/nsMsgDatabase.cpp | 8 | ||||
-rw-r--r-- | mailnews/imap/src/nsImapMailFolder.cpp | 6 | ||||
-rw-r--r-- | mailnews/import/outlook/src/MapiMessage.cpp | 4 | ||||
-rw-r--r-- | mailnews/local/src/nsLocalUtils.cpp | 4 | ||||
-rw-r--r-- | mailnews/local/src/nsMailboxService.cpp | 4 |
10 files changed, 53 insertions, 1 deletions
diff --git a/mailnews/addrbook/src/nsAddrDatabase.cpp b/mailnews/addrbook/src/nsAddrDatabase.cpp index 463437958..51dbe8237 100644 --- a/mailnews/addrbook/src/nsAddrDatabase.cpp +++ b/mailnews/addrbook/src/nsAddrDatabase.cpp @@ -482,7 +482,11 @@ NS_IMETHODIMP nsAddrDatabase::OpenMDB(nsIFile *dbName, bool create) nsIMdbThumb *thumb = nullptr; nsAutoCString filePath; +#ifdef XP_WIN + ret = dbName->GetPersistentDescriptor(filePath); +#else ret = dbName->GetNativePath(filePath); +#endif NS_ENSURE_SUCCESS(ret, ret); nsIMdbHeap* dbHeap = nullptr; diff --git a/mailnews/base/src/nsMessenger.cpp b/mailnews/base/src/nsMessenger.cpp index 8719530f7..99a1c83d9 100644 --- a/mailnews/base/src/nsMessenger.cpp +++ b/mailnews/base/src/nsMessenger.cpp @@ -598,7 +598,11 @@ nsMessenger::DetachAttachmentsWOPrompts(nsIFile* aDestFolder, NS_ENSURE_SUCCESS(rv, rv); nsAutoCString path; +#ifdef XP_WIN + rv = attachmentDestination->GetPersistentDescriptor(path); +#else rv = attachmentDestination->GetNativePath(path); +#endif NS_ENSURE_SUCCESS(rv, rv); nsAutoString unescapedFileName; @@ -854,7 +858,11 @@ nsMessenger::SaveOneAttachment(const char * aContentType, const char * aURL, SetLastSaveDirectory(localFile); nsCString dirName; +#ifdef XP_WIN + rv = localFile->GetPersistentDescriptor(dirName); +#else rv = localFile->GetNativePath(dirName); +#endif NS_ENSURE_SUCCESS(rv, rv); nsSaveAllAttachmentsState *saveState = @@ -921,7 +929,11 @@ nsMessenger::SaveAllAttachments(uint32_t count, nsCString dirName; nsSaveAllAttachmentsState *saveState = nullptr; +#ifdef XP_WIN + rv = localFile->GetPersistentDescriptor(dirName); +#else rv = localFile->GetNativePath(dirName); +#endif NS_ENSURE_SUCCESS(rv, rv); saveState = new nsSaveAllAttachmentsState(count, diff --git a/mailnews/base/src/nsMsgFolderCache.cpp b/mailnews/base/src/nsMsgFolderCache.cpp index 9510a6e3d..caab422aa 100644 --- a/mailnews/base/src/nsMsgFolderCache.cpp +++ b/mailnews/base/src/nsMsgFolderCache.cpp @@ -236,7 +236,11 @@ NS_IMETHODIMP nsMsgFolderCache::Init(nsIFile *aFile) aFile->Exists(&exists); nsAutoCString dbPath; +#ifdef XP_WIN + aFile->GetPersistentDescriptor(dbPath); +#else aFile->GetNativePath(dbPath); +#endif // ### evil cast until MDB supports file streams. nsresult rv = OpenMDB(dbPath, exists); // if this fails and panacea.dat exists, try blowing away the db and recreating it diff --git a/mailnews/compose/src/nsMsgCompUtils.cpp b/mailnews/compose/src/nsMsgCompUtils.cpp index 6632e3257..f31c5dc1f 100644 --- a/mailnews/compose/src/nsMsgCompUtils.cpp +++ b/mailnews/compose/src/nsMsgCompUtils.cpp @@ -118,7 +118,11 @@ nsMsgCreateTempFileName(const char *tFileName) return nullptr; nsCString tempString; +#ifdef XP_WIN + rv = tmpFile->GetPersistentDescriptor(tempString); +#else rv = tmpFile->GetNativePath(tempString); +#endif if (NS_FAILED(rv)) return nullptr; diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp index a7c2140ad..3dbf74187 100644 --- a/mailnews/compose/src/nsMsgCompose.cpp +++ b/mailnews/compose/src/nsMsgCompose.cpp @@ -4518,7 +4518,11 @@ nsMsgCompose::ProcessSignature(nsIMsgIdentity *identity, bool aQuoted, nsString { rv = identity->GetSignature(getter_AddRefs(sigFile)); if (NS_SUCCEEDED(rv) && sigFile) { +#ifdef XP_WIN + rv = sigFile->GetPersistentDescriptor(sigNativePath); +#else rv = sigFile->GetNativePath(sigNativePath); +#endif if (NS_SUCCEEDED(rv) && !sigNativePath.IsEmpty()) { bool exists = false; sigFile->Exists(&exists); diff --git a/mailnews/db/msgdb/src/nsMsgDatabase.cpp b/mailnews/db/msgdb/src/nsMsgDatabase.cpp index 31da7bc5e..96e74359c 100644 --- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp +++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp @@ -939,7 +939,11 @@ NS_IMETHODIMP nsMsgDatabase::NotifyAnnouncerGoingAway(void) bool nsMsgDatabase::MatchDbName(nsIFile *dbName) // returns true if they match { nsCString dbPath; +#ifdef XP_WIN + dbName->GetPersistentDescriptor(dbPath); +#else dbName->GetNativePath(dbPath); +#endif return dbPath.Equals(m_dbName); } @@ -1197,7 +1201,11 @@ nsresult nsMsgDatabase::OpenInternal(nsMsgDBService *aDBService, bool aLeaveInvalidDB, bool sync) { nsAutoCString summaryFilePath; +#ifdef XP_WIN + summaryFile->GetPersistentDescriptor(summaryFilePath); +#else summaryFile->GetNativePath(summaryFilePath); +#endif MOZ_LOG(DBLog, LogLevel::Info, ("nsMsgDatabase::Open(%s, %s, %p, %s)\n", (const char*)summaryFilePath.get(), aCreate ? "TRUE":"FALSE", diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index da1411cd0..04d639512 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -3203,7 +3203,7 @@ NS_IMETHODIMP nsImapMailFolder::BeginCopy(nsIMsgDBHdr *message) if (NS_FAILED(rv)) { nsCString nativePath; - m_copyState->m_tmpFile->GetNativePath(nativePath); + m_copyState->m_tmpFile->GetPersistentDescriptor(nativePath); MOZ_LOG(IMAP, mozilla::LogLevel::Info, ("couldn't remove prev temp file %s: %lx\n", nativePath.get(), rv)); } m_copyState->m_tmpFile = nullptr; @@ -8883,7 +8883,11 @@ NS_IMETHODIMP nsImapMailFolder::RenameSubFolders(nsIMsgWindow *msgWindow, nsIMsg newParentPathFile->AppendNative(oldLeafName); nsCString newPathStr; +#ifdef XP_WIN + newParentPathFile->GetPersistentDescriptor(newPathStr); +#else newParentPathFile->GetNativePath(newPathStr); +#endif nsCOMPtr<nsIFile> newPathFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); diff --git a/mailnews/import/outlook/src/MapiMessage.cpp b/mailnews/import/outlook/src/MapiMessage.cpp index 6b02db314..2536c1680 100644 --- a/mailnews/import/outlook/src/MapiMessage.cpp +++ b/mailnews/import/outlook/src/MapiMessage.cpp @@ -887,7 +887,11 @@ bool CMapiMessage::CopyBinAttachToFile(LPATTACH lpAttach, NS_ENSURE_SUCCESS(rv, false); nsCString tmpPath; +#ifdef XP_WIN + _tmp_file->GetPersistentDescriptor(tmpPath); +#else _tmp_file->GetNativePath(tmpPath); +#endif LPSTREAM lpStreamFile; HRESULT hr = CMapiApi::OpenStreamOnFile(gpMapiAllocateBuffer, gpMapiFreeBuffer, STGM_READWRITE | STGM_CREATE, const_cast<char*>(tmpPath.get()), NULL, &lpStreamFile); diff --git a/mailnews/local/src/nsLocalUtils.cpp b/mailnews/local/src/nsLocalUtils.cpp index 14a6a2f21..aac4290a9 100644 --- a/mailnews/local/src/nsLocalUtils.cpp +++ b/mailnews/local/src/nsLocalUtils.cpp @@ -150,7 +150,11 @@ nsLocalURI2Path(const char* rootURI, const char* uriStr, nsCString localNativePath; +#ifdef XP_WIN + localPath->GetPersistentDescriptor(localNativePath); +#else localPath->GetNativePath(localNativePath); +#endif nsEscapeNativePath(localNativePath); pathResult = localNativePath.get(); const char *curPos = uriStr + PL_strlen(rootURI); diff --git a/mailnews/local/src/nsMailboxService.cpp b/mailnews/local/src/nsMailboxService.cpp index 00a0d87c8..3621df262 100644 --- a/mailnews/local/src/nsMailboxService.cpp +++ b/mailnews/local/src/nsMailboxService.cpp @@ -52,7 +52,11 @@ nsresult nsMailboxService::ParseMailbox(nsIMsgWindow *aMsgWindow, nsIFile *aMail // okay now generate the url string nsCString mailboxPath; +#ifdef XP_WIN + aMailboxPath->GetPersistentDescriptor(mailboxPath); +#else aMailboxPath->GetNativePath(mailboxPath); +#endif nsAutoCString buf; MsgEscapeURL(mailboxPath, nsINetUtil::ESCAPE_URL_MINIMAL | nsINetUtil::ESCAPE_URL_FORCED, buf); |