a fix the scary message about how migration will kill your 4.x profile.

it just copies, it doesn't not alter the 4.x profile

turn on the profile debugging printfs for everyone, so that we can get
better info in bug reports.  (perhaps this should be using PR_LOG?)

only migrate the 4.x profile info when the user runs -installer

fix the bug where we do automigration on linux, even if their is no ~/.netscape directory

force DEBUG builds to launch the Profile Manager if there were no profile
command line arguments.

a=ben,selmer
This commit is contained in:
sspitzer%netscape.com 2000-02-03 23:43:16 +00:00
Родитель 26b01fbd37
Коммит bc8b3621c5
3 изменённых файлов: 60 добавлений и 35 удалений

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

@ -3,7 +3,7 @@ noneselectedrename=You must select a profile to rename.
wrongnumberselectedrename=You can only rename one profile at a time. Please select only one profile and try again.
migratebeforerename=The profile you have selected was created with a previous version of Communicator and must be converted to a Mozilla profile before it can be renamed. <html:br/><html:br/> Do you want to convert this profile now?<html:br/><html:br/>
migratebeforedelete=The profile you have selected was created with a previous version of Communicator and must be converted to a Mozilla profile before it can be deleted. <html:br/><html:br/> Do you want to convert this profile now?<html:br/><html:br/>Its really really stupid to enforce this. Please let us not require someone to migrate a profile before deleting it! --Ben.<html:br/><html:br/>
migratebeforestart=The profile you have selected was created with a previous version of Communicator and must be converted before you can use it with Mozilla. <html:br/><html:br/>Mozilla can convert this profile for you automatically, but once converted you will not be able to use it in the version of Communicator that created it. <html:br/><html:br/>Choose OK to convert the profile, or Cancel to return to the Profile Manager and select another.<html:br/><html:br/>
migratebeforestart=The profile you have selected was created with a previous version of Communicator and must be converted before you can use it with Mozilla. <html:br/><html:br/>Mozilla can copy your 4.x profile to use for 5.0. Your original 4.x profile will not be altered.<html:br/><html:br/>Choose OK to convert the profile, or Cancel to return to the Profile Manager and select another.<html:br/><html:br/>
renamefailed=Sorry, Mozilla has failed to rename the profile you have selected.<html:br/><html:br/>Resolution:<html:br/>1) Restart Mozilla and try again. <html:br/>2) Close other applications or restart your computer.<html:br/>3) Check to ensure the profile files are not damaged.<html:br/><html:br/>
renameprofilepromptA=Rename the profile "
renameprofilepromptB=" to:
@ -22,4 +22,4 @@ exitButton=Exit
deleteFiles=Delete Files
dontDeleteFiles=Don't Delete Files
cancel=Cancel
cancel=Cancel

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

