diff options
author | Matt A. Tobin <email@mattatobin.com> | 2022-04-09 16:54:41 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2022-04-09 16:54:41 -0500 |
commit | eade96a6b6051d17f8f3cec240a11f3afe042d5e (patch) | |
tree | 94a17ad027531701bf2e0ce9166831e0af9abb1d /system | |
parent | c573469adf73455a9f9c472b2c3eed9e051596f6 (diff) | |
download | aura-central-eade96a6b6051d17f8f3cec240a11f3afe042d5e.tar.gz |
Revert "Issue %3057 - Part 4: Stop using GetNativePath in nsAppRunner on Windows."
This reverts commit 7a400c29366038f1f2ac28741e9c9bd8fd8fa062.
Diffstat (limited to 'system')
-rw-r--r-- | system/runtime/nsAppRunner.cpp | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/system/runtime/nsAppRunner.cpp b/system/runtime/nsAppRunner.cpp index c6569dc96..fe2c59479 100644 --- a/system/runtime/nsAppRunner.cpp +++ b/system/runtime/nsAppRunner.cpp @@ -1982,13 +1982,8 @@ SelectProfile(nsIProfileLock* *aResult, nsIToolkitProfileService* aProfileSvc, n profile->GetRootDir(getter_AddRefs(prefsJSFile)); prefsJSFile->AppendNative(NS_LITERAL_CSTRING("prefs.js")); nsAutoCString pathStr; -#ifdef XP_WIN - prefsJSFile->GetPersistentDescriptor(pathStr); -#else prefsJSFile->GetNativePath(pathStr); -#endif PR_fprintf(PR_STDERR, "Success: created profile '%s' at '%s'\n", arg, pathStr.get()); - bool exists; prefsJSFile->Exists(&exists); if (!exists) { @@ -2227,15 +2222,11 @@ CheckCompatibility(nsIFile* aProfileDir, const nsCString& aVersion, return false; nsCOMPtr<nsIFile> lf; - rv = NS_NewNativeLocalFile(EmptyCString(), false, + rv = NS_NewNativeLocalFile(buf, false, getter_AddRefs(lf)); if (NS_FAILED(rv)) return false; - rv = lf->SetPersistentDescriptor(buf); - if (NS_FAILED(rv)) - return false; - bool eq; rv = lf->Equals(aXULRunnerDir, &eq); if (NS_FAILED(rv) || !eq) @@ -2246,15 +2237,11 @@ CheckCompatibility(nsIFile* aProfileDir, const nsCString& aVersion, if (NS_FAILED(rv)) return false; - rv = NS_NewNativeLocalFile(EmptyCString(), false, + rv = NS_NewNativeLocalFile(buf, false, getter_AddRefs(lf)); if (NS_FAILED(rv)) return false; - rv = lf->SetPersistentDescriptor(buf); - if (NS_FAILED(rv)) - return false; - rv = lf->Equals(aAppDir, &eq); if (NS_FAILED(rv) || !eq) return false; @@ -2294,11 +2281,11 @@ WriteVersion(nsIFile* aProfileDir, const nsCString& aVersion, file->AppendNative(FILE_COMPATIBILITY_INFO); nsAutoCString platformDir; - Unused << aXULRunnerDir->GetPersistentDescriptor(platformDir); + aXULRunnerDir->GetNativePath(platformDir); nsAutoCString appDir; if (aAppDir) - Unused << aAppDir->GetPersistentDescriptor(appDir); + aAppDir->GetNativePath(appDir); PRFileDesc *fd; nsresult rv = @@ -3578,16 +3565,6 @@ XREMain::XRE_mainRun() } } -#ifndef XP_WIN - nsCOMPtr<nsIFile> profileDir; - nsAutoCString path; - rv = mDirProvider.GetProfileStartupDir(getter_AddRefs(profileDir)); - if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(profileDir->GetNativePath(path)) && !IsUTF8(path)) { - PR_fprintf(PR_STDERR, "Error: The profile path is not valid UTF-8. Unable to continue.\n"); - return NS_ERROR_FAILURE; - } -#endif - mDirProvider.DoStartup(); // As FilePreferences need the profile directory, we must initialize right here. |