[tor-commits] [tor-messenger-build/master] Simplify Bug-9173-Change-the-default-Firefox-profile-director.mozpatch

boklm at torproject.org boklm at torproject.org
Mon Jun 29 17:18:14 UTC 2015


commit 9cfd49c575c05e92bb83f148cf11c0199febfb6b
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Mon Jun 29 19:16:22 2015 +0200

    Simplify Bug-9173-Change-the-default-Firefox-profile-director.mozpatch
    
    (noticed by Arlo)
---
 ...e-the-default-Firefox-profile-director.mozpatch |   40 +++++++++-----------
 1 file changed, 17 insertions(+), 23 deletions(-)

diff --git a/projects/instantbird/Bug-9173-Change-the-default-Firefox-profile-director.mozpatch b/projects/instantbird/Bug-9173-Change-the-default-Firefox-profile-director.mozpatch
index e5c78bc..d531b91 100644
--- a/projects/instantbird/Bug-9173-Change-the-default-Firefox-profile-director.mozpatch
+++ b/projects/instantbird/Bug-9173-Change-the-default-Firefox-profile-director.mozpatch
@@ -1,4 +1,4 @@
-From e40c55e5d4c8ea9e354f00277478accae84970de Mon Sep 17 00:00:00 2001
+From 37cc1ee63479d97b6605ff86e0a99bcb1be14121 Mon Sep 17 00:00:00 2001
 From: Kathy Brade <brade at pearlcrescent.com>
 Date: Fri, 18 Oct 2013 15:20:06 -0400
 Subject: [PATCH] Bug #9173: Change the default Firefox profile directory to be
@@ -7,14 +7,14 @@ Subject: [PATCH] Bug #9173: Change the default Firefox profile directory to be
 This should eliminate our need to rely on a wrapper script that sets $HOME and
 launches Firefox with -profile.
 ---
- toolkit/xre/nsXREDirProvider.cpp       | 153 ++++++++-------------------------
+ toolkit/xre/nsXREDirProvider.cpp       | 150 +++++++--------------------------
  toolkit/xre/nsXREDirProvider.h         |  10 +--
  xpcom/io/moz.build                     |   4 +
- xpcom/io/nsAppFileLocationProvider.cpp |  96 ++++++++-------------
- 4 files changed, 79 insertions(+), 184 deletions(-)
+ xpcom/io/nsAppFileLocationProvider.cpp |  93 ++++++++------------
+ 4 files changed, 73 insertions(+), 184 deletions(-)
 
 diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
-index c496a14ce84a..689cb0f8ecb1 100644
+index c496a14ce84a..c3cb676f7184 100644
 --- a/toolkit/xre/nsXREDirProvider.cpp
 +++ b/toolkit/xre/nsXREDirProvider.cpp
 @@ -33,6 +33,7 @@
@@ -45,7 +45,7 @@ index c496a14ce84a..689cb0f8ecb1 100644
      // We must create the profile directory here if it does not exist.
      nsresult tmp = EnsureDirectoryExists(file);
      if (NS_FAILED(tmp)) {
-@@ -1212,82 +1207,45 @@ nsresult
+@@ -1212,82 +1207,42 @@ nsresult
  nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal)
  {
    // Copied from nsAppFileLocationProvider (more or less)
@@ -75,9 +75,6 @@ index c496a14ce84a..689cb0f8ecb1 100644
 -  nsCOMPtr<nsILocalFileMac> dirFileMac = do_QueryInterface(localDir);
 -  NS_ENSURE_TRUE(dirFileMac, NS_ERROR_UNEXPECTED);
 +  int levelsToRemove = 1; // In FF21+, appDir points to browser subdirectory.
-+#if defined(XP_MACOSX)
-+  levelsToRemove += 1;
-+#endif
 +  while (localDir && (levelsToRemove > 0)) {
 +    // When crawling up the hierarchy, components named "." do not count.
 +    nsAutoCString removedName;
@@ -100,16 +97,16 @@ index c496a14ce84a..689cb0f8ecb1 100644
 -    rv = GetShellFolderPath(CSIDL_LOCAL_APPDATA, path);
 -    if (NS_FAILED(rv))
 -      rv = GetRegWindowsAppDataFolder(aLocal, path);
-+    if (didRemove)
-+      --levelsToRemove;
-   }
+-  }
 -  if (!aLocal || NS_FAILED(rv)) {
 -    rv = GetShellFolderPath(CSIDL_APPDATA, path);
 -    if (NS_FAILED(rv)) {
 -      if (!aLocal)
 -        rv = GetRegWindowsAppDataFolder(aLocal, path);
 -    }
--  }
++    if (didRemove)
++      --levelsToRemove;
+   }
 -  NS_ENSURE_SUCCESS(rv, rv);
  
 -  rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir));
