Bug #38374 --> more updates for external helper application support.

r=mscott
This commit is contained in:
sspitzer%netscape.com 2000-06-21 01:16:32 +00:00
Родитель 99e2efd493
Коммит 73f32b0692
7 изменённых файлов: 32 добавлений и 13 удалений

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

@ -393,6 +393,7 @@ uriloader/build/Makefile
uriloader/extprotocol/Makefile
uriloader/extprotocol/base/Makefile
uriloader/extprotocol/unix/Makefile
uriloader/exthandler/Makefile
"
MAKEFILES_profile="

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

@ -658,6 +658,7 @@ sub MakeResourceAliases()
_copy(":mozilla:profile:defaults:bookmarks.html","$default_profile_dir"."bookmarks.html");
_copy(":mozilla:profile:defaults:panels.rdf","$default_profile_dir"."panels.rdf");
_copy(":mozilla:profile:defaults:search.rdf","$default_profile_dir"."search.rdf");
_copy(":mozilla:profile:defaults:helperApps.rdf","$default_profile_dir"."helperApps.rdf");
# make a dup in en-US
my($default_profile_dir_en_US) = "$default_profile_dir"."en-US:";
@ -666,6 +667,7 @@ sub MakeResourceAliases()
_copy(":mozilla:profile:defaults:bookmarks.html","$default_profile_dir_en_US"."bookmarks.html");
_copy(":mozilla:profile:defaults:panels.rdf","$default_profile_dir_en_US"."panels.rdf");
_copy(":mozilla:profile:defaults:search.rdf","$default_profile_dir_en_US"."search.rdf");
_copy(":mozilla:profile:defaults:helperApps.rdf","$default_profile_dir_en_US"."helperApps.rdf");
}
# Default _pref_ directory stuff

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

@ -1,3 +1,4 @@
bookmarks.html
panels.rdf
search.rdf
helperApps.rdf

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

@ -31,6 +31,7 @@ FILES := \
bookmarks.html \
panels.rdf \
search.rdf \
helperApps.rdf \
$(NULL)
FILES := $(addprefix $(srcdir)/, $(FILES))

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

@ -28,6 +28,7 @@ FILES=\
bookmarks.html \
panels.rdf \
search.rdf \
helperApps.rdf \
$(NULL)
install::

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

@ -77,6 +77,7 @@
// hack for copying panels.rdf into migrated profile dir
#define PANELS_RDF_FILE "panels.rdf"
#define HELPERAPPS_RDF_FILE "helperApps.rdf"
// A default profile name, in case automigration 4x profile fails
#define DEFAULT_PROFILE_NAME "default"
@ -1309,6 +1310,22 @@ NS_IMETHODIMP nsProfile::MigrateProfileInfo()
return rv;
}
nsresult
nsProfile::CopyDefaultFile(nsIFileSpec *profDefaultsDir, nsFileSpec& newProfDir, const char *fileName)
{
nsFileSpec defaultsDirSpecFile;
profDefaultsDir->GetFileSpec(&defaultsDirSpecFile);
defaultsDirSpecFile += fileName;
if (defaultsDirSpecFile.Exists())
{
defaultsDirSpecFile.CopyToDir(newProfDir);
}
return NS_OK;
}
// Migrate a selected profile
// Set the profile to the current profile....debatable.
@ -1380,7 +1397,7 @@ nsProfile::MigrateProfile(const PRUnichar* profileName, PRBool showProgressAsMod
if (NS_FAILED(rv)) return rv;
// you can do this a bunch of times.
rv = pPrefMigrator->AddProfilePaths(oldProfDirStr, newProfDirStr);
rv = pPrefMigrator->AddProfilePaths(oldProfDirStr, newProfDirStr);
rv = pPrefMigrator->ProcessPrefs(showProgressAsModalWindow);
if (NS_FAILED(rv)) return rv;
@ -1400,19 +1417,12 @@ nsProfile::MigrateProfile(const PRUnichar* profileName, PRBool showProgressAsMod
// Copy panels.rdf file
// This is a hack. Once the localFileSpec implementation
// is complete, this will be removed.
nsFileSpec defaultsDirSpecFile;
profDefaultsDir->GetFileSpec(&defaultsDirSpecFile);
defaultsDirSpecFile += PANELS_RDF_FILE;
if (defaultsDirSpecFile.Exists())
{
defaultsDirSpecFile.CopyToDir(newProfDir);
}
rv = CopyDefaultFile(profDefaultsDir, newProfDir, PANELS_RDF_FILE);
if (NS_FAILED(rv)) return rv;
rv = CopyDefaultFile(profDefaultsDir, newProfDir, HELPERAPPS_RDF_FILE);
if (NS_FAILED(rv)) return rv;
// hack finish.
rv = SetProfileDir(profileName, newProfDir);
if (NS_FAILED(rv)) return rv;

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

@ -65,6 +65,9 @@ private:
PRBool *profileDirSet,
nsCString & profileURLStr);
nsresult LoadDefaultProfileDir(nsCString & profileURLStr);
nsresult CopyDefaultFile(nsIFileSpec *profDefaultsDir,
nsFileSpec& newProfDir,
const char *fileName);
PRBool mAutomigrate;
public: