comment to explain why we don't rename the profile's directory on disk.

(thanks to mkaply@us.ibm.com for asking why.)
r=racham@netscape.com
This commit is contained in:
sspitzer%netscape.com 2000-08-29 00:20:59 +00:00
Родитель a0a16c7782
Коммит c428f30bc0
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -1198,7 +1198,24 @@ nsProfile::RenameProfile(const PRUnichar* oldName, const PRUnichar* newName)
// Delete old profile entry
rv = DeleteProfile(oldName, PR_FALSE /* don't delete files */);
if (NS_FAILED(rv)) return rv;
/* note, we do not rename the dir on disk to the new name
* we don't rename the directory on purpose.
* we don't require the directory name to match the profile name,
* but it usually does.
* (the pairing of values occurs in the profile registry)
*
* Imagine this scenario:
* 1) user creates a profile "foo" and the directory gets named "foo".
* 2) user creates a profile "bar" and the directory gets named "bar"
* 3) user deletes the profile "foo", but chooses not to delete the files on disk. (they are given this option when deleting a profile)
* 4) user renames "bar" profile to "foo"
*
* things would not work correctly if we renamed the folder on disk.
* for completeness:
* if the user now creates another new profile named "foo", the folder on disk will have a unique name on disk, probably "foo-1".
*/
/* profile is just replaced. But Keep up the count */
gProfileDataAccess->mNumProfiles++;