|
|
b3cc454 |
Index: mozilla/uriloader/exthandler/unix/nsOSHelperAppService.cpp
|
|
|
b3cc454 |
===================================================================
|
|
|
b3cc454 |
RCS file: /cvsroot/mozilla/uriloader/exthandler/unix/nsOSHelperAppService.cpp,v
|
|
|
b3cc454 |
retrieving revision 1.58.20.1
|
|
|
b3cc454 |
retrieving revision 1.58
|
|
|
b3cc454 |
diff -d -u -p -r1.58.20.1 -r1.58
|
|
|
b3cc454 |
--- mozilla/uriloader/exthandler/unix/nsOSHelperAppService.cpp 16 Apr 2007 18:54:53 -0000 1.58.20.1
|
|
|
b3cc454 |
+++ mozilla/uriloader/exthandler/unix/nsOSHelperAppService.cpp 25 Oct 2004 07:46:01 -0000 1.58
|
|
|
b3cc454 |
@@ -1506,8 +1506,13 @@ nsOSHelperAppService::GetFromType(const
|
|
|
b3cc454 |
|
|
|
b3cc454 |
nsDependentSubstring majorType(majorTypeStart, majorTypeEnd);
|
|
|
b3cc454 |
nsDependentSubstring minorType(minorTypeStart, minorTypeEnd);
|
|
|
b3cc454 |
+ nsAutoString extensions, mime_types_description;
|
|
|
b3cc454 |
+ LookUpExtensionsAndDescription(majorType,
|
|
|
b3cc454 |
+ minorType,
|
|
|
b3cc454 |
+ extensions,
|
|
|
b3cc454 |
+ mime_types_description);
|
|
|
b3cc454 |
+
|
|
|
b3cc454 |
|
|
|
b3cc454 |
- // First check the user's private mailcap file
|
|
|
b3cc454 |
nsAutoString mailcap_description, handler, mozillaFlags;
|
|
|
b3cc454 |
DoLookUpHandlerAndDescription(majorType,
|
|
|
b3cc454 |
minorType,
|
|
|
b3cc454 |
@@ -1516,46 +1521,23 @@ nsOSHelperAppService::GetFromType(const
|
|
|
b3cc454 |
mailcap_description,
|
|
|
b3cc454 |
mozillaFlags,
|
|
|
b3cc454 |
PR_TRUE);
|
|
|
b3cc454 |
-
|
|
|
b3cc454 |
- LOG(("Private Handler/Description results: handler='%s', description='%s'\n",
|
|
|
b3cc454 |
- NS_LossyConvertUTF16toASCII(handler).get(),
|
|
|
b3cc454 |
- NS_LossyConvertUTF16toASCII(mailcap_description).get()));
|
|
|
b3cc454 |
|
|
|
b3cc454 |
+
|
|
|
b3cc454 |
+ if (handler.IsEmpty() && extensions.IsEmpty() &&
|
|
|
b3cc454 |
+ mailcap_description.IsEmpty() && mime_types_description.IsEmpty()) {
|
|
|
b3cc454 |
+ // No useful data yet
|
|
|
b3cc454 |
+
|
|
|
b3cc454 |
#ifdef MOZ_WIDGET_GTK2
|
|
|
b3cc454 |
- nsMIMEInfoBase *gnomeInfo = nsnull;
|
|
|
b3cc454 |
- if (handler.IsEmpty()) {
|
|
|
b3cc454 |
- // No useful data yet. Check the GNOME registry. Unfortunately, newer
|
|
|
b3cc454 |
- // GNOME versions no longer have type-to-extension mappings, so we might
|
|
|
b3cc454 |
- // get back a MIMEInfo without any extensions set. In that case we'll have
|
|
|
b3cc454 |
- // to look in our mime.types files for the extensions.
|
|
|
b3cc454 |
LOG(("Looking in GNOME registry\n"));
|
|
|
b3cc454 |
- gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType.get()).get();
|
|
|
b3cc454 |
- if (gnomeInfo && gnomeInfo->HasExtensions()) {
|
|
|
b3cc454 |
- LOG(("Got MIMEInfo from GNOME registry, and it has extensions set\n"));
|
|
|
b3cc454 |
+ nsMIMEInfoBase *gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType.get()).get();
|
|
|
b3cc454 |
+ if (gnomeInfo) {
|
|
|
b3cc454 |
+ LOG(("Got MIMEInfo from GNOME registry\n"));
|
|
|
b3cc454 |
return gnomeInfo;
|
|
|
b3cc454 |
}
|
|
|
b3cc454 |
- }
|
|
|
b3cc454 |
#endif
|
|
|
b3cc454 |
-
|
|
|
b3cc454 |
- // Now look up our extensions
|
|
|
b3cc454 |
- nsAutoString extensions, mime_types_description;
|
|
|
b3cc454 |
- LookUpExtensionsAndDescription(majorType,
|
|
|
b3cc454 |
- minorType,
|
|
|
b3cc454 |
- extensions,
|
|
|
b3cc454 |
- mime_types_description);
|
|
|
b3cc454 |
-
|
|
|
b3cc454 |
-#ifdef MOZ_WIDGET_GTK2
|
|
|
b3cc454 |
- if (gnomeInfo) {
|
|
|
b3cc454 |
- LOG(("Got MIMEInfo from GNOME registry without extensions; setting them "
|
|
|
b3cc454 |
- "to %s\n", NS_LossyConvertUTF16toASCII(extensions).get()));
|
|
|
b3cc454 |
-
|
|
|
b3cc454 |
- NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?");
|
|
|
b3cc454 |
- gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions));
|
|
|
b3cc454 |
- return gnomeInfo;
|
|
|
b3cc454 |
}
|
|
|
b3cc454 |
-#endif
|
|
|
b3cc454 |
|
|
|
b3cc454 |
- if (handler.IsEmpty()) {
|
|
|
b3cc454 |
+ if (handler.IsEmpty() && mailcap_description.IsEmpty()) {
|
|
|
b3cc454 |
DoLookUpHandlerAndDescription(majorType,
|
|
|
b3cc454 |
minorType,
|
|
|
b3cc454 |
typeOptions,
|
|
|
b3cc454 |
@@ -1565,7 +1547,7 @@ nsOSHelperAppService::GetFromType(const
|
|
|
b3cc454 |
PR_FALSE);
|
|
|
b3cc454 |
}
|
|
|
b3cc454 |
|
|
|
b3cc454 |
- if (handler.IsEmpty()) {
|
|
|
b3cc454 |
+ if (handler.IsEmpty() && mailcap_description.IsEmpty()) {
|
|
|
b3cc454 |
DoLookUpHandlerAndDescription(majorType,
|
|
|
b3cc454 |
NS_LITERAL_STRING("*"),
|
|
|
b3cc454 |
typeOptions,
|
|
|
b3cc454 |
@@ -1575,7 +1557,7 @@ nsOSHelperAppService::GetFromType(const
|
|
|
b3cc454 |
PR_TRUE);
|
|
|
b3cc454 |
}
|
|
|
b3cc454 |
|
|
|
b3cc454 |
- if (handler.IsEmpty()) {
|
|
|
b3cc454 |
+ if (handler.IsEmpty() && mailcap_description.IsEmpty()) {
|
|
|
b3cc454 |
DoLookUpHandlerAndDescription(majorType,
|
|
|
b3cc454 |
NS_LITERAL_STRING("*"),
|
|
|
b3cc454 |
typeOptions,
|