@@ -154,7 +151,7 @@ index c496a14ce84a..689cb0f8ecb1 100644
  
    NS_IF_ADDREF(*aFile = localDir);
    return rv;
-@@ -1500,48 +1458,25 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
+@@ -1500,48 +1455,25 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
    }
  
    nsAutoCString profile;
@@ -206,7 +203,7 @@ index c496a14ce84a..689cb0f8ecb1 100644
  
  #elif defined(ANDROID)
    // The directory used for storing profiles
-@@ -1553,12 +1488,6 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
+@@ -1553,12 +1485,6 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
    rv = aFile->AppendNative(nsDependentCString("mozilla"));
    NS_ENSURE_SUCCESS(rv, rv);
  #elif defined(XP_UNIX)
@@ -219,7 +216,7 @@ index c496a14ce84a..689cb0f8ecb1 100644
    if (!profile.IsEmpty()) {
      // Skip any leading path characters
      const char* profileStart = profile.get();
-@@ -1567,31 +1496,17 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
+@@ -1567,31 +1493,17 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
  
      // On the off chance that someone wanted their folder to be hidden don't
      // let it become ".."
@@ -304,7 +301,7 @@ index b4dfc03b4683..6e1936fe8666 100644
 +
  GENERATED_INCLUDES += ['..']
 diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp
-index a5c71e723907..f93e7f430996 100644
+index a5c71e723907..e71e653b08ab 100644
 --- a/xpcom/io/nsAppFileLocationProvider.cpp
 +++ b/xpcom/io/nsAppFileLocationProvider.cpp
 @@ -14,6 +14,7 @@
@@ -327,7 +324,7 @@ index a5c71e723907..f93e7f430996 100644
  //----------------------------------------------------------------------------------------
  NS_METHOD
  nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
-@@ -295,48 +295,45 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
+@@ -295,48 +295,42 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
    bool exists;
    nsCOMPtr<nsIFile> localDir;
  
@@ -342,9 +339,6 @@ index a5c71e723907..f93e7f430996 100644
 +  NS_ENSURE_SUCCESS(rv, rv);
 +
 +  int levelsToRemove = 1; // In FF21+, bin dir points to browser subdirectory.
-+#if defined(XP_MACOSX)
-+  levelsToRemove += 1;
-+#endif
 +  while (localDir && (levelsToRemove > 0)) {
 +    // When crawling up the hierarchy, components named "." do not count.
 +    nsAutoCString removedName;
@@ -409,7 +403,7 @@ index a5c71e723907..f93e7f430996 100644
    rv = localDir->Exists(&exists);
  
    if (NS_SUCCEEDED(rv) && !exists) {
-@@ -356,10 +353,6 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
+@@ -356,10 +350,6 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
  
  //----------------------------------------------------------------------------------------
  // GetDefaultUserProfileRoot - Gets the directory which contains each user profile dir
@@ -420,7 +414,7 @@ index a5c71e723907..f93e7f430996 100644
  //----------------------------------------------------------------------------------------
  NS_METHOD
  nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsIFile** aLocalFile,
-@@ -377,23 +370,6 @@ nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsIFile** aLocalFile,
+@@ -377,23 +367,6 @@ nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsIFile** aLocalFile,
      return rv;
    }
  



More information about the tor-commits mailing list