From 55243d83a4b703c211641c0cd4413d944d90a2a4 Mon Sep 17 00:00:00 2001 From: "gordon%netscape.com" Date: Tue, 8 Oct 2002 22:35:08 +0000 Subject: [PATCH] Fix bug 113081 "cache capacity not updated until mozilla is relaunched". r=bnesse, sr=darin. --- netwerk/cache/src/nsCacheService.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/netwerk/cache/src/nsCacheService.cpp b/netwerk/cache/src/nsCacheService.cpp index 19d82f9e8c9..905f1d03f38 100644 --- a/netwerk/cache/src/nsCacheService.cpp +++ b/netwerk/cache/src/nsCacheService.cpp @@ -148,6 +148,17 @@ nsCacheProfilePrefObserver::Install() rv = prefInternal->AddObserver(MEMORY_CACHE_CAPACITY_PREF, this, PR_FALSE); if (NS_FAILED(rv)) rv2 = rv; + // determine if we have a profile already + // if there is only a single profile, or it is specified on the commandline + // at startup, our Install() method won't be called until after the + // profile-after-change notification. In that case we detect the presence of + // a profile by the existence of the NS_APP_USER_PROFILE_50_DIR. + nsCOMPtr directory; + rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(directory)); + if (NS_SUCCEEDED(rv)) { + mHaveProfile = PR_TRUE; + } + rv = ReadPrefs(); return NS_SUCCEEDED(rv) ? rv2 : rv;