Final part of Bug 329744 - tidy up some of the string defines/usage. r=Neil.

This commit is contained in:
bugzilla%standard8.demon.co.uk 2007-06-21 19:43:40 +00:00
Родитель e1e59990f5
Коммит f2a284c8dc
8 изменённых файлов: 75 добавлений и 86 удалений

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

@ -241,7 +241,7 @@ nsNetscapeProfileMigratorBase::GetSourceHomePageURL(nsACString& aResult)
nsCOMPtr<nsIFile> sourcePrefsFile; nsCOMPtr<nsIFile> sourcePrefsFile;
mSourceProfile->Clone(getter_AddRefs(sourcePrefsFile)); mSourceProfile->Clone(getter_AddRefs(sourcePrefsFile));
sourcePrefsFile->Append(FILE_NAME_PREFS); sourcePrefsFile->AppendNative(NS_LITERAL_CSTRING(FILE_NAME_PREFS));
psvc->ReadUserPrefs(sourcePrefsFile); psvc->ReadUserPrefs(sourcePrefsFile);
@ -589,13 +589,13 @@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry(nsILocalFile* aRegistr
} }
nsresult nsresult
nsNetscapeProfileMigratorBase::CopyFile(const nsAString& aSourceFileName, nsNetscapeProfileMigratorBase::CopyFile(const char* aSourceFileName,
const nsAString& aTargetFileName) const char* aTargetFileName)
{ {
nsCOMPtr<nsIFile> sourceFile; nsCOMPtr<nsIFile> sourceFile;
mSourceProfile->Clone(getter_AddRefs(sourceFile)); mSourceProfile->Clone(getter_AddRefs(sourceFile));
sourceFile->Append(aSourceFileName); sourceFile->AppendNative(nsDependentCString(aSourceFileName));
PRBool exists = PR_FALSE; PRBool exists = PR_FALSE;
sourceFile->Exists(&exists); sourceFile->Exists(&exists);
if (!exists) if (!exists)
@ -604,12 +604,13 @@ nsNetscapeProfileMigratorBase::CopyFile(const nsAString& aSourceFileName,
nsCOMPtr<nsIFile> targetFile; nsCOMPtr<nsIFile> targetFile;
mTargetProfile->Clone(getter_AddRefs(targetFile)); mTargetProfile->Clone(getter_AddRefs(targetFile));
targetFile->Append(aTargetFileName); targetFile->AppendNative(nsDependentCString(aTargetFileName));
targetFile->Exists(&exists); targetFile->Exists(&exists);
if (exists) if (exists)
targetFile->Remove(PR_FALSE); targetFile->Remove(PR_FALSE);
return sourceFile->CopyTo(mTargetProfile, aTargetFileName); return sourceFile->CopyToNative(mTargetProfile,
nsDependentCString(aTargetFileName));
} }
// helper function, copies the contents of srcDir into destDir. // helper function, copies the contents of srcDir into destDir.
@ -789,7 +790,7 @@ nsNetscapeProfileMigratorBase::CopyCookies(PRBool aReplace)
nsCOMPtr<nsIFile> seamonkeyCookiesFile; nsCOMPtr<nsIFile> seamonkeyCookiesFile;
mSourceProfile->Clone(getter_AddRefs(seamonkeyCookiesFile)); mSourceProfile->Clone(getter_AddRefs(seamonkeyCookiesFile));
seamonkeyCookiesFile->Append(FILE_NAME_COOKIES); seamonkeyCookiesFile->AppendNative(NS_LITERAL_CSTRING(FILE_NAME_COOKIES));
return ImportNetscapeCookies(seamonkeyCookiesFile); return ImportNetscapeCookies(seamonkeyCookiesFile);
} }
@ -803,15 +804,8 @@ nsNetscapeProfileMigratorBase::CopyFormData(PRBool aReplace)
if (svFileName.IsEmpty()) if (svFileName.IsEmpty())
return NS_ERROR_FILE_NOT_FOUND; return NS_ERROR_FILE_NOT_FOUND;
nsAutoString fileName;
fileName.Append(NS_ConvertUTF8toUTF16(svFileName));
if (aReplace) if (aReplace)
return CopyFile(fileName, fileName); return CopyFile(svFileName.get(), svFileName.get());
nsCOMPtr<nsIFile> seamonkeyFormDataFile;
mSourceProfile->Clone(getter_AddRefs(seamonkeyFormDataFile));
seamonkeyFormDataFile->Append(fileName);
// We don't need to do anything else here - there's no import function // 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 // for form data, so instead we just let the pref functions copy the
@ -829,15 +823,12 @@ nsNetscapeProfileMigratorBase::CopyPasswords(PRBool aReplace)
if (signonsFileName.IsEmpty()) if (signonsFileName.IsEmpty())
return NS_ERROR_FILE_NOT_FOUND; return NS_ERROR_FILE_NOT_FOUND;
nsAutoString fileName;
fileName.Assign(NS_ConvertUTF8toUTF16(signonsFileName));
if (aReplace) if (aReplace)
return CopyFile(fileName, fileName); return CopyFile(signonsFileName.get(), signonsFileName.get());
nsCOMPtr<nsIFile> seamonkeyPasswordsFile; nsCOMPtr<nsIFile> seamonkeyPasswordsFile;
mSourceProfile->Clone(getter_AddRefs(seamonkeyPasswordsFile)); mSourceProfile->Clone(getter_AddRefs(seamonkeyPasswordsFile));
seamonkeyPasswordsFile->Append(fileName); seamonkeyPasswordsFile->AppendNative(signonsFileName);
nsCOMPtr<nsIPasswordManagerInternal> pmi( nsCOMPtr<nsIPasswordManagerInternal> pmi(
do_GetService("@mozilla.org/passwordmanager;1")); do_GetService("@mozilla.org/passwordmanager;1"));
@ -850,7 +841,7 @@ nsNetscapeProfileMigratorBase::CopyUserContentSheet()
nsCOMPtr<nsIFile> sourceUserContent; nsCOMPtr<nsIFile> sourceUserContent;
mSourceProfile->Clone(getter_AddRefs(sourceUserContent)); mSourceProfile->Clone(getter_AddRefs(sourceUserContent));
sourceUserContent->Append(DIR_NAME_CHROME); sourceUserContent->Append(DIR_NAME_CHROME);
sourceUserContent->Append(FILE_NAME_USERCONTENT); sourceUserContent->AppendNative(NS_LITERAL_CSTRING(FILE_NAME_USERCONTENT));
PRBool exists = PR_FALSE; PRBool exists = PR_FALSE;
sourceUserContent->Exists(&exists); sourceUserContent->Exists(&exists);
@ -862,13 +853,14 @@ nsNetscapeProfileMigratorBase::CopyUserContentSheet()
targetUserContent->Append(DIR_NAME_CHROME); targetUserContent->Append(DIR_NAME_CHROME);
nsCOMPtr<nsIFile> targetChromeDir; nsCOMPtr<nsIFile> targetChromeDir;
targetUserContent->Clone(getter_AddRefs(targetChromeDir)); targetUserContent->Clone(getter_AddRefs(targetChromeDir));
targetUserContent->Append(FILE_NAME_USERCONTENT); targetUserContent->AppendNative(NS_LITERAL_CSTRING(FILE_NAME_USERCONTENT));
targetUserContent->Exists(&exists); targetUserContent->Exists(&exists);
if (exists) if (exists)
targetUserContent->Remove(PR_FALSE); targetUserContent->Remove(PR_FALSE);
return sourceUserContent->CopyTo(targetChromeDir, FILE_NAME_USERCONTENT); return sourceUserContent->CopyTo(targetChromeDir,
NS_LITERAL_STRING(FILE_NAME_USERCONTENT));
} }
nsresult nsresult
@ -1053,8 +1045,7 @@ nsNetscapeProfileMigratorBase::CopyBookmarks(PRBool aReplace)
if (aReplace) if (aReplace)
return CopyFile(FILE_NAME_BOOKMARKS, FILE_NAME_BOOKMARKS); return CopyFile(FILE_NAME_BOOKMARKS, FILE_NAME_BOOKMARKS);
return ImportNetscapeBookmarks(FILE_NAME_BOOKMARKS, return ImportNetscapeBookmarks(FILE_NAME_BOOKMARKS, "sourceNameSeamonkey");
NS_LITERAL_STRING("sourceNameSeamonkey").get());
} }
nsresult nsresult
@ -1069,14 +1060,15 @@ nsNetscapeProfileMigratorBase::CopyOtherData(PRBool aReplace)
} }
nsresult nsresult
nsNetscapeProfileMigratorBase::ImportNetscapeBookmarks(const nsAString& aBookmarksFileName, nsNetscapeProfileMigratorBase::ImportNetscapeBookmarks(const char* aBookmarksFileName,
const PRUnichar* aImportSourceNameKey) const char* aImportSourceNameKey)
{ {
nsCOMPtr<nsIFile> bookmarksFile; nsCOMPtr<nsIFile> bookmarksFile;
mSourceProfile->Clone(getter_AddRefs(bookmarksFile)); mSourceProfile->Clone(getter_AddRefs(bookmarksFile));
bookmarksFile->Append(aBookmarksFileName); bookmarksFile->AppendNative(nsDependentCString(aBookmarksFileName));
return ImportBookmarksHTML(bookmarksFile, aImportSourceNameKey); return ImportBookmarksHTML(bookmarksFile,
NS_ConvertUTF8toUTF16(aImportSourceNameKey).get());
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -1097,10 +1089,8 @@ nsNetscapeProfileMigratorBase::CopyAddressBookDirectories(PBStructArray &aLdapSe
PrefBranchStruct* pref = aLdapServers.ElementAt(i); PrefBranchStruct* pref = aLdapServers.ElementAt(i);
nsDependentCString prefName(pref->prefName); nsDependentCString prefName(pref->prefName);
if (StringEndsWith(prefName, nsDependentCString(".filename"))) { if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".filename"))) {
// should we be assuming utf-8 or ascii here? CopyFile(pref->stringValue, pref->stringValue);
CopyFile(NS_ConvertUTF8toUTF16(pref->stringValue),
NS_ConvertUTF8toUTF16(pref->stringValue));
} }
// we don't need to do anything to the fileName pref itself // we don't need to do anything to the fileName pref itself
@ -1128,7 +1118,7 @@ nsNetscapeProfileMigratorBase::CopySignatureFiles(PBStructArray &aIdentities,
// old profile root, we'll copy it over to the new profile root and // old profile root, we'll copy it over to the new profile root and
// then set the pref to the new value. Note, this doesn't work for // then set the pref to the new value. Note, this doesn't work for
// multiple signatures that live below the seamonkey profile root // multiple signatures that live below the seamonkey profile root
if (StringEndsWith(prefName, nsDependentCString(".sig_file"))) if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".sig_file")))
{ {
// turn the pref into a nsILocalFile // turn the pref into a nsILocalFile
nsCOMPtr<nsILocalFile> srcSigFile = nsCOMPtr<nsILocalFile> srcSigFile =
@ -1165,8 +1155,8 @@ nsNetscapeProfileMigratorBase::CopySignatureFiles(PBStructArray &aIdentities,
nsresult nsresult
nsNetscapeProfileMigratorBase::CopyJunkTraining(PRBool aReplace) nsNetscapeProfileMigratorBase::CopyJunkTraining(PRBool aReplace)
{ {
return aReplace ? CopyFile(FILE_NAME_JUNKTRAINING, FILE_NAME_JUNKTRAINING) : return aReplace ? CopyFile(FILE_NAME_JUNKTRAINING,
NS_OK; FILE_NAME_JUNKTRAINING) : NS_OK;
} }
nsresult nsresult
@ -1199,7 +1189,7 @@ nsNetscapeProfileMigratorBase::CopyMailFolderPrefs(PBStructArray &aMailServers,
--i; --i;
--count; --count;
} }
else if (StringEndsWith(prefName, nsDependentCString(".directory"))) { else if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".directory"))) {
// let's try to get a branch for this particular server to simplify things // let's try to get a branch for this particular server to simplify things
prefName.Cut(prefName.Length() - strlen("directory"), prefName.Cut(prefName.Length() - strlen("directory"),
strlen("directory")); strlen("directory"));
@ -1260,7 +1250,7 @@ nsNetscapeProfileMigratorBase::CopyMailFolderPrefs(PBStructArray &aMailServers,
pref->stringValue = ToNewCString(descriptorString); pref->stringValue = ToNewCString(descriptorString);
} }
} }
else if (StringEndsWith(prefName, nsDependentCString(".newsrc.file"))) { else if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".newsrc.file"))) {
// copy the news RC file into \News. this won't work if the user has // copy the news RC file into \News. this won't work if the user has
// different newsrc files for each account I don't know what to do in // different newsrc files for each account I don't know what to do in
// that situation. // that situation.

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

@ -56,14 +56,14 @@ struct fileTransactionEntry {
// getting copied // getting copied
}; };
#define FILE_NAME_BOOKMARKS NS_LITERAL_STRING("bookmarks.html") #define FILE_NAME_BOOKMARKS "bookmarks.html"
#define FILE_NAME_COOKIES NS_LITERAL_STRING("cookies.txt") #define FILE_NAME_COOKIES "cookies.txt"
#define FILE_NAME_PREFS NS_LITERAL_STRING("prefs.js") #define FILE_NAME_PREFS "prefs.js"
#define FILE_NAME_JUNKTRAINING NS_LITERAL_STRING("training.dat") #define FILE_NAME_JUNKTRAINING "training.dat"
#define FILE_NAME_VIRTUALFOLDERS NS_LITERAL_STRING("virtualFolders.dat") #define FILE_NAME_VIRTUALFOLDERS "virtualFolders.dat"
#define FILE_NAME_USERCONTENT NS_LITERAL_STRING("userContent.css") #define FILE_NAME_USERCONTENT "userContent.css"
#define FILE_NAME_SEARCH NS_LITERAL_STRING("search.rdf") #define FILE_NAME_SEARCH "search.rdf"
#define FILE_NAME_DOWNLOADS NS_LITERAL_STRING("downloads.rdf") #define FILE_NAME_DOWNLOADS "downloads.rdf"
#define F(a) nsNetscapeProfileMigratorBase::a #define F(a) nsNetscapeProfileMigratorBase::a
@ -146,8 +146,8 @@ protected:
nsresult GetProfileDataFromRegistry(nsILocalFile* aRegistryFile, nsresult GetProfileDataFromRegistry(nsILocalFile* aRegistryFile,
nsISupportsArray* aProfileNames, nsISupportsArray* aProfileNames,
nsISupportsArray* aProfileLocations); nsISupportsArray* aProfileLocations);
nsresult CopyFile(const nsAString& aSourceFileName, nsresult CopyFile(const char* aSourceFileName,
const nsAString& aTargetFileName); const char* aTargetFileName);
nsresult RecursiveCopy(nsIFile* srcDir, nsIFile* destDir); nsresult RecursiveCopy(nsIFile* srcDir, nsIFile* destDir);
void ReadBranch(const char * branchName, nsIPrefService* aPrefService, void ReadBranch(const char * branchName, nsIPrefService* aPrefService,
PBStructArray &aPrefs); PBStructArray &aPrefs);
@ -167,8 +167,8 @@ protected:
// Browser Import Functions // Browser Import Functions
nsresult CopyBookmarks(PRBool aReplace); nsresult CopyBookmarks(PRBool aReplace);
nsresult CopyOtherData(PRBool aReplace); nsresult CopyOtherData(PRBool aReplace);
nsresult ImportNetscapeBookmarks(const nsAString& aBookmarksFileName, nsresult ImportNetscapeBookmarks(const char* aBookmarksFileName,
const PRUnichar* aImportSourceNameKey); const char* aImportSourceNameKey);
// Mail Import Functions // Mail Import Functions
nsresult CopyAddressBookDirectories(PBStructArray &aLdapServers, nsresult CopyAddressBookDirectories(PBStructArray &aLdapServers,

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

@ -52,16 +52,16 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// nsSeamonkeyProfileMigrator // nsSeamonkeyProfileMigrator
#define FILE_NAME_SITEPERM_OLD NS_LITERAL_STRING("cookperm.txt") #define FILE_NAME_SITEPERM_OLD "cookperm.txt"
#define FILE_NAME_SITEPERM_NEW NS_LITERAL_STRING("hostperm.1") #define FILE_NAME_SITEPERM_NEW "hostperm.1"
#define FILE_NAME_CERT8DB NS_LITERAL_STRING("cert8.db") #define FILE_NAME_CERT8DB "cert8.db"
#define FILE_NAME_KEY3DB NS_LITERAL_STRING("key3.db") #define FILE_NAME_KEY3DB "key3.db"
#define FILE_NAME_SECMODDB NS_LITERAL_STRING("secmod.db") #define FILE_NAME_SECMODDB "secmod.db"
#define FILE_NAME_HISTORY NS_LITERAL_STRING("history.dat") #define FILE_NAME_HISTORY "history.dat"
#define FILE_NAME_MIMETYPES NS_LITERAL_STRING("mimeTypes.rdf") #define FILE_NAME_MIMETYPES "mimeTypes.rdf"
#define FILE_NAME_USER_PREFS NS_LITERAL_STRING("user.js") #define FILE_NAME_USER_PREFS "user.js"
#define FILE_NAME_PERSONALDICTIONARY NS_LITERAL_STRING("persdict.dat") #define FILE_NAME_PERSONALDICTIONARY "persdict.dat"
#define FILE_NAME_MAILVIEWS NS_LITERAL_STRING("mailViews.dat") #define FILE_NAME_MAILVIEWS "mailViews.dat"
NS_IMPL_ISUPPORTS2(nsSeamonkeyProfileMigrator, nsISuiteProfileMigrator, NS_IMPL_ISUPPORTS2(nsSeamonkeyProfileMigrator, nsISuiteProfileMigrator,
nsITimerCallback) nsITimerCallback)
@ -585,8 +585,8 @@ nsSeamonkeyProfileMigrator::PrefTransform gTransforms[] = {
}; };
nsresult nsresult
nsSeamonkeyProfileMigrator::TransformPreferences(const nsAString& aSourcePrefFileName, nsSeamonkeyProfileMigrator::TransformPreferences(const char* aSourcePrefFileName,
const nsAString& aTargetPrefFileName) const char* aTargetPrefFileName)
{ {
PrefTransform* transform; PrefTransform* transform;
PrefTransform* end = gTransforms + sizeof(gTransforms)/sizeof(PrefTransform); PrefTransform* end = gTransforms + sizeof(gTransforms)/sizeof(PrefTransform);
@ -597,7 +597,7 @@ nsSeamonkeyProfileMigrator::TransformPreferences(const nsAString& aSourcePrefFil
nsCOMPtr<nsIFile> sourcePrefsFile; nsCOMPtr<nsIFile> sourcePrefsFile;
mSourceProfile->Clone(getter_AddRefs(sourcePrefsFile)); mSourceProfile->Clone(getter_AddRefs(sourcePrefsFile));
sourcePrefsFile->Append(aSourcePrefFileName); sourcePrefsFile->AppendNative(nsDependentCString(aSourcePrefFileName));
psvc->ReadUserPrefs(sourcePrefsFile); psvc->ReadUserPrefs(sourcePrefsFile);
nsCOMPtr<nsIPrefBranch> branch(do_QueryInterface(psvc)); nsCOMPtr<nsIPrefBranch> branch(do_QueryInterface(psvc));
@ -680,7 +680,7 @@ nsSeamonkeyProfileMigrator::TransformPreferences(const nsAString& aSourcePrefFil
nsCOMPtr<nsIFile> targetPrefsFile; nsCOMPtr<nsIFile> targetPrefsFile;
mTargetProfile->Clone(getter_AddRefs(targetPrefsFile)); mTargetProfile->Clone(getter_AddRefs(targetPrefsFile));
targetPrefsFile->Append(aTargetPrefFileName); targetPrefsFile->AppendNative(nsDependentCString(aTargetPrefFileName));
psvc->SavePrefFile(targetPrefsFile); psvc->SavePrefFile(targetPrefsFile);
psvc->ResetPrefs(); psvc->ResetPrefs();

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

@ -69,8 +69,8 @@ public:
protected: protected:
nsresult FillProfileDataFromRegistry(); nsresult FillProfileDataFromRegistry();
nsresult CopyPreferences(PRBool aReplace); nsresult CopyPreferences(PRBool aReplace);
nsresult TransformPreferences(const nsAString& aSourcePrefFileName, nsresult TransformPreferences(const char* aSourcePrefFileName,
const nsAString& aTargetPrefFileName); const char* aTargetPrefFileName);
nsresult CopyHistory(PRBool aReplace); nsresult CopyHistory(PRBool aReplace);
nsresult LocateSignonsFile(char** aResult); nsresult LocateSignonsFile(char** aResult);

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

@ -137,7 +137,7 @@ void GetMigrateDataFromArray(MigrationData* aDataArray,
// replacement can be imported. // replacement can be imported.
if (aReplace || !cursor->replaceOnly) { if (aReplace || !cursor->replaceOnly) {
aSourceProfile->Clone(getter_AddRefs(sourceFile)); aSourceProfile->Clone(getter_AddRefs(sourceFile));
sourceFile->Append(cursor->fileName); sourceFile->AppendNative(nsDependentCString(cursor->fileName));
sourceFile->Exists(&exists); sourceFile->Exists(&exists);
if (exists) if (exists)
*aResult |= cursor->sourceFlag; *aResult |= cursor->sourceFlag;

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

@ -77,7 +77,7 @@ void SetProxyPref(const nsAString& aHostPort, const char* aPref,
const char* aPortPref, nsIPrefBranch* aPrefs); const char* aPortPref, nsIPrefBranch* aPrefs);
struct MigrationData { struct MigrationData {
nsString fileName; char* fileName;
PRUint32 sourceFlag; PRUint32 sourceFlag;
PRBool replaceOnly; PRBool replaceOnly;
}; };

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

@ -53,17 +53,16 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// nsThunderbirdProfileMigrator // nsThunderbirdProfileMigrator
#define FILE_NAME_SITEPERM_OLD NS_LITERAL_STRING("cookperm.txt") #define FILE_NAME_SITEPERM_OLD "cookperm.txt"
#define FILE_NAME_SITEPERM_NEW NS_LITERAL_STRING("hostperm.1") #define FILE_NAME_SITEPERM_NEW "hostperm.1"
#define FILE_NAME_CERT8DB NS_LITERAL_STRING("cert8.db") #define FILE_NAME_CERT8DB "cert8.db"
#define FILE_NAME_KEY3DB NS_LITERAL_STRING("key3.db") #define FILE_NAME_KEY3DB "key3.db"
#define FILE_NAME_SECMODDB NS_LITERAL_STRING("secmod.db") #define FILE_NAME_SECMODDB "secmod.db"
#define FILE_NAME_HISTORY NS_LITERAL_STRING("history.dat") #define FILE_NAME_HISTORY "history.dat"
#define FILE_NAME_MIMETYPES NS_LITERAL_STRING("mimeTypes.rdf") #define FILE_NAME_MIMETYPES "mimeTypes.rdf"
#define FILE_NAME_USER_PREFS NS_LITERAL_STRING("user.js") #define FILE_NAME_USER_PREFS "user.js"
#define FILE_NAME_PERSONALDICTIONARY NS_LITERAL_STRING("persdict.dat") #define FILE_NAME_PERSONALDICTIONARY "persdict.dat"
#define FILE_NAME_MAILVIEWS NS_LITERAL_STRING("mailViews.dat") #define FILE_NAME_MAILVIEWS "mailViews.dat"
#define FILE_NAME_VIRTUALFOLDERS NS_LITERAL_STRING("virtualFolders.dat")
NS_IMPL_ISUPPORTS2(nsThunderbirdProfileMigrator, nsISuiteProfileMigrator, NS_IMPL_ISUPPORTS2(nsThunderbirdProfileMigrator, nsISuiteProfileMigrator,
nsITimerCallback) nsITimerCallback)
@ -558,8 +557,8 @@ nsThunderbirdProfileMigrator::PrefTransform gTransforms[] = {
nsresult nsresult
nsThunderbirdProfileMigrator::TransformPreferences( nsThunderbirdProfileMigrator::TransformPreferences(
const nsAString& aSourcePrefFileName, const char* aSourcePrefFileName,
const nsAString& aTargetPrefFileName) const char* aTargetPrefFileName)
{ {
PrefTransform* transform; PrefTransform* transform;
PrefTransform* end = gTransforms + sizeof(gTransforms)/sizeof(PrefTransform); PrefTransform* end = gTransforms + sizeof(gTransforms)/sizeof(PrefTransform);
@ -570,7 +569,7 @@ nsThunderbirdProfileMigrator::TransformPreferences(
nsCOMPtr<nsIFile> sourcePrefsFile; nsCOMPtr<nsIFile> sourcePrefsFile;
mSourceProfile->Clone(getter_AddRefs(sourcePrefsFile)); mSourceProfile->Clone(getter_AddRefs(sourcePrefsFile));
sourcePrefsFile->Append(aSourcePrefFileName); sourcePrefsFile->AppendNative(nsDependentCString(aSourcePrefFileName));
psvc->ReadUserPrefs(sourcePrefsFile); psvc->ReadUserPrefs(sourcePrefsFile);
nsCOMPtr<nsIPrefBranch> branch(do_QueryInterface(psvc)); nsCOMPtr<nsIPrefBranch> branch(do_QueryInterface(psvc));
@ -639,7 +638,7 @@ nsThunderbirdProfileMigrator::TransformPreferences(
nsCOMPtr<nsIFile> targetPrefsFile; nsCOMPtr<nsIFile> targetPrefsFile;
mTargetProfile->Clone(getter_AddRefs(targetPrefsFile)); mTargetProfile->Clone(getter_AddRefs(targetPrefsFile));
targetPrefsFile->Append(aTargetPrefFileName); targetPrefsFile->AppendNative(nsDependentCString(aTargetPrefFileName));
psvc->SavePrefFile(targetPrefsFile); psvc->SavePrefFile(targetPrefsFile);
psvc->ResetPrefs(); psvc->ResetPrefs();

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

@ -71,8 +71,8 @@ public:
protected: protected:
nsresult FillProfileDataFromRegistry(); nsresult FillProfileDataFromRegistry();
nsresult CopyPreferences(PRBool aReplace); nsresult CopyPreferences(PRBool aReplace);
nsresult TransformPreferences(const nsAString& aSourcePrefFileName, nsresult TransformPreferences(const char* aSourcePrefFileName,
const nsAString& aTargetPrefFileName); const char* aTargetPrefFileName);
nsresult CopyHistory(PRBool aReplace); nsresult CopyHistory(PRBool aReplace);
nsresult LocateSignonsFile(char** aResult); nsresult LocateSignonsFile(char** aResult);
}; };