Bug 176096 Mozilla (Phoenix) should not register as an/default HTML editor, when Composer is not installed.

patch by dean r=timeless sr=sfraser
This commit is contained in:
timeless%mozdev.org 2003-09-19 15:04:30 +00:00
Родитель 44e9eb1cad
Коммит 2b0ca468c3
1 изменённых файлов: 13 добавлений и 7 удалений

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

@ -20,7 +20,8 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Bill Law <law@netscape.com>
* Bill Law <law@netscape.com>
* Dean Tessman <dean_tessman@hotmail.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -801,12 +802,17 @@ nsresult FileTypeRegistryEntry::reset() {
nsresult EditableFileTypeRegistryEntry::set() {
nsresult rv = FileTypeRegistryEntry::set();
if ( NS_SUCCEEDED( rv ) ) {
nsCAutoString editKey( "Software\\Classes\\" );
editKey += protocol;
editKey += "\\shell\\edit\\command";
nsCAutoString editor( thisApplication() );
editor += " -edit \"%1\"";
rv = RegistryEntry( HKEY_LOCAL_MACHINE, editKey.get(), "", editor.get() ).set();
// only set this if we support "-edit" on the command-line
nsCOMPtr<nsICmdLineHandler> editorService =
do_GetService( "@mozilla.org/commandlinehandler/general-startup;1?type=edit", &rv );
if ( NS_SUCCEEDED( rv) ) {
nsCAutoString editKey( "Software\\Classes\\" );
editKey += protocol;
editKey += "\\shell\\edit\\command";
nsCAutoString editor( thisApplication() );
editor += " -edit \"%1\"";
rv = RegistryEntry( HKEY_LOCAL_MACHINE, editKey.get(), "", editor.get() ).set();
}
}
return rv;
}