From c86f2e0aec46217b856dd39c31078108a3c85511 Mon Sep 17 00:00:00 2001 From: "ben%bengoodger.com" Date: Fri, 5 Mar 2004 00:42:05 +0000 Subject: [PATCH] (215094) - here comes profile automigration. Also, change name of Phoenix profile folder to "Firefox". Ensure migration UI is opened modally from automigration system to prevent additional profiles being created by profile startup. git-svn-id: svn://10.0.0.236/trunk@153549 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/app/nsBrowserApp.cpp | 2 +- mozilla/browser/components/build/nsModule.cpp | 6 +++--- .../migration/src/nsPhoenixProfileMigrator.cpp | 4 ++-- .../migration/src/nsProfileMigrator.cpp | 16 ++++++++++++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mozilla/browser/app/nsBrowserApp.cpp b/mozilla/browser/app/nsBrowserApp.cpp index 383d12d19a5..1ca00f09012 100644 --- a/mozilla/browser/app/nsBrowserApp.cpp +++ b/mozilla/browser/app/nsBrowserApp.cpp @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) { nsXREAppData appData; appData.SetSplashEnabled(PR_FALSE); - appData.SetProductName(NS_LITERAL_CSTRING("Phoenix")); + appData.SetProductName(NS_LITERAL_CSTRING("Firefox")); appData.SetUseStartupPrefs(PR_FALSE); return xre_main(argc, argv, appData); diff --git a/mozilla/browser/components/build/nsModule.cpp b/mozilla/browser/components/build/nsModule.cpp index c7fdae70666..e7b5945b53d 100644 --- a/mozilla/browser/components/build/nsModule.cpp +++ b/mozilla/browser/components/build/nsModule.cpp @@ -65,10 +65,10 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBookmarksService, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsHooks) #endif -NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDogbertProfileMigrator) NS_GENERIC_FACTORY_CONSTRUCTOR(nsOperaProfileMigrator) NS_GENERIC_FACTORY_CONSTRUCTOR(nsPhoenixProfileMigrator) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSeamonkeyProfileMigrator) #ifdef XP_WIN NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEProfileMigrator) @@ -99,8 +99,8 @@ static const nsModuleComponentInfo components[] = NS_BOOKMARKS_DATASOURCE_CONTRACTID, nsBookmarksServiceConstructor }, - { "Profile Migrator", - NS_PROFILEMIGRATOR_CID, + { "Profile Migrator", + NS_PROFILEMIGRATOR_CID, NS_PROFILEMIGRATOR_CONTRACTID, nsProfileMigratorConstructor }, diff --git a/mozilla/browser/components/migration/src/nsPhoenixProfileMigrator.cpp b/mozilla/browser/components/migration/src/nsPhoenixProfileMigrator.cpp index 96d8918ded1..6afc25a0de4 100644 --- a/mozilla/browser/components/migration/src/nsPhoenixProfileMigrator.cpp +++ b/mozilla/browser/components/migration/src/nsPhoenixProfileMigrator.cpp @@ -94,13 +94,13 @@ nsPhoenixProfileMigrator::Migrate(PRUint32 aItems, PRBool aReplace, const PRUnic if (!aReplace) return NS_ERROR_FAILURE; - NOTIFY_OBSERVERS(MIGRATION_STARTED, nsnull); - if (!mTargetProfile) GetTargetProfile(aProfile, aReplace); if (!mSourceProfile) GetSourceProfile(aProfile); + NOTIFY_OBSERVERS(MIGRATION_STARTED, nsnull); + COPY_DATA(CopyPreferences, aReplace, nsIBrowserProfileMigrator::SETTINGS); COPY_DATA(CopyCookies, aReplace, nsIBrowserProfileMigrator::COOKIES); COPY_DATA(CopyHistory, aReplace, nsIBrowserProfileMigrator::HISTORY); diff --git a/mozilla/browser/components/migration/src/nsProfileMigrator.cpp b/mozilla/browser/components/migration/src/nsProfileMigrator.cpp index 5d75d91e484..05826004bd7 100644 --- a/mozilla/browser/components/migration/src/nsProfileMigrator.cpp +++ b/mozilla/browser/components/migration/src/nsProfileMigrator.cpp @@ -57,11 +57,8 @@ // nsIProfileMigrator #define MIGRATION_WIZARD_FE_URL "chrome://browser/content/migration/migration.xul" -#ifdef XP_MACOSX -#define MIGRATION_WIZARD_FE_FEATURES "chrome,dialog,centerscreen" -#else #define MIGRATION_WIZARD_FE_FEATURES "chrome,dialog,modal,centerscreen" -#endif + NS_IMETHODIMP nsProfileMigrator::Migrate() { @@ -253,7 +250,18 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsIBrowserProfileMigrator** aMig } } } +#else + // XXXben - until we figure out what to do here with default browsers on MacOS and + // GNOME, simply copy data from a previous Phoenix install. + *aNeedsActiveProfile = PR_FALSE; + nsCOMPtr key(do_CreateInstance("@mozilla.org/supports-string;1")); + key->SetData(NS_LITERAL_STRING("phoenix")); + nsCOMPtr bpm = do_CreateInstance(NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "phoenix"); + + NS_IF_ADDREF(*aKey = key); + NS_IF_ADDREF(*aMigrator = bpm); #endif + return NS_OK; }