@ -84,7 +84,6 @@
// A default profile name, in case automigration 4x profile fails
#define DEFAULT_PROFILE_NAME "default"
// kill me now.
#define REGISTRY_YES_STRING "yes"
#define REGISTRY_NO_STRING "no"
@ -105,9 +104,10 @@
#define PREF_CONFIRM_AUTOMIGRATION "profile.confirm_automigration"
#if defined(DEBUG_sspitzer) || defined(DEBUG_seth)
#define DEBUG_profile_ 1
#endif
// we want everyone to have the debugging info to the console for now
// to help track down profile manager problems
// when we ship, we'll turn this off
#define DEBUG_profile 1
// ProfileAccess varaible (gProfileDataAccess) to access registry operations
// gDataAccessInstCount is used to keep track of instance count to activate
@ -391,9 +391,6 @@ nsProfile::ProcessArgs(nsICmdLineService *cmdLineArgs,
printf("Profile Manager : Command Line Options : Begin\n");
#endif
rv = MigrateProfileInfo();
if (NS_FAILED(rv)) return rv;
// check for command line arguments for profile manager
//
// -P command line option works this way:
@ -526,6 +523,9 @@ nsProfile::ProcessArgs(nsICmdLineService *cmdLineArgs,
rv = cmdLineArgs->GetCmdLineValue(INSTALLER_CMD_LINE_ARG, &cmdResult);
if (NS_SUCCEEDED(rv))
{
rv = MigrateProfileInfo();
if (NS_FAILED(rv)) return rv;
if (cmdResult) {
PRInt32 num4xProfiles = 0;
rv = Get4xProfileCount(&num4xProfiles);
@ -565,6 +565,14 @@ nsProfile::ProcessArgs(nsICmdLineService *cmdLineArgs,
}
}
}
#ifdef DEBUG
if (profileURLStr.Length() == 0) {
printf("DEBUG BUILDS ONLY: we are forcing you to use the profile manager to help smoke test it.\n");
profileURLStr = PROFILE_MANAGER_URL;
}
#endif /* DEBUG */
#ifdef DEBUG_profile
printf("Profile Manager : Command Line Options : End\n");
#endif

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

@ -36,7 +36,6 @@
#include "nsFileStream.h"
#include "nsEscape.h"
// kill me now.
#define REGISTRY_YES_STRING "yes"
#define REGISTRY_NO_STRING "no"
@ -933,35 +932,53 @@ nsProfileAccess::Get4xProfileInfo(const char *registryName)
}
if (unixProfileName && unixProfileDirectory) {
nsCAutoString profileLocation(unixProfileDirectory);
profileLocation += "/.netscape";
nsCOMPtr<nsIFileSpec> users4xDotNetscapeDirectory;
rv = NS_NewFileSpec(getter_AddRefs(users4xDotNetscapeDirectory));
if (NS_FAILED(rv)) return rv;
rv = users4xDotNetscapeDirectory->SetNativePath((const char *)profileLocation);
if (NS_FAILED(rv)) return rv;
ProfileStruct* profileItem = new ProfileStruct();
if (!profileItem)
return NS_ERROR_OUT_OF_MEMORY;
rv = users4xDotNetscapeDirectory->Exists(&exists);
if (NS_FAILED(rv)) return rv;
profileItem->profileName = nsnull;
profileItem->profileLocation = nsnull;
profileItem->isMigrated = nsnull;
profileItem->NCProfileName = nsnull;
profileItem->NCDeniedService = nsnull;
profileItem->NCEmailAddress = nsnull;
profileItem->NCHavePregInfo = nsnull;
profileItem->updateProfileEntry = PR_TRUE;
#ifdef DEBUG
printf("%s exists: %d\n",(const char *)profileLocation, exists);
#endif
if (exists) {
ProfileStruct* profileItem = new ProfileStruct();
if (!profileItem)
return NS_ERROR_OUT_OF_MEMORY;
profileItem->profileName = nsCRT::strdup(nsUnescape(unixProfileName));
profileItem->profileLocation = nsCRT::strdup(unixProfileDirectory);
PRInt32 length = PL_strlen(unixProfileDirectory) + PL_strlen("/.netscape");
profileItem->profileLocation = (char *) PR_Realloc(profileItem->profileLocation, length+1);
PL_strcpy(profileItem->profileLocation, unixProfileDirectory);
PL_strcat(profileItem->profileLocation, "/.netscape");
profileItem->isMigrated = nsCRT::strdup(REGISTRY_NO_STRING);
if (!m4xProfiles)
m4xProfiles = new nsVoidArray();
m4xProfiles->AppendElement((void*)profileItem);
mNumOldProfiles++;
profileItem->profileName = nsnull;
profileItem->profileLocation = nsnull;
profileItem->isMigrated = nsnull;
profileItem->NCProfileName = nsnull;
profileItem->NCDeniedService = nsnull;
profileItem->NCEmailAddress = nsnull;
profileItem->NCHavePregInfo = nsnull;
profileItem->updateProfileEntry = PR_TRUE;
profileItem->profileName = nsCRT::strdup(nsUnescape(unixProfileName));
profileItem->profileLocation = nsCRT::strdup((const char *)profileLocation);
profileItem->isMigrated = nsCRT::strdup(REGISTRY_NO_STRING);
if (!m4xProfiles)
m4xProfiles = new nsVoidArray();
m4xProfiles->AppendElement((void*)profileItem);
mNumOldProfiles++;
}
else {
#ifdef DEBUG
printf("no 4.x profile\n");
#endif
}
}
#endif