diff --git a/xpfe/components/winhooks/nsWindowsHooks.cpp b/xpfe/components/winhooks/nsWindowsHooks.cpp index 5565141c089..c21aff2b1fb 100644 --- a/xpfe/components/winhooks/nsWindowsHooks.cpp +++ b/xpfe/components/winhooks/nsWindowsHooks.cpp @@ -98,18 +98,18 @@ const char *xulExts[] = { ".xul", 0 }; const char *htmExts[] = { ".htm", ".html", ".shtml", 0 }; static FileTypeRegistryEntry - jpg( jpgExts, "MozillaJPEG", "Mozilla Joint Photographic Experts Group Image File" ), - gif( gifExts, "MozillaGIF", "Mozilla Graphics Interchange Format Image File" ), - png( pngExts, "MozillaPNG", "Mozilla Portable Network Graphic Image File" ), - mng( mngExts, "MozillaMNG", "Mozilla Multiple-Image Network Graphic Image File" ), - bmp( bmpExts, "MozillaBMP", "Mozilla Bitmap Image File" ), - ico( icoExts, "MozillaICO", "Mozilla Icon File" ), - xml( xmlExts, "MozillaXML", "Mozilla XML File Document" ), - xhtml( xhtmExts, "MozillaXHTML", "Mozilla XHTML File Document" ), - xul( xulExts, "MozillaXUL", "Mozilla XUL File Document" ); + jpg( jpgExts, "MozillaJPEG", "JPEG Image", "jpegfile" ), + gif( gifExts, "MozillaGIF", "GIF Image", "giffile" ), + png( pngExts, "MozillaPNG", "PNG Image", "pngfile" ), + mng( mngExts, "MozillaMNG", "MNG Image", ""), + bmp( bmpExts, "MozillaBMP", "BMP Image", "" ), + ico( icoExts, "MozillaICO", "Icon", "icofile" ), + xml( xmlExts, "MozillaXML", "XML Document", "xmlfile" ), + xhtml( xhtmExts, "MozillaXHTML", "XHTML Document", "" ), + xul( xulExts, "MozillaXUL", "Mozilla XUL Document", "" ); static EditableFileTypeRegistryEntry - mozillaMarkup( htmExts, "MozillaHTML", "Mozilla HyperText Markup Language Document" ); + mozillaMarkup( htmExts, "MozillaHTML", "HTML Document", "htmlfile" ); // Implementation of the nsIWindowsHooksSettings interface. // Use standard implementation of nsISupports stuff. @@ -329,8 +329,8 @@ nsWindowsHooks::CheckSettings( nsIDOMWindowInternal *aParent, settings->mHandleGIF = PR_TRUE; settings->mHandlePNG = PR_TRUE; settings->mHandleMNG = PR_TRUE; - settings->mHandleBMP = PR_TRUE; - settings->mHandleICO = PR_TRUE; + settings->mHandleBMP = PR_FALSE; + settings->mHandleICO = PR_FALSE; settings->mHandleXML = PR_TRUE; settings->mHandleXHTML = PR_TRUE; settings->mHandleXUL = PR_TRUE; diff --git a/xpfe/components/winhooks/nsWindowsHooksUtil.cpp b/xpfe/components/winhooks/nsWindowsHooksUtil.cpp index cfe1eadf5cd..7cf3b8814e5 100644 --- a/xpfe/components/winhooks/nsWindowsHooksUtil.cpp +++ b/xpfe/components/winhooks/nsWindowsHooksUtil.cpp @@ -204,15 +204,20 @@ struct DDERegistryEntry : public SavedRegistryEntry { // For setting entries relating to a file extension (or extensions). // This object itself is for the "file type" associated with the extension. // Set/reset manage the mapping from extension to the file type, as well. +// The description is taken from defDescKey if available. Otherwise desc +// is used. struct FileTypeRegistryEntry : public ProtocolRegistryEntry { nsCString fileType; const char **ext; nsCString desc; - FileTypeRegistryEntry ( const char **ext, const char *fileType, const char *desc ) + nsCString defDescKey; + FileTypeRegistryEntry ( const char **ext, const char *fileType, + const char *desc, const char *defDescKey ) : ProtocolRegistryEntry( fileType ), fileType( fileType ), ext( ext ), - desc( desc ) { + desc( desc ), + defDescKey(defDescKey) { } nsresult set(); nsresult reset(); @@ -222,8 +227,9 @@ struct FileTypeRegistryEntry : public ProtocolRegistryEntry { // // Extends FileTypeRegistryEntry by setting an additional handler for an "edit" command. struct EditableFileTypeRegistryEntry : public FileTypeRegistryEntry { - EditableFileTypeRegistryEntry( const char **ext, const char *fileType, const char *desc ) - : FileTypeRegistryEntry( ext, fileType, desc ) { + EditableFileTypeRegistryEntry( const char **ext, const char *fileType, + const char *desc, const char *defDescKey ) + : FileTypeRegistryEntry( ext, fileType, desc, defDescKey ) { } nsresult set(); }; @@ -559,8 +565,15 @@ nsresult FileTypeRegistryEntry::set() { if ( NS_SUCCEEDED( rv ) ) { nsCAutoString descKey( "Software\\Classes\\" ); descKey += protocol; - RegistryEntry descEntry( HKEY_LOCAL_MACHINE, descKey.get(), NULL, desc.get() ); + RegistryEntry descEntry( HKEY_LOCAL_MACHINE, descKey.get(), NULL, "" ); if ( descEntry.currentSetting().IsEmpty() ) { + nsCAutoString defaultDescKey( "Software\\Classes\\" ); + defaultDescKey += defDescKey; + RegistryEntry defaultDescEntry( HKEY_LOCAL_MACHINE, defaultDescKey.get(), NULL, "" ); + + descEntry.setting = defaultDescEntry.currentSetting(); + if ( descEntry.setting.IsEmpty() ) + descEntry.setting = desc; descEntry.set(); } nsCAutoString iconKey( "Software\\Classes\\" );