blob: 8ed4881c817f8abdc6771386e5bb0d43f8e86731 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
From: Mike Hommey <glandium@debian.org>
Date: Sat, 22 Nov 2008 09:35:23 +0100
Subject: Properly launch applications set in $HOME/.mailcap
Replaces the previous patch in a much simpler way.
---
uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
index 5d7f758..81b8efb 100644
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
@@ -99,6 +99,12 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
NS_IMETHODIMP
nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval)
{
+ // if mDefaultApplication is set, it means the application has been set from
+ // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
+ // give the GNOME answer.
+ if (mDefaultApplication)
+ return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
+
*_retval = false;
nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
if (!mimeInfo) {
@@ -132,13 +138,18 @@ nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval)
}
#endif
- // If we didn't find a VFS handler, fallback.
- return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
+ return NS_OK;
}
nsresult
nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile *aFile)
{
+ // if mDefaultApplication is set, it means the application has been set from
+ // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
+ // give the GNOME answer.
+ if (mDefaultApplication)
+ return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile);
+
nsCAutoString nativePath;
aFile->GetNativePath(nativePath);
|