mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 764706 - Unused variable in nsToolkitProfileService.cpp r=benjamin
This commit is contained in:
parent
21c0933539
commit
1bf90577d2
@ -642,16 +642,16 @@ nsToolkitProfileService::CreateDefaultProfileForApp(const nsACString& aProfileNa
|
||||
&aAppName,
|
||||
&aVendorName);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
||||
nsCOMPtr<nsIFile> profilesini;
|
||||
appData->Clone(getter_AddRefs(profilesini));
|
||||
rv = profilesini->AppendNative(NS_LITERAL_CSTRING("profiles.ini"));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
||||
bool exists = false;
|
||||
profilesini->Exists(&exists);
|
||||
NS_ENSURE_FALSE(exists, NS_ERROR_ALREADY_INITIALIZED);
|
||||
|
||||
|
||||
nsIFile* profileDefaultsDir = aProfileDefaultsDir;
|
||||
rv = CreateProfileInternal(nsnull, nsnull,
|
||||
NS_LITERAL_CSTRING("default"),
|
||||
@ -659,7 +659,7 @@ nsToolkitProfileService::CreateDefaultProfileForApp(const nsACString& aProfileNa
|
||||
&profileDefaultsDir, true, aResult);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
NS_ENSURE_STATE(*aResult);
|
||||
|
||||
|
||||
nsCOMPtr<nsIFile> rootDir;
|
||||
(*aResult)->GetRootDir(getter_AddRefs(rootDir));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -667,12 +667,12 @@ nsToolkitProfileService::CreateDefaultProfileForApp(const nsACString& aProfileNa
|
||||
nsCAutoString profileDir;
|
||||
rv = rootDir->GetRelativeDescriptor(appData, profileDir);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
||||
nsCString ini;
|
||||
ini.SetCapacity(512);
|
||||
ini.AppendASCII("[General]\n");
|
||||
ini.AppendASCII("StartWithLastProfile=1\n\n");
|
||||
|
||||
|
||||
ini.AppendASCII("[Profile0]\n");
|
||||
ini.AppendASCII("Name=default\n");
|
||||
ini.AppendASCII("IsRelative=1\n");
|
||||
@ -680,11 +680,11 @@ nsToolkitProfileService::CreateDefaultProfileForApp(const nsACString& aProfileNa
|
||||
ini.Append(profileDir);
|
||||
ini.AppendASCII("\n");
|
||||
ini.AppendASCII("Default=1\n\n");
|
||||
|
||||
|
||||
FILE* writeFile;
|
||||
rv = profilesini->OpenANSIFileDesc("w", &writeFile);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
||||
if (fwrite(ini.get(), sizeof(char), ini.Length(), writeFile) !=
|
||||
ini.Length()) {
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
@ -754,7 +754,6 @@ nsToolkitProfileService::CreateProfileInternal(nsIFile* aRootDir,
|
||||
}
|
||||
else {
|
||||
nsCOMPtr<nsIFile> file;
|
||||
bool dummy;
|
||||
rv = gDirServiceProvider->GetUserProfilesLocalDir(getter_AddRefs(file),
|
||||
aProfileName,
|
||||
aAppName,
|
||||
@ -812,7 +811,7 @@ nsToolkitProfileService::CreateProfileInternal(nsIFile* aRootDir,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
rv = rootDir->SetPermissions(0700);
|
||||
#ifndef ANDROID
|
||||
#ifndef ANDROID
|
||||
// If the profile is on the sdcard, this will fail but its non-fatal
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
#endif
|
||||
@ -940,7 +939,7 @@ nsToolkitProfileFactory::CreateInstance(nsISupports* aOuter, const nsID& aIID,
|
||||
if (aOuter)
|
||||
return NS_ERROR_NO_AGGREGATION;
|
||||
|
||||
nsCOMPtr<nsIToolkitProfileService> profileService =
|
||||
nsCOMPtr<nsIToolkitProfileService> profileService =
|
||||
nsToolkitProfileService::gService;
|
||||
if (!profileService) {
|
||||
nsresult rv = NS_NewToolkitProfileService(getter_AddRefs(profileService));
|
||||
|
Loading…
Reference in New Issue
Block a user