fixes for rtm++ bugs #55955 and #55444. on mac, migrate if the MagicCookies files doesn't exist. on mac, migrate if the "Mail" or "News" directories don't

exist.  r=putterman,sr=mscott
This commit is contained in:
sspitzer%netscape.com 2000-10-11 02:12:11 +00:00
Родитель c46768930e
Коммит 8f385bcef0
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -1706,6 +1706,9 @@ Fix4xCookies(nsIFileSpec * profilePath) {
nsFileSpec oldCookies(profileDirectory);
oldCookies += COOKIES_FILE_NAME_IN_4x;
/* it is possible that the 4.x cookies file does not exist. just return normally. see #55444 */
if (!oldCookies.Exists()) return NS_OK;
nsInputFileStream inStream(oldCookies);
if (!inStream.is_open()) {
return NS_ERROR_FAILURE;
@ -2054,6 +2057,12 @@ nsPrefMigration::SetPremigratedFilePref(const char *pref_name, nsIFileSpec *path
rv = NS_FileSpecToIFile(&pathSpec, getter_AddRefs(pathFile));
if (NS_FAILED(rv)) return rv;
PRBool exists = PR_FALSE;
pathFile->Exists(&exists);
NS_ASSERTION(exists, "the path does not exist. see bug #55444");
if (!exists) return NS_OK;
rv = m_prefs->SetFileXPref((const char *)premigration_pref, pathFile);
return rv;
}