diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /xpcom/io | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xpcom/io')
-rw-r--r-- | xpcom/io/SpecialSystemDirectory.cpp | 8 | ||||
-rw-r--r-- | xpcom/io/SpecialSystemDirectory.h | 6 | ||||
-rw-r--r-- | xpcom/io/nsDirectoryService.cpp | 8 | ||||
-rw-r--r-- | xpcom/io/nsDirectoryServiceDefs.h | 1 | ||||
-rw-r--r-- | xpcom/io/nsIConverterInputStream.idl | 2 | ||||
-rw-r--r-- | xpcom/io/nsIUnicharInputStream.idl | 2 | ||||
-rw-r--r-- | xpcom/io/nsInputStreamTee.cpp | 1 |
7 files changed, 19 insertions, 9 deletions
diff --git a/xpcom/io/SpecialSystemDirectory.cpp b/xpcom/io/SpecialSystemDirectory.cpp index 4b1055f3fe..419e783a31 100644 --- a/xpcom/io/SpecialSystemDirectory.cpp +++ b/xpcom/io/SpecialSystemDirectory.cpp @@ -94,7 +94,6 @@ static nsresult GetWindowsFolder(int aFolder, nsIFile** aFile) { return NS_NewLocalFile(nsDependentString(path, len), true, aFile); } -# if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) /* * Return the default save-to location for the Windows Library passed in * through aFolderId. @@ -122,7 +121,6 @@ static nsresult GetLibrarySaveToPath(int aFallbackFolderId, return GetWindowsFolder(aFallbackFolderId, aFile); } -# endif /** * Provides a fallback for getting the path to APPDATA or LOCALAPPDATA by @@ -527,6 +525,9 @@ nsresult GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory, case Mac_UserDesktopDirectory: { return GetOSXFolderType(kUserDomain, kDesktopFolderType, aFile); } + case Mac_UserDocumentsDirectory: { + return GetOSXFolderType(kUserDomain, kDocumentsFolderType, aFile); + } case Mac_LocalApplicationsDirectory: { return GetOSXFolderType(kLocalDomain, kApplicationsFolderType, aFile); } @@ -674,12 +675,10 @@ nsresult GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory, } return rv; } -# if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) case Win_Documents: { return GetLibrarySaveToPath(CSIDL_MYDOCUMENTS, FOLDERID_DocumentsLibrary, aFile); } -# endif #endif // XP_WIN #if defined(XP_UNIX) @@ -687,6 +686,7 @@ nsresult GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory, return GetUnixHomeDir(aFile); case Unix_XDG_Desktop: + case Unix_XDG_Documents: case Unix_XDG_Download: return GetUnixXDGUserDirectory(aSystemSystemDirectory, aFile); diff --git a/xpcom/io/SpecialSystemDirectory.h b/xpcom/io/SpecialSystemDirectory.h index e760b0ae26..f1bc101e44 100644 --- a/xpcom/io/SpecialSystemDirectory.h +++ b/xpcom/io/SpecialSystemDirectory.h @@ -30,6 +30,7 @@ enum SystemDirectories { Mac_UserPreferencesDirectory = 107, Mac_PictureDocumentsDirectory = 108, Mac_DefaultScreenshotDirectory = 109, + Mac_UserDocumentsDirectory = 110, Win_SystemDirectory = 201, Win_WindowsDirectory = 202, @@ -42,14 +43,13 @@ enum SystemDirectories { Win_LocalAppdata = 224, Win_ProgramFiles = 225, Win_Downloads = 226, -#if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE) Win_Documents = 228, -#endif Unix_HomeDirectory = 303, Unix_XDG_Desktop = 304, + Unix_XDG_Documents = 305, Unix_XDG_Download = 306, - Unix_SystemConfigDirectory = 307 + Unix_SystemConfigDirectory = 307, }; nsresult GetSpecialSystemDirectory(SystemDirectories aSystemSystemDirectory, diff --git a/xpcom/io/nsDirectoryService.cpp b/xpcom/io/nsDirectoryService.cpp index f5e841c6ea..d5b6c7710c 100644 --- a/xpcom/io/nsDirectoryService.cpp +++ b/xpcom/io/nsDirectoryService.cpp @@ -367,6 +367,9 @@ nsDirectoryService::GetFile(const char* aProp, bool* aPersistent, } else if (inAtom == nsGkAtoms::DirectoryService_OS_DesktopDirectory) { rv = GetSpecialSystemDirectory(Mac_UserDesktopDirectory, getter_AddRefs(localFile)); + } else if (inAtom == nsGkAtoms::DirectoryService_OS_DocumentsDirectory) { + rv = GetSpecialSystemDirectory(Mac_UserDocumentsDirectory, + getter_AddRefs(localFile)); } else if (inAtom == nsGkAtoms::DirectoryService_LocalApplicationsDirectory) { rv = GetSpecialSystemDirectory(Mac_LocalApplicationsDirectory, getter_AddRefs(localFile)); @@ -399,6 +402,8 @@ nsDirectoryService::GetFile(const char* aProp, bool* aPersistent, } else if (inAtom == nsGkAtoms::DirectoryService_OS_DesktopDirectory) { rv = GetSpecialSystemDirectory(Win_Desktopdirectory, getter_AddRefs(localFile)); + } else if (inAtom == nsGkAtoms::DirectoryService_OS_DocumentsDirectory) { + rv = GetSpecialSystemDirectory(Win_Documents, getter_AddRefs(localFile)); } else if (inAtom == nsGkAtoms::DirectoryService_Appdata) { rv = GetSpecialSystemDirectory(Win_Appdata, getter_AddRefs(localFile)); } else if (inAtom == nsGkAtoms::DirectoryService_LocalAppdata) { @@ -422,6 +427,9 @@ nsDirectoryService::GetFile(const char* aProp, bool* aPersistent, } else if (inAtom == nsGkAtoms::DirectoryService_OS_SystemConfigDir) { rv = GetSpecialSystemDirectory(Unix_SystemConfigDirectory, getter_AddRefs(localFile)); + } else if (inAtom == nsGkAtoms::DirectoryService_OS_DocumentsDirectory) { + rv = GetSpecialSystemDirectory(Unix_XDG_Documents, + getter_AddRefs(localFile)); } #endif diff --git a/xpcom/io/nsDirectoryServiceDefs.h b/xpcom/io/nsDirectoryServiceDefs.h index 9f0368ff06..e2458abece 100644 --- a/xpcom/io/nsDirectoryServiceDefs.h +++ b/xpcom/io/nsDirectoryServiceDefs.h @@ -33,6 +33,7 @@ * if there is one, otherwise it's just the same as "Home" */ #define NS_OS_DESKTOP_DIR "Desk" +#define NS_OS_DOCUMENTS_DIR "Docs" #define NS_OS_DEFAULT_DOWNLOAD_DIR "DfltDwnld" diff --git a/xpcom/io/nsIConverterInputStream.idl b/xpcom/io/nsIConverterInputStream.idl index ad1f9bfbc4..1474564a37 100644 --- a/xpcom/io/nsIConverterInputStream.idl +++ b/xpcom/io/nsIConverterInputStream.idl @@ -12,7 +12,7 @@ interface nsIInputStream; * This allows reading unicode strings from a stream, automatically converting * the bytes from a selected character encoding. */ -[scriptable, uuid(FC66FFB6-5404-4908-A4A3-27F92FA0579D)] +[scriptable, builtinclass, uuid(FC66FFB6-5404-4908-A4A3-27F92FA0579D)] interface nsIConverterInputStream : nsIUnicharInputStream { /** * Default replacement char value, U+FFFD REPLACEMENT CHARACTER. diff --git a/xpcom/io/nsIUnicharInputStream.idl b/xpcom/io/nsIUnicharInputStream.idl index 3ae467cc83..5f1b4a6d8e 100644 --- a/xpcom/io/nsIUnicharInputStream.idl +++ b/xpcom/io/nsIUnicharInputStream.idl @@ -42,7 +42,7 @@ native nsWriteUnicharSegmentFun(nsWriteUnicharSegmentFun); * Abstract UTF-16 input stream * @see nsIInputStream */ -[scriptable, uuid(d5e3bd80-6723-4b92-b0c9-22f6162fd94f)] +[scriptable, builtinclass, uuid(d5e3bd80-6723-4b92-b0c9-22f6162fd94f)] interface nsIUnicharInputStream : nsISupports { /** * Reads into a caller-provided array. diff --git a/xpcom/io/nsInputStreamTee.cpp b/xpcom/io/nsInputStreamTee.cpp index 3c0d32e0cb..656f1dcb38 100644 --- a/xpcom/io/nsInputStreamTee.cpp +++ b/xpcom/io/nsInputStreamTee.cpp @@ -10,6 +10,7 @@ #include "mozilla/Maybe.h" #include "mozilla/Mutex.h" #include "mozilla/Attributes.h" +#include "mozilla/IntegerPrintfMacros.h" #include "nsIInputStreamTee.h" #include "nsIInputStream.h" #include "nsIOutputStream.h" |