зеркало из https://github.com/mozilla/pjs.git
Bug #38374 --> more updates for external helper application support.
r=mscott
This commit is contained in:
Родитель
99e2efd493
Коммит
73f32b0692
|
@ -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.
|
||||
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче