Bug 390198 Don't migrate all the wallet prefs or the form data file now that wallet is disabled. r=Neil

This commit is contained in:
bugzilla%standard8.demon.co.uk 2007-08-02 18:34:38 +00:00
Родитель c9e3217dd0
Коммит 21b3ae7604
4 изменённых файлов: 14 добавлений и 81 удалений

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

@ -795,25 +795,6 @@ nsNetscapeProfileMigratorBase::CopyCookies(PRBool aReplace)
return ImportNetscapeCookies(seamonkeyCookiesFile);
}
nsresult
nsNetscapeProfileMigratorBase::CopyFormData(PRBool aReplace)
{
nsCString svFileName;
GetSchemaValueFileName(aReplace, getter_Copies(svFileName));
if (svFileName.IsEmpty())
return NS_ERROR_FILE_NOT_FOUND;
if (aReplace)
return CopyFile(svFileName.get(), svFileName.get());
// We don't need to do anything else here - there's no import function
// for form data, so instead we just let the pref functions copy the
// wallet.* prefs across and that'll get us the pref with the correct
// filename in it.
return NS_OK;
}
nsresult
nsNetscapeProfileMigratorBase::CopyPasswords(PRBool aReplace)
{
@ -863,26 +844,6 @@ nsNetscapeProfileMigratorBase::CopyUserSheet(const char* aFileName)
nsDependentCString(aFileName));
}
nsresult
nsNetscapeProfileMigratorBase::GetSchemaValueFileName(PRBool aReplace,
char** aFileName)
{
if (aReplace) {
// Find out what the signons file was called, this is stored in a pref
// in Seamonkey.
nsCOMPtr<nsIPrefService> psvc(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (psvc) {
nsCOMPtr<nsIPrefBranch> branch(do_QueryInterface(psvc));
if (NS_SUCCEEDED(branch->GetCharPref("wallet.SchemaValueFileName",
aFileName)))
return NS_OK;
}
}
return LocateWalletFile("w", aFileName);
}
nsresult
nsNetscapeProfileMigratorBase::GetSignonFileName(PRBool aReplace,
char** aFileName)

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

@ -117,7 +117,7 @@ public:
NS_IMETHOD GetSourceProfiles(nsISupportsArray * *aSourceProfiles);
NS_IMETHOD GetSourceHomePageURL(nsACString & aSourceHomePageURL);
// Pref Transform Methods - these seem only to be used by the dogbert migrator
// Pref Transform Methods
static nsresult GetString(PrefTransform* aTransform, nsIPrefBranch* aBranch);
static nsresult SetString(PrefTransform* aTransform, nsIPrefBranch* aBranch);
static nsresult GetBool(PrefTransform* aTransform, nsIPrefBranch* aBranch);
@ -156,10 +156,8 @@ protected:
// Generic Import Functions
nsresult CopyCookies(PRBool aReplace);
nsresult CopyFormData(PRBool aReplace);
nsresult CopyPasswords(PRBool aReplace);
nsresult CopyUserSheet(const char* aFileName);
nsresult GetSchemaValueFileName(PRBool aReplace, char** aFileName);
nsresult GetSignonFileName(PRBool aReplace, char** aFileName);
nsresult ImportNetscapeCookies(nsIFile* aCookiesFile);
nsresult LocateWalletFile(const char* aExtension, char** aResult);

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

@ -99,7 +99,6 @@ nsSeamonkeyProfileMigrator::Migrate(PRUint16 aItems,
COPY_DATA(CopyCookies, aReplace, nsISuiteProfileMigrator::COOKIES);
COPY_DATA(CopyHistory, aReplace, nsISuiteProfileMigrator::HISTORY);
COPY_DATA(CopyPasswords, aReplace, nsISuiteProfileMigrator::PASSWORDS);
COPY_DATA(CopyFormData, aReplace, nsISuiteProfileMigrator::FORMDATA);
COPY_DATA(CopyOtherData, aReplace, nsISuiteProfileMigrator::OTHERDATA);
COPY_DATA(CopyBookmarks, aReplace, nsISuiteProfileMigrator::BOOKMARKS);
@ -200,21 +199,6 @@ nsSeamonkeyProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
*aResult |= nsISuiteProfileMigrator::PASSWORDS;
}
// Now locate form data
nsCString formDataFileName;
GetSchemaValueFileName(aReplace, getter_Copies(formDataFileName));
if (!formDataFileName.IsEmpty()) {
nsCOMPtr<nsIFile> sourceFormDataFile;
mSourceProfile->Clone(getter_AddRefs(sourceFormDataFile));
sourceFormDataFile->AppendNative(formDataFileName);
PRBool exists;
sourceFormDataFile->Exists(&exists);
if (exists)
*aResult |= nsISuiteProfileMigrator::FORMDATA;
}
return NS_OK;
}
@ -223,7 +207,9 @@ nsSeamonkeyProfileMigrator::GetSupportedItems(PRUint16 *aSupportedItems)
{
NS_ENSURE_ARG_POINTER(aSupportedItems);
*aSupportedItems = nsISuiteProfileMigrator::ALL;
// All except form data
*aSupportedItems = nsISuiteProfileMigrator::ALL &
~nsISuiteProfileMigrator::FORMDATA;
return NS_OK;
}
@ -585,7 +571,15 @@ nsSeamonkeyProfileMigrator::PrefTransform gTransforms[] = {
MAKESAMETYPEPREFTRANSFORM("ui.click_hold_context_menus", Bool),
MAKESAMETYPEPREFTRANSFORM("view_source.syntax_highlight", Bool),
MAKESAMETYPEPREFTRANSFORM("view_source.wrap_long_lines", Bool)
MAKESAMETYPEPREFTRANSFORM("view_source.wrap_long_lines", Bool),
// XXX Because SeaMonkey's default pref for wallet.captureForms is now the
// opposite sense, we can't actually migrate this preference. Therefore,
// disable it for now, and re-enable/fix once bug 390025 is fixed.
// MAKEPREFTRANSFORM("wallet.captureForms", "browser.formfill.enabled", Bool, Bool),
MAKESAMETYPEPREFTRANSFORM("wallet.enabled", Bool),
MAKESAMETYPEPREFTRANSFORM("wallet.crypto", Bool),
MAKESAMETYPEPREFTRANSFORM("wallet.crypto.autocompleteoverride", Bool)
};
nsresult
@ -654,8 +648,7 @@ nsSeamonkeyProfileMigrator::TransformPreferences(const char* aSourcePrefFileName
"privacy.",
"security.OSCP.",
"security.crl.",
"ui.key.",
"wallet."
"ui.key."
};
PBStructArray branches[NS_ARRAY_LENGTH(branchNames)];

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

@ -99,7 +99,6 @@ nsThunderbirdProfileMigrator::Migrate(PRUint16 aItems,
COPY_DATA(CopyCookies, aReplace, nsISuiteProfileMigrator::COOKIES);
COPY_DATA(CopyHistory, aReplace, nsISuiteProfileMigrator::HISTORY);
COPY_DATA(CopyPasswords, aReplace, nsISuiteProfileMigrator::PASSWORDS);
COPY_DATA(CopyFormData, aReplace, nsISuiteProfileMigrator::FORMDATA);
COPY_DATA(CopyOtherData, aReplace, nsISuiteProfileMigrator::OTHERDATA);
// fake notifications for things we've already imported as part of
@ -198,23 +197,6 @@ nsThunderbirdProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
*aResult |= nsISuiteProfileMigrator::PASSWORDS;
}
// Now locate form data
nsCString formDataFileName;
GetSchemaValueFileName(aReplace, getter_Copies(formDataFileName));
if (!formDataFileName.IsEmpty()) {
nsAutoString fileName;
fileName.Assign(NS_ConvertUTF8toUTF16(formDataFileName));
nsCOMPtr<nsIFile> sourceFormDataFile;
mSourceProfile->Clone(getter_AddRefs(sourceFormDataFile));
sourceFormDataFile->Append(fileName);
PRBool exists;
sourceFormDataFile->Exists(&exists);
if (exists)
*aResult |= nsISuiteProfileMigrator::FORMDATA;
}
return NS_OK;
}
@ -229,7 +211,6 @@ nsThunderbirdProfileMigrator::GetSupportedItems(PRUint16 *aSupportedItems)
nsISuiteProfileMigrator::OTHERDATA |
nsISuiteProfileMigrator::JUNKTRAINING |
nsISuiteProfileMigrator::PASSWORDS |
nsISuiteProfileMigrator::FORMDATA |
nsISuiteProfileMigrator::ACCOUNT_SETTINGS |
nsISuiteProfileMigrator::MAILDATA |
nsISuiteProfileMigrator::NEWSDATA |