mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 01:59:29 +00:00
Don't return a mime info based on mime type if we didn't get a helper to
use. Bug 109897, r=cbiesinger@web.de, sr=rpotts
This commit is contained in:
parent
ad32eded51
commit
40836c7a18
@ -1247,25 +1247,25 @@ NS_IMETHODIMP nsOSHelperAppService::GetFromMIMEType(const char *aMIMEType,
|
||||
|
||||
nsDependentSubstring majorType(majorTypeStart, majorTypeEnd);
|
||||
nsDependentSubstring minorType(minorTypeStart, minorTypeEnd);
|
||||
LookUpExtensionsAndDescription(majorType,
|
||||
minorType,
|
||||
extensions,
|
||||
mime_types_description);
|
||||
LookUpHandlerAndDescription(majorType,
|
||||
minorType,
|
||||
typeOptions,
|
||||
handler,
|
||||
mailcap_description,
|
||||
mozillaFlags);
|
||||
mailcap_description.Trim(" \t\"");
|
||||
mozillaFlags.Trim(" \t");
|
||||
|
||||
if (extensions.IsEmpty() && mime_types_description.IsEmpty() &&
|
||||
handler.IsEmpty() && mailcap_description.IsEmpty()) {
|
||||
|
||||
if (handler.IsEmpty()) {
|
||||
// we have no useful info....
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mailcap_description.Trim(" \t\"");
|
||||
mozillaFlags.Trim(" \t");
|
||||
LookUpExtensionsAndDescription(majorType,
|
||||
minorType,
|
||||
extensions,
|
||||
mime_types_description);
|
||||
|
||||
nsCOMPtr<nsIMIMEInfo> mimeInfo(do_CreateInstance(NS_MIMEINFO_CONTRACTID, &rv));
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
@ -1281,9 +1281,8 @@ NS_IMETHODIMP nsOSHelperAppService::GetFromMIMEType(const char *aMIMEType,
|
||||
|
||||
rv = NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIFile> handlerFile;
|
||||
if (! handler.IsEmpty()) {
|
||||
rv = GetFileTokenForPath(handler.get(), getter_AddRefs(handlerFile));
|
||||
}
|
||||
rv = GetFileTokenForPath(handler.get(), getter_AddRefs(handlerFile));
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mimeInfo->SetPreferredApplicationHandler(handlerFile);
|
||||
mimeInfo->SetPreferredAction(nsIMIMEInfo::useHelperApp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user