mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 411353 ? Default bookmarks and Smart folder missing from New Profile (r=bsmedberg, a=revert)
This commit is contained in:
parent
e5419df5fb
commit
55db0fc388
@ -686,7 +686,30 @@ nsToolkitProfileService::CreateProfile(nsILocalFile* aRootDir,
|
||||
return NS_ERROR_FILE_NOT_DIRECTORY;
|
||||
}
|
||||
else {
|
||||
rv = rootDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
|
||||
nsCOMPtr<nsIFile> profileDefaultsDir;
|
||||
nsCOMPtr<nsIFile> profileDirParent;
|
||||
nsCAutoString profileDirName;
|
||||
|
||||
rv = rootDir->GetParent(getter_AddRefs(profileDirParent));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = rootDir->GetNativeLeafName(profileDirName);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRBool dummy;
|
||||
rv = gDirServiceProvider->GetFile(NS_APP_PROFILE_DEFAULTS_50_DIR, &dummy,
|
||||
getter_AddRefs(profileDefaultsDir));
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = profileDefaultsDir->CopyToNative(profileDirParent,
|
||||
profileDirName);
|
||||
if (NS_FAILED(rv)) {
|
||||
// if copying failed, lets just ensure that the profile directory exists.
|
||||
rv = rootDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
rv = rootDir->SetPermissions(0700);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user