From 4edef5c43bebf572c6aeb5fdd76bec213971ed9c Mon Sep 17 00:00:00 2001 From: "racham%netscape.com" Date: Tue, 22 Feb 2000 00:01:39 +0000 Subject: [PATCH] Fixing bugs 28243, 27402 and 27850. MozRegistry is updated whenever the profile information is changed. This allows profile selector reflect the registry values directly. r=sspitzer,norris. a=jar,phil git-svn-id: svn://10.0.0.236/trunk@61404 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/profile/src/nsProfile.cpp | 6 ++++++ mozilla/profile/src/nsProfileAccess.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mozilla/profile/src/nsProfile.cpp b/mozilla/profile/src/nsProfile.cpp index 17afce657e0..e0f84a5964b 100644 --- a/mozilla/profile/src/nsProfile.cpp +++ b/mozilla/profile/src/nsProfile.cpp @@ -872,6 +872,7 @@ NS_IMETHODIMP nsProfile::CreateNewProfile(const char* profileName, const char* n gProfileDataAccess->mNumProfiles++; gProfileDataAccess->mProfileDataChanged = PR_TRUE; + gProfileDataAccess->UpdateRegistry(); return NS_OK; } @@ -977,6 +978,7 @@ NS_IMETHODIMP nsProfile::RenameProfile(const char* oldName, const char* newName) if (NS_FAILED(rv)) return rv; gProfileDataAccess->mProfileDataChanged = PR_TRUE; + gProfileDataAccess->UpdateRegistry(); return NS_OK; } @@ -1053,6 +1055,7 @@ NS_IMETHODIMP nsProfile::DeleteProfile(const char* profileName, PRBool canDelete if (NS_FAILED(rv)) return rv; gProfileDataAccess->mProfileDataChanged = PR_TRUE; + gProfileDataAccess->UpdateRegistry(); return rv; } @@ -1156,6 +1159,8 @@ NS_IMETHODIMP nsProfile::MigrateProfileInfo() #endif /* XP_PC || XP_MAC */ + gProfileDataAccess->UpdateRegistry(); + return rv; } @@ -1251,6 +1256,7 @@ NS_IMETHODIMP nsProfile::MigrateProfile(const char* profileName, PRBool showProg gProfileDataAccess->mNumOldProfiles--; gProfileDataAccess->mProfileDataChanged = PR_TRUE; + gProfileDataAccess->UpdateRegistry(); return rv; } diff --git a/mozilla/profile/src/nsProfileAccess.cpp b/mozilla/profile/src/nsProfileAccess.cpp index 11449ee0f48..a0b0771488b 100644 --- a/mozilla/profile/src/nsProfileAccess.cpp +++ b/mozilla/profile/src/nsProfileAccess.cpp @@ -653,8 +653,11 @@ nsProfileAccess::UpdateRegistry() if (NS_FAILED(rv)) return rv; // Set the current profile - rv = m_registry->SetStringUTF8(profilesTreeKey, REGISTRY_CURRENT_PROFILE_STRING, mCurrentProfile); - if (NS_FAILED(rv)) return rv; + if (mCurrentProfile) + { + rv = m_registry->SetStringUTF8(profilesTreeKey, REGISTRY_CURRENT_PROFILE_STRING, mCurrentProfile); + if (NS_FAILED(rv)) return rv; + } // Set the registry version rv = m_registry->SetStringUTF8(profilesTreeKey, REGISTRY_VERSION_STRING, mVersion);