0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2025-04-09 03:41:36 -05:00

remove usage of vendor for profile/user_appdir location

This commit is contained in:
ohfp 2025-04-05 14:34:17 +02:00
parent a222d15946
commit 0c5f05d58f

View file

@ -1,6 +1,8 @@
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index 3b4612e..cbcb834 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -300,16 +300,16 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) {
@@ -285,16 +285,16 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) {
rv = GetOSXFolderType(kOnSystemDisk, kApplicationSupportFolderType,
getter_AddRefs(localDir));
if (NS_SUCCEEDED(rv)) {
@ -20,8 +22,8 @@
+ "/usr/lib/librewolf"_ns
# endif
;
rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir));
@@ -371,9 +371,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
rv = NS_NewNativeLocalFile(dirname, getter_AddRefs(localDir));
@@ -366,9 +366,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
rv = GetUserDataDirectoryHome(getter_AddRefs(file), false);
NS_ENSURE_SUCCESS(rv, rv);
# if defined(XP_MACOSX)
@ -33,7 +35,7 @@
# endif // defined(XP_MACOSX)
}
#endif // defined(XP_UNIX) || defined(XP_MACOSX)
@@ -411,9 +411,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
@@ -398,9 +398,9 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) {
# ifdef ENABLE_SYSTEM_EXTENSION_DIRS
# if defined(__OpenBSD__) || defined(__FreeBSD__)
@ -43,18 +45,24 @@
- static const char* const sysLExtDir = "/usr/share/mozilla/extensions";
+ static const char* const sysLExtDir = "/usr/share/librewolf/extensions";
# endif
rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false,
rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir),
getter_AddRefs(file));
@@ -1114,7 +1114,7 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
nsDependentCString(hasVendor ? GetAppVendor() : GetAppName())))) {
return NS_ERROR_FAILURE;
}
@@ -926,13 +926,7 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult,
}
appDirPath = Substring(appDirPath, 1, dotIndex - 1);
- bool hasVendor = GetAppVendor() && strlen(GetAppVendor()) != 0;
- if (hasVendor || GetAppName()) {
- if (NS_FAILED(localDir->AppendNative(
- nsDependentCString(hasVendor ? GetAppVendor() : GetAppName())))) {
- return NS_ERROR_FAILURE;
- }
- } else if (NS_FAILED(localDir->AppendNative("Mozilla"_ns))) {
+ } else if (NS_FAILED(localDir->AppendNative("LibreWolf"_ns))) {
+ if (NS_FAILED(localDir->AppendNative("LibreWolf"_ns))) {
return NS_ERROR_FAILURE;
}
@@ -1363,7 +1363,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
@@ -1192,7 +1186,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
#if defined(XP_MACOSX) || defined(XP_WIN)
@ -63,7 +71,7 @@
rv = aFile->AppendNative(nsDependentCString(sXR));
NS_ENSURE_SUCCESS(rv, rv);
@@ -1373,7 +1373,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
@@ -1202,7 +1196,7 @@ nsresult nsXREDirProvider::AppendSysUserExtensionPath(nsIFile* aFile) {
#elif defined(XP_UNIX)
@ -72,3 +80,31 @@
rv = aFile->AppendNative(nsDependentCString(sXR));
NS_ENSURE_SUCCESS(rv, rv);
@@ -1253,10 +1247,6 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
if (!profile.IsEmpty()) {
rv = AppendProfileString(aFile, profile.get());
} else {
- if (!vendor.IsEmpty()) {
- rv = aFile->AppendNative(vendor);
- NS_ENSURE_SUCCESS(rv, rv);
- }
rv = aFile->AppendNative(appName);
}
NS_ENSURE_SUCCESS(rv, rv);
@@ -1288,16 +1278,6 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
rv = AppendProfileString(aFile, folder.BeginReading());
} else {
- if (!vendor.IsEmpty()) {
- folder.Append(vendor);
- ToLowerCase(folder);
-
- rv = aFile->AppendNative(folder);
- NS_ENSURE_SUCCESS(rv, rv);
-
- folder.Truncate();
- }
-
// This can be the case in tests.
if (!appName.IsEmpty()) {
folder.Append(appName);