author | Wolfgang Rosenauer <wr@rosenauer.org> |
Wed, 22 Nov 2023 23:08:38 +0100 | |
branch | firefox119 |
changeset 1197 | 19915e86b721 |
parent 1196 | 954851a35787 |
child 1199 | 4c520ebe1ad7 |
permissions | -rw-r--r-- |
1196 | 1 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 |
From: Wolfgang Rosenauer <wolfgang@rosenauer.org> |
|
3 |
Date: Tue, 8 Aug 2023 16:13:48 +0300 |
|
4 |
Subject: [PATCH] Add KDE integration to Firefox (toolkit parts) |
|
5 |
MIME-Version: 1.0 |
|
6 |
Content-Type: text/plain; charset=UTF-8 |
|
7 |
Content-Transfer-Encoding: 8bit |
|
8 |
||
398
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
9 |
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 |
1196 | 10 |
Bug: https://bugzilla.suse.com/show_bug.cgi?id=170055 |
11 |
||
12 |
EDIT: Björn Bidar: Removed handling for obsolete special files |
|
13 |
||
14 |
Co-authored-by: Wolfgang Rosenauer <wolfgang@rosenauer.org> |
|
15 |
Co-authored-by: Lubos Lunak <lunak@suse.com> |
|
16 |
Co-authored-by: Björn Bidar <bjorn.bidar@thaodan.de> |
|
17 |
--- |
|
18 |
modules/libpref/Preferences.cpp | 1 + |
|
19 |
modules/libpref/moz.build | 4 + |
|
20 |
python/mozbuild/mozpack/chrome/flags.py | 1 + |
|
21 |
python/mozbuild/mozpack/chrome/manifest.py | 1 + |
|
22 |
toolkit/components/downloads/moz.build | 4 + |
|
23 |
.../mozapps/downloads/HelperAppDlg.sys.mjs | 70 +++-- |
|
24 |
.../unixproxy/nsUnixSystemProxySettings.cpp | 29 ++ |
|
25 |
toolkit/xre/moz.build | 2 + |
|
26 |
toolkit/xre/nsKDEUtils.cpp | 286 ++++++++++++++++++ |
|
27 |
toolkit/xre/nsKDEUtils.h | 53 ++++ |
|
28 |
uriloader/exthandler/HandlerServiceParent.cpp | 6 +- |
|
29 |
uriloader/exthandler/moz.build | 3 + |
|
30 |
.../exthandler/unix/nsCommonRegistry.cpp | 42 +++ |
|
31 |
uriloader/exthandler/unix/nsCommonRegistry.h | 28 ++ |
|
32 |
uriloader/exthandler/unix/nsKDERegistry.cpp | 75 +++++ |
|
33 |
uriloader/exthandler/unix/nsKDERegistry.h | 35 +++ |
|
34 |
uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 28 +- |
|
35 |
.../exthandler/unix/nsOSHelperAppService.cpp | 10 +- |
|
36 |
widget/gtk/moz.build | 1 + |
|
37 |
widget/gtk/nsFilePicker.cpp | 230 +++++++++++++- |
|
38 |
widget/gtk/nsFilePicker.h | 6 + |
|
39 |
xpcom/components/ManifestParser.cpp | 10 + |
|
40 |
xpcom/components/moz.build | 1 + |
|
41 |
xpcom/io/nsLocalFileUnix.cpp | 20 +- |
|
42 |
24 files changed, 910 insertions(+), 36 deletions(-) |
|
43 |
create mode 100644 toolkit/xre/nsKDEUtils.cpp |
|
44 |
create mode 100644 toolkit/xre/nsKDEUtils.h |
|
45 |
create mode 100644 uriloader/exthandler/unix/nsCommonRegistry.cpp |
|
46 |
create mode 100644 uriloader/exthandler/unix/nsCommonRegistry.h |
|
47 |
create mode 100644 uriloader/exthandler/unix/nsKDERegistry.cpp |
|
48 |
create mode 100644 uriloader/exthandler/unix/nsKDERegistry.h |
|
398
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
49 |
|
1191 | 50 |
diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp |
1196 | 51 |
index 94a5aa0f3f169563d570e18fc1a525994293ad99..c1cf316d05b742502f7b07da1b7f25024b09f4e8 100644 |
1191 | 52 |
--- a/modules/libpref/Preferences.cpp |
53 |
+++ b/modules/libpref/Preferences.cpp |
|
1196 | 54 |
@@ -95,6 +95,7 @@ |
1156 | 55 |
#ifdef MOZ_BACKGROUNDTASKS |
56 |
# include "mozilla/BackgroundTasks.h" |
|
57 |
#endif |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
58 |
+#include "nsKDEUtils.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
59 |
|
1106 | 60 |
#ifdef DEBUG |
61 |
# include <map> |
|
1191 | 62 |
diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build |
1196 | 63 |
index e8f8b97170d32c1d3ac342dd93da7265bf707c8f..831001cee4b1eb33171d83d524ee9e453a800257 100644 |
1191 | 64 |
--- a/modules/libpref/moz.build |
65 |
+++ b/modules/libpref/moz.build |
|
1196 | 66 |
@@ -126,6 +126,10 @@ UNIFIED_SOURCES += [ |
1152 | 67 |
"SharedPrefMap.cpp", |
904 | 68 |
] |
69 |
||
70 |
+LOCAL_INCLUDES += [ |
|
1093 | 71 |
+ '/toolkit/xre' |
904 | 72 |
+] |
73 |
+ |
|
1112 | 74 |
gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs) |
75 |
||
1152 | 76 |
GeneratedFile( |
1191 | 77 |
diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py |
1196 | 78 |
index 6b096c862aaac5e02d9d7dacda42d9321d5e89cc..2b46d9294b93fda17117e9c84b240c52f96c9b74 100644 |
1191 | 79 |
--- a/python/mozbuild/mozpack/chrome/flags.py |
80 |
+++ b/python/mozbuild/mozpack/chrome/flags.py |
|
1196 | 81 |
@@ -234,6 +234,7 @@ class Flags(OrderedDict): |
1152 | 82 |
"tablet": Flag, |
83 |
"process": StringFlag, |
|
1156 | 84 |
"backgroundtask": StringFlag, |
85 |
+ "desktop": StringFlag, |
|
637
73640b76d6c3
first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
612
diff
changeset
|
86 |
} |
1152 | 87 |
RE = re.compile(r"([!<>=]+)") |
637
73640b76d6c3
first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
612
diff
changeset
|
88 |
|
1191 | 89 |
diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py |
1196 | 90 |
index 14c11d4c1daa8cbb03abf3cd2e1a7b60a981abc8..41b9969e7277fa2400f299863c83145342cd7b43 100644 |
1191 | 91 |
--- a/python/mozbuild/mozpack/chrome/manifest.py |
92 |
+++ b/python/mozbuild/mozpack/chrome/manifest.py |
|
1196 | 93 |
@@ -43,6 +43,7 @@ class ManifestEntry(object): |
1152 | 94 |
"process", |
95 |
"contentaccessible", |
|
1156 | 96 |
"backgroundtask", |
1152 | 97 |
+ "desktop", |
637
73640b76d6c3
first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
612
diff
changeset
|
98 |
] |
73640b76d6c3
first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
612
diff
changeset
|
99 |
|
73640b76d6c3
first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
612
diff
changeset
|
100 |
def __init__(self, base, *flags): |
1191 | 101 |
diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build |
1196 | 102 |
index 3818e8c0db1ed3cfc068d89b18b1fe2f1bf750a9..b70986db811191952919531cfb79e04b801491a2 100644 |
1191 | 103 |
--- a/toolkit/components/downloads/moz.build |
104 |
+++ b/toolkit/components/downloads/moz.build |
|
1196 | 105 |
@@ -51,5 +51,9 @@ if CONFIG["MOZ_PLACES"]: |
779 | 106 |
|
1152 | 107 |
FINAL_LIBRARY = "xul" |
251
4c9ebbedd59c
adopt patches to new base
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
244
diff
changeset
|
108 |
|
1020
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
109 |
+LOCAL_INCLUDES += [ |
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
110 |
+ '/toolkit/xre' |
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
111 |
+] |
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
112 |
+ |
1152 | 113 |
with Files("**"): |
114 |
BUG_COMPONENT = ("Toolkit", "Downloads API") |
|
1191 | 115 |
diff --git a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs |
1196 | 116 |
index 66f77d38e4ed7b3802303194e8df675a5db81272..f8839c446683620d6df6c6eb2ea0a0ca3549af95 100644 |
1191 | 117 |
--- a/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs |
118 |
+++ b/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs |
|
1196 | 119 |
@@ -1246,26 +1246,56 @@ nsUnknownContentTypeDialog.prototype = { |
944 | 120 |
this.chosenApp = params.handlerApp; |
121 |
} |
|
1045 | 122 |
} else if ("@mozilla.org/applicationchooser;1" in Cc) { |
123 |
- var nsIApplicationChooser = Ci.nsIApplicationChooser; |
|
1099
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
124 |
- var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance( |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
125 |
- nsIApplicationChooser |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
126 |
- ); |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
127 |
- appChooser.init( |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
128 |
- this.mDialog, |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
129 |
- this.dialogElement("strings").getString("chooseAppFilePickerTitle") |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
130 |
- ); |
944 | 131 |
- var contentTypeDialogObj = this; |
132 |
- let appChooserCallback = function appChooserCallback_done(aResult) { |
|
133 |
- if (aResult) { |
|
1099
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
134 |
- contentTypeDialogObj.chosenApp = aResult.QueryInterface( |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
135 |
- Ci.nsILocalHandlerApp |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
136 |
- ); |
1050
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
137 |
- } |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
138 |
- contentTypeDialogObj.finishChooseApp(); |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
139 |
- }; |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
140 |
- appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
141 |
- // The finishChooseApp is called from appChooserCallback |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
142 |
- return; |
944 | 143 |
+ // handle the KDE case which is implemented in the filepicker |
144 |
+ // therefore falling back to Gtk2 like behaviour if KDE is running |
|
994 | 145 |
+ // FIXME this should be better handled in the nsIApplicationChooser |
146 |
+ // interface |
|
944 | 147 |
+ var env = Components.classes["@mozilla.org/process/environment;1"] |
148 |
+ .getService(Components.interfaces.nsIEnvironment); |
|
149 |
+ if (env.get('KDE_FULL_SESSION') == "true") |
|
150 |
+ { |
|
1050
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
151 |
+ var nsIFilePicker = Ci.nsIFilePicker; |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
152 |
+ var fp = Cc["@mozilla.org/filepicker;1"] |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
153 |
+ .createInstance(nsIFilePicker); |
944 | 154 |
+ fp.init(this.mDialog, |
155 |
+ this.dialogElement("strings").getString("chooseAppFilePickerTitle"), |
|
156 |
+ nsIFilePicker.modeOpen); |
|
157 |
+ |
|
158 |
+ fp.appendFilters(nsIFilePicker.filterApps); |
|
159 |
+ |
|
1050
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
160 |
+ fp.open(aResult => { |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
161 |
+ if (aResult == nsIFilePicker.returnOK && fp.file) { |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
162 |
+ // Remember the file they chose to run. |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
163 |
+ var localHandlerApp = |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
164 |
+ Cc["@mozilla.org/uriloader/local-handler-app;1"]. |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
165 |
+ createInstance(Ci.nsILocalHandlerApp); |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
166 |
+ localHandlerApp.executable = fp.file; |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
167 |
+ this.chosenApp = localHandlerApp; |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
168 |
+ } |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
169 |
+ this.finishChooseApp(); |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
170 |
+ }); |
944 | 171 |
+ } else { |
1045 | 172 |
+ var nsIApplicationChooser = Ci.nsIApplicationChooser; |
1099
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
173 |
+ var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance( |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
174 |
+ nsIApplicationChooser |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
175 |
+ ); |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
176 |
+ appChooser.init( |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
177 |
+ this.mDialog, |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
178 |
+ this.dialogElement("strings").getString("chooseAppFilePickerTitle") |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
179 |
+ ); |
944 | 180 |
+ var contentTypeDialogObj = this; |
181 |
+ let appChooserCallback = function appChooserCallback_done(aResult) { |
|
182 |
+ if (aResult) { |
|
1099
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
183 |
+ contentTypeDialogObj.chosenApp = aResult.QueryInterface( |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
184 |
+ Ci.nsILocalHandlerApp |
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
185 |
+ ); |
944 | 186 |
+ } |
187 |
+ contentTypeDialogObj.finishChooseApp(); |
|
188 |
+ }; |
|
189 |
+ appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); |
|
190 |
+ // The finishChooseApp is called from appChooserCallback |
|
191 |
+ return; |
|
192 |
+ } |
|
994 | 193 |
} else { |
1045 | 194 |
var nsIFilePicker = Ci.nsIFilePicker; |
1099
8a3c73e74e65
68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1097
diff
changeset
|
195 |
var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); |
1191 | 196 |
diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
1196 | 197 |
index 185dc1e22a903cec95b212d1713dddf764b9b198..bdb4ed6f9f86583d02dd80278f858d064584f82a 100644 |
1191 | 198 |
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
199 |
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp |
|
1196 | 200 |
@@ -16,6 +16,8 @@ |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
201 |
#include "nsISupportsPrimitives.h" |
399
20f8b5f0aea6
port KDE patches to Gecko 11
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
398
diff
changeset
|
202 |
#include "nsIGSettingsService.h" |
1182 | 203 |
#include "nsReadableUtils.h" |
1176 | 204 |
+#include "nsPrintfCString.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
205 |
+#include "nsKDEUtils.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
206 |
|
1093 | 207 |
using namespace mozilla; |
208 |
||
1196 | 209 |
@@ -39,6 +41,8 @@ class nsUnixSystemProxySettings final : public nsISystemProxySettings { |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
210 |
nsACString& aResult); |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
211 |
nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
212 |
nsACString& aResult); |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
213 |
+ nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
214 |
+ PRInt32 aPort, nsACString& aResult); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
215 |
}; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
216 |
|
738 | 217 |
NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings) |
1196 | 218 |
@@ -397,6 +401,9 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec, |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
219 |
const nsACString& aHost, |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
220 |
const int32_t aPort, |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
221 |
nsACString& aResult) { |
596 | 222 |
+ if (nsKDEUtils::kdeSupport()) |
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
546
diff
changeset
|
223 |
+ return GetProxyFromKDE(aScheme, aHost, aPort, aResult); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
224 |
+ |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
225 |
if (mProxySettings) { |
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
546
diff
changeset
|
226 |
nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult); |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
227 |
if (NS_SUCCEEDED(rv)) return rv; |
1196 | 228 |
@@ -405,6 +412,28 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec, |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
229 |
return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult); |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
230 |
} |
284
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
231 |
|
1190 | 232 |
+nsresult nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme, |
233 |
+ const nsACString& aHost, |
|
234 |
+ PRInt32 aPort, |
|
235 |
+ nsACString& aResult) { |
|
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
546
diff
changeset
|
236 |
+ nsAutoCString url; |
284
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
237 |
+ url = aScheme; |
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
238 |
+ url += "://"; |
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
239 |
+ url += aHost; |
1190 | 240 |
+ if (aPort >= 0) { |
284
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
241 |
+ url += ":"; |
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
242 |
+ url += nsPrintfCString("%d", aPort); |
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
243 |
+ } |
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
244 |
+ nsTArray<nsCString> command; |
1190 | 245 |
+ command.AppendElement("GETPROXY"_ns); |
246 |
+ command.AppendElement(url); |
|
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
247 |
+ nsTArray<nsCString> result; |
1190 | 248 |
+ if (!nsKDEUtils::command(command, &result) || result.Length() != 1) |
284
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
249 |
+ return NS_ERROR_FAILURE; |
398
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
250 |
+ aResult = result[0]; |
284
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
251 |
+ return NS_OK; |
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
252 |
+} |
ccddc8555cdb
readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
260
diff
changeset
|
253 |
+ |
1093 | 254 |
NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) { |
255 |
auto result = MakeRefPtr<nsUnixSystemProxySettings>(); |
|
256 |
result->Init(); |
|
1191 | 257 |
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build |
1196 | 258 |
index de05e0cc29752855138b4d189ce6a13c2121d715..c89faad7bfca4ab1d60390766b2e7befd9e3831d 100644 |
1191 | 259 |
--- a/toolkit/xre/moz.build |
260 |
+++ b/toolkit/xre/moz.build |
|
1196 | 261 |
@@ -96,7 +96,9 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit": |
1152 | 262 |
"UIKitDirProvider.mm", |
659 | 263 |
] |
1152 | 264 |
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": |
659 | 265 |
+ EXPORTS += ['nsKDEUtils.h'] |
703 | 266 |
UNIFIED_SOURCES += [ |
1152 | 267 |
+ "nsKDEUtils.cpp", |
268 |
"nsNativeAppSupportUnix.cpp", |
|
659 | 269 |
] |
1169 | 270 |
CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"] |
1191 | 271 |
diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp |
272 |
new file mode 100644 |
|
1196 | 273 |
index 0000000000000000000000000000000000000000..e282de40618e0be06a4247891d9ab1a26cba2126 |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
274 |
--- /dev/null |
1191 | 275 |
+++ b/toolkit/xre/nsKDEUtils.cpp |
1190 | 276 |
@@ -0,0 +1,286 @@ |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
277 |
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
546 | 278 |
+/* This Source Code Form is subject to the terms of the Mozilla Public |
279 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
280 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
281 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
282 |
+#include "nsKDEUtils.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
283 |
+#include "nsIWidget.h" |
398
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
284 |
+#include "nsISupportsPrimitives.h" |
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
285 |
+#include "nsIMutableArray.h" |
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
286 |
+#include "nsComponentManagerUtils.h" |
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
287 |
+#include "nsArrayUtils.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
288 |
+ |
10
1920f0ff04a3
Make mozilla-kde.patch compile with 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
9
diff
changeset
|
289 |
+#include <gtk/gtk.h> |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
290 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
291 |
+#include <limits.h> |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
292 |
+#include <stdio.h> |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
293 |
+#include <sys/wait.h> |
517
fa93154734b8
Fix mozilla-kde.patch to include sys/resource.h for getrlimit etc (glibc 2.16)
Andreas Jaeger <aj@suse.de>
parents:
515
diff
changeset
|
294 |
+#include <sys/resource.h> |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
295 |
+#include <unistd.h> |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
296 |
+#include <X11/Xlib.h> |
935
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
932
diff
changeset
|
297 |
+// copied from X11/X.h as a hack since for an unknown |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
932
diff
changeset
|
298 |
+// reason it's not picked up from X11/X.h |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
932
diff
changeset
|
299 |
+#ifndef None |
1190 | 300 |
+# define None 0L /* universal null resource or null atom */ |
935
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
932
diff
changeset
|
301 |
+#endif |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
302 |
+ |
1190 | 303 |
+// #define DEBUG_KDE |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
304 |
+#ifdef DEBUG_KDE |
1190 | 305 |
+# define KMOZILLAHELPER "kmozillahelper" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
306 |
+#else |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
307 |
+// not need for lib64, it's a binary |
1190 | 308 |
+# define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
309 |
+#endif |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
310 |
+ |
538
be682f8c9361
revert API version change for kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
537
diff
changeset
|
311 |
+#define KMOZILLAHELPER_VERSION 6 |
1190 | 312 |
+#define MAKE_STR2(n) #n |
313 |
+#define MAKE_STR(n) MAKE_STR2(n) |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
314 |
+ |
1190 | 315 |
+static bool getKdeSession() { |
316 |
+ if (PR_GetEnv("KDE_FULL_SESSION")) { |
|
317 |
+ return true; |
|
318 |
+ } |
|
319 |
+ return false; |
|
1168 | 320 |
+} |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
321 |
+ |
1190 | 322 |
+static bool getKdeSupport() { |
323 |
+ nsTArray<nsCString> command; |
|
324 |
+ command.AppendElement("CHECK"_ns); |
|
325 |
+ command.AppendElement("KMOZILLAHELPER_VERSION"_ns); |
|
326 |
+ bool kde = nsKDEUtils::command(command); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
327 |
+#ifdef DEBUG_KDE |
1190 | 328 |
+ fprintf(stderr, "KDE RUNNING %d\n", kde); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
329 |
+#endif |
1190 | 330 |
+ return kde; |
331 |
+} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
332 |
+ |
1190 | 333 |
+nsKDEUtils::nsKDEUtils() : commandFile(NULL), replyFile(NULL) {} |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
334 |
+ |
1190 | 335 |
+nsKDEUtils::~nsKDEUtils() { |
336 |
+ // closeHelper(); not actually useful, exiting will close the fd too |
|
337 |
+} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
338 |
+ |
1190 | 339 |
+nsKDEUtils* nsKDEUtils::self() { |
340 |
+ static nsKDEUtils s; |
|
341 |
+ return &s; |
|
342 |
+} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
343 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
344 |
+static bool helperRunning = false; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
345 |
+static bool helperFailed = false; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
346 |
+ |
1190 | 347 |
+bool nsKDEUtils::kdeSession() { |
348 |
+ static bool session = getKdeSession(); |
|
349 |
+ return session; |
|
350 |
+} |
|
351 |
+ |
|
352 |
+bool nsKDEUtils::kdeSupport() { |
|
353 |
+ static bool support = kdeSession() && getKdeSupport(); |
|
354 |
+ return support && helperRunning; |
|
355 |
+} |
|
356 |
+ |
|
357 |
+struct nsKDECommandData { |
|
358 |
+ FILE* file; |
|
359 |
+ nsTArray<nsCString>* output; |
|
360 |
+ GMainLoop* loop; |
|
361 |
+ bool success; |
|
362 |
+}; |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
363 |
+ |
1190 | 364 |
+static gboolean kdeReadFunc(GIOChannel*, GIOCondition, gpointer data) { |
365 |
+ nsKDECommandData* p = static_cast<nsKDECommandData*>(data); |
|
366 |
+ char buf[8192]; // TODO big enough |
|
367 |
+ bool command_done = false; |
|
368 |
+ bool command_failed = false; |
|
369 |
+ while (!command_done && !command_failed && |
|
370 |
+ fgets(buf, 8192, p->file) != |
|
371 |
+ NULL) { // TODO what if the kernel splits a line into two chunks? |
|
372 |
+ // #ifdef DEBUG_KDE |
|
373 |
+ // fprintf( stderr, "READ: %s %d\n", buf, feof( p->file )); |
|
374 |
+ // #endif |
|
375 |
+ if (char* eol = strchr(buf, '\n')) *eol = '\0'; |
|
376 |
+ command_done = (strcmp(buf, "\\1") == 0); |
|
377 |
+ command_failed = (strcmp(buf, "\\0") == 0); |
|
378 |
+ nsAutoCString line(buf); |
|
379 |
+ line.ReplaceSubstring("\\n", "\n"); |
|
380 |
+ line.ReplaceSubstring( |
|
381 |
+ "\\" |
|
382 |
+ "\\", |
|
383 |
+ "\\"); // \\ -> \ , i.e. unescape |
|
384 |
+ if (p->output && !(command_done || command_failed)) |
|
385 |
+ p->output->AppendElement(nsCString(buf)); // TODO utf8? |
|
386 |
+ } |
|
387 |
+ bool quit = false; |
|
388 |
+ if (feof(p->file) || command_failed) { |
|
389 |
+ quit = true; |
|
390 |
+ p->success = false; |
|
391 |
+ } |
|
392 |
+ if (command_done) { // reading one reply finished |
|
393 |
+ quit = true; |
|
394 |
+ p->success = true; |
|
395 |
+ } |
|
396 |
+ if (quit) { |
|
397 |
+ if (p->loop) g_main_loop_quit(p->loop); |
|
398 |
+ return FALSE; |
|
399 |
+ } |
|
400 |
+ return TRUE; |
|
401 |
+} |
|
402 |
+ |
|
403 |
+bool nsKDEUtils::command(const nsTArray<nsCString>& command, |
|
404 |
+ nsTArray<nsCString>* output) { |
|
405 |
+ return self()->internalCommand(command, NULL, false, output); |
|
406 |
+} |
|
407 |
+ |
|
408 |
+bool nsKDEUtils::command(nsIArray* command, nsIArray** output) { |
|
409 |
+ nsTArray<nsCString> in; |
|
410 |
+ PRUint32 length; |
|
411 |
+ command->GetLength(&length); |
|
412 |
+ for (PRUint32 i = 0; i < length; i++) { |
|
413 |
+ nsCOMPtr<nsISupportsCString> str = do_QueryElementAt(command, i); |
|
414 |
+ if (str) { |
|
415 |
+ nsAutoCString s; |
|
416 |
+ str->GetData(s); |
|
417 |
+ in.AppendElement(s); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
418 |
+ } |
1190 | 419 |
+ } |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
420 |
+ |
1190 | 421 |
+ nsTArray<nsCString> out; |
422 |
+ bool ret = self()->internalCommand(in, NULL, false, &out); |
|
423 |
+ |
|
424 |
+ if (!output) return ret; |
|
425 |
+ |
|
426 |
+ nsCOMPtr<nsIMutableArray> result = do_CreateInstance(NS_ARRAY_CONTRACTID); |
|
427 |
+ if (!result) return false; |
|
428 |
+ |
|
429 |
+ for (PRUint32 i = 0; i < out.Length(); i++) { |
|
430 |
+ nsCOMPtr<nsISupportsCString> rstr = |
|
431 |
+ do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID); |
|
432 |
+ if (!rstr) return false; |
|
433 |
+ |
|
434 |
+ rstr->SetData(out[i]); |
|
435 |
+ result->AppendElement(rstr); |
|
436 |
+ } |
|
437 |
+ |
|
438 |
+ NS_ADDREF(*output = result); |
|
439 |
+ return ret; |
|
440 |
+} |
|
441 |
+ |
|
442 |
+bool nsKDEUtils::commandBlockUi(const nsTArray<nsCString>& command, |
|
443 |
+ GtkWindow* parent, |
|
444 |
+ nsTArray<nsCString>* output) { |
|
445 |
+ return self()->internalCommand(command, parent, true, output); |
|
446 |
+} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
447 |
+ |
1190 | 448 |
+bool nsKDEUtils::internalCommand(const nsTArray<nsCString>& command, |
449 |
+ GtkWindow* parent, bool blockUi, |
|
450 |
+ nsTArray<nsCString>* output) { |
|
451 |
+ if (!startHelper()) return false; |
|
452 |
+ feedCommand(command); |
|
453 |
+ // do not store the data in 'this' but in extra structure, just in case there |
|
454 |
+ // is reentrancy (can there be? the event loop is re-entered) |
|
455 |
+ nsKDECommandData data; |
|
456 |
+ data.file = replyFile; |
|
457 |
+ data.output = output; |
|
458 |
+ data.success = false; |
|
459 |
+ if (blockUi) { |
|
460 |
+ data.loop = g_main_loop_new(NULL, FALSE); |
|
461 |
+ GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
|
462 |
+ if (parent && gtk_window_get_group(parent)) |
|
463 |
+ gtk_window_group_add_window(gtk_window_get_group(parent), |
|
464 |
+ GTK_WINDOW(window)); |
|
465 |
+ gtk_widget_realize(window); |
|
466 |
+ gtk_widget_set_sensitive(window, TRUE); |
|
467 |
+ gtk_grab_add(window); |
|
468 |
+ GIOChannel* channel = g_io_channel_unix_new(fileno(data.file)); |
|
469 |
+ g_io_add_watch(channel, |
|
470 |
+ static_cast<GIOCondition>(G_IO_IN | G_IO_ERR | G_IO_HUP), |
|
471 |
+ kdeReadFunc, &data); |
|
472 |
+ g_io_channel_unref(channel); |
|
473 |
+ g_main_loop_run(data.loop); |
|
474 |
+ g_main_loop_unref(data.loop); |
|
475 |
+ gtk_grab_remove(window); |
|
476 |
+ gtk_widget_destroy(window); |
|
477 |
+ } else { |
|
478 |
+ data.loop = NULL; |
|
479 |
+ while (kdeReadFunc(NULL, static_cast<GIOCondition>(0), &data)) |
|
480 |
+ ; |
|
481 |
+ } |
|
482 |
+ return data.success; |
|
483 |
+} |
|
484 |
+ |
|
485 |
+bool nsKDEUtils::startHelper() { |
|
486 |
+ if (helperRunning) return true; |
|
487 |
+ if (helperFailed) return false; |
|
488 |
+ helperFailed = true; |
|
489 |
+ int fdcommand[2]; |
|
490 |
+ int fdreply[2]; |
|
491 |
+ if (pipe(fdcommand) < 0) return false; |
|
492 |
+ if (pipe(fdreply) < 0) { |
|
493 |
+ close(fdcommand[0]); |
|
494 |
+ close(fdcommand[1]); |
|
495 |
+ return false; |
|
496 |
+ } |
|
497 |
+ char* args[2] = {const_cast<char*>(KMOZILLAHELPER), NULL}; |
|
498 |
+ switch (fork()) { |
|
499 |
+ case -1: { |
|
500 |
+ close(fdcommand[0]); |
|
501 |
+ close(fdcommand[1]); |
|
502 |
+ close(fdreply[0]); |
|
503 |
+ close(fdreply[1]); |
|
504 |
+ return false; |
|
505 |
+ } |
|
506 |
+ case 0: // child |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
507 |
+ { |
1190 | 508 |
+ if (dup2(fdcommand[0], STDIN_FILENO) < 0) _exit(1); |
509 |
+ if (dup2(fdreply[1], STDOUT_FILENO) < 0) _exit(1); |
|
510 |
+ int maxfd = 1024; // close all other fds |
|
511 |
+ struct rlimit rl; |
|
512 |
+ if (getrlimit(RLIMIT_NOFILE, &rl) == 0) maxfd = rl.rlim_max; |
|
513 |
+ for (int i = 3; i < maxfd; ++i) close(i); |
|
514 |
+#ifdef DEBUG_KDE |
|
515 |
+ execvp(KMOZILLAHELPER, args); |
|
516 |
+#else |
|
517 |
+ execv(KMOZILLAHELPER, args); |
|
518 |
+#endif |
|
519 |
+ _exit(1); // failed |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
520 |
+ } |
1190 | 521 |
+ default: // parent |
398
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
522 |
+ { |
1190 | 523 |
+ commandFile = fdopen(fdcommand[1], "w"); |
524 |
+ replyFile = fdopen(fdreply[0], "r"); |
|
525 |
+ close(fdcommand[0]); |
|
526 |
+ close(fdreply[1]); |
|
527 |
+ if (commandFile == NULL || replyFile == NULL) { |
|
528 |
+ closeHelper(); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
529 |
+ return false; |
1190 | 530 |
+ } |
531 |
+ // ok, helper ready, getKdeRunning() will check if it works |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
532 |
+ } |
1190 | 533 |
+ } |
534 |
+ helperFailed = false; |
|
535 |
+ helperRunning = true; |
|
536 |
+ return true; |
|
537 |
+} |
|
538 |
+ |
|
539 |
+void nsKDEUtils::closeHelper() { |
|
540 |
+ if (commandFile != NULL) |
|
541 |
+ fclose(commandFile); // this will also make the helper quit |
|
542 |
+ if (replyFile != NULL) fclose(replyFile); |
|
543 |
+ helperRunning = false; |
|
544 |
+} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
545 |
+ |
1190 | 546 |
+void nsKDEUtils::feedCommand(const nsTArray<nsCString>& command) { |
547 |
+ for (int i = 0; i < command.Length(); ++i) { |
|
548 |
+ nsCString line = command[i]; |
|
549 |
+ line.ReplaceSubstring("\\", |
|
550 |
+ "\\" |
|
551 |
+ "\\"); // \ -> \\ , i.e. escape |
|
552 |
+ line.ReplaceSubstring("\n", "\\n"); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
553 |
+#ifdef DEBUG_KDE |
1190 | 554 |
+ fprintf(stderr, "COMM: %s\n", line.get()); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
555 |
+#endif |
1190 | 556 |
+ fputs(line.get(), commandFile); |
557 |
+ fputs("\n", commandFile); |
|
558 |
+ } |
|
559 |
+ fputs("\\E\n", |
|
560 |
+ commandFile); // done as \E, so it cannot happen in normal data |
|
561 |
+ fflush(commandFile); |
|
562 |
+} |
|
1191 | 563 |
diff --git a/toolkit/xre/nsKDEUtils.h b/toolkit/xre/nsKDEUtils.h |
564 |
new file mode 100644 |
|
1196 | 565 |
index 0000000000000000000000000000000000000000..7fa6eb8e83b32c8e2c62a0035d253e06e135e3d2 |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
566 |
--- /dev/null |
1191 | 567 |
+++ b/toolkit/xre/nsKDEUtils.h |
1190 | 568 |
@@ -0,0 +1,53 @@ |
546 | 569 |
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
570 |
+/* This Source Code Form is subject to the terms of the Mozilla Public |
|
571 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
572 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
573 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
574 |
+#ifndef nsKDEUtils_h__ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
575 |
+#define nsKDEUtils_h__ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
576 |
+ |
1033
51bfdd19b9e9
rebased everything to apply cleanly
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1032
diff
changeset
|
577 |
+#include "nsString.h" |
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
578 |
+#include "nsTArray.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
579 |
+#include <stdio.h> |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
580 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
581 |
+typedef struct _GtkWindow GtkWindow; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
582 |
+ |
398
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
583 |
+class nsIArray; |
937669e1c537
ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
368
diff
changeset
|
584 |
+ |
1190 | 585 |
+class NS_EXPORT nsKDEUtils { |
586 |
+ public: |
|
587 |
+ /* Returns true if running inside a KDE session (regardless of whether there |
|
588 |
+ is KDE support available for Firefox). This should be used e.g. when |
|
589 |
+ determining dialog button order but not for code that requires the KDE |
|
590 |
+ support. */ |
|
591 |
+ static bool kdeSession(); |
|
592 |
+ /* Returns true if running inside a KDE session and KDE support is available |
|
593 |
+ for Firefox. This should be used everywhere where the external helper is |
|
594 |
+ needed. */ |
|
595 |
+ static bool kdeSupport(); |
|
596 |
+ /* Executes the given helper command, returns true if helper returned success. |
|
597 |
+ */ |
|
598 |
+ static bool command(const nsTArray<nsCString>& command, |
|
599 |
+ nsTArray<nsCString>* output = NULL); |
|
600 |
+ static bool command(nsIArray* command, nsIArray** output = NULL); |
|
601 |
+ /* Like command(), but additionally blocks the parent widget like if there was |
|
602 |
+ a modal dialog shown and enters the event loop (i.e. there are still paint |
|
603 |
+ updates, this is for commands that take long). */ |
|
604 |
+ static bool commandBlockUi(const nsTArray<nsCString>& command, |
|
605 |
+ GtkWindow* parent, |
|
606 |
+ nsTArray<nsCString>* output = NULL); |
|
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
607 |
+ |
1190 | 608 |
+ private: |
609 |
+ nsKDEUtils(); |
|
610 |
+ ~nsKDEUtils(); |
|
611 |
+ static nsKDEUtils* self(); |
|
612 |
+ bool startHelper(); |
|
613 |
+ void closeHelper(); |
|
614 |
+ void feedCommand(const nsTArray<nsCString>& command); |
|
615 |
+ bool internalCommand(const nsTArray<nsCString>& command, GtkWindow* parent, |
|
616 |
+ bool isParent, nsTArray<nsCString>* output); |
|
617 |
+ FILE* commandFile; |
|
618 |
+ FILE* replyFile; |
|
619 |
+}; |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
620 |
+ |
1190 | 621 |
+#endif // nsKDEUtils |
1191 | 622 |
diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp |
1196 | 623 |
index ab77657dd5f378af0955c43ef958a8abea620134..18b4d85560699bbc3c69b82ee91dfb5cbe700e7b 100644 |
1191 | 624 |
--- a/uriloader/exthandler/HandlerServiceParent.cpp |
625 |
+++ b/uriloader/exthandler/HandlerServiceParent.cpp |
|
1196 | 626 |
@@ -18,7 +18,7 @@ |
1189 | 627 |
#include "nsComponentManagerUtils.h" |
628 |
#include "nsServiceManagerUtils.h" |
|
1050
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
629 |
#ifdef MOZ_WIDGET_GTK |
1089 | 630 |
-# include "unix/nsGNOMERegistry.h" |
631 |
+# include "unix/nsCommonRegistry.h" |
|
1050
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
632 |
#endif |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
633 |
|
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
634 |
using mozilla::dom::ContentHandlerService; |
1196 | 635 |
@@ -310,8 +310,8 @@ mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS( |
1097 | 636 |
} |
1050
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
637 |
#ifdef MOZ_WIDGET_GTK |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
638 |
// Check the GNOME registry for a protocol handler |
1190 | 639 |
- *aHandlerExists = |
1179 | 640 |
- nsGNOMERegistry::HandlerExists(PromiseFlatCString(aProtocolScheme).get()); |
1190 | 641 |
+ *aHandlerExists = nsCommonRegistry::HandlerExists( |
642 |
+ PromiseFlatCString(aProtocolScheme).get()); |
|
1050
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
643 |
#else |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
644 |
*aHandlerExists = false; |
bf0d08380dcf
fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1045
diff
changeset
|
645 |
#endif |
1191 | 646 |
diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build |
1196 | 647 |
index 0fb126a7f3f7a45d53e6fb81aef74147c711cb77..8cc0006f3045e14e83fd51926ac7856eacbe7357 100644 |
1191 | 648 |
--- a/uriloader/exthandler/moz.build |
649 |
+++ b/uriloader/exthandler/moz.build |
|
1196 | 650 |
@@ -86,7 +86,9 @@ else: |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
651 |
|
1152 | 652 |
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": |
703 | 653 |
UNIFIED_SOURCES += [ |
1152 | 654 |
+ "unix/nsCommonRegistry.cpp", |
655 |
"unix/nsGNOMERegistry.cpp", |
|
656 |
+ "unix/nsKDERegistry.cpp", |
|
657 |
"unix/nsMIMEInfoUnix.cpp", |
|
659 | 658 |
] |
1152 | 659 |
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": |
1196 | 660 |
@@ -134,6 +136,7 @@ LOCAL_INCLUDES += [ |
1152 | 661 |
"/dom/ipc", |
662 |
"/netwerk/base", |
|
663 |
"/netwerk/protocol/http", |
|
664 |
+ "/toolkit/xre", |
|
779 | 665 |
] |
666 |
||
1152 | 667 |
if CONFIG["MOZ_ENABLE_DBUS"]: |
1191 | 668 |
diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp |
669 |
new file mode 100644 |
|
1196 | 670 |
index 0000000000000000000000000000000000000000..3371a756e2c240bfe5fe31ef0ee9c393368dab60 |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
671 |
--- /dev/null |
1191 | 672 |
+++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp |
1190 | 673 |
@@ -0,0 +1,42 @@ |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
674 |
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
546 | 675 |
+/* This Source Code Form is subject to the terms of the Mozilla Public |
676 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
677 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
678 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
679 |
+#include "nsCommonRegistry.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
680 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
681 |
+#include "nsGNOMERegistry.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
682 |
+#include "nsKDERegistry.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
683 |
+#include "nsString.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
684 |
+#include "nsKDEUtils.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
685 |
+ |
1190 | 686 |
+/* static */ bool nsCommonRegistry::HandlerExists(const char* aProtocolScheme) { |
687 |
+ if (nsKDEUtils::kdeSupport()) |
|
688 |
+ return nsKDERegistry::HandlerExists(aProtocolScheme); |
|
689 |
+ return nsGNOMERegistry::HandlerExists(aProtocolScheme); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
690 |
+} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
691 |
+ |
1190 | 692 |
+/* static */ nsresult nsCommonRegistry::LoadURL(nsIURI* aURL) { |
693 |
+ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::LoadURL(aURL); |
|
694 |
+ return nsGNOMERegistry::LoadURL(aURL); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
695 |
+} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
696 |
+ |
1190 | 697 |
+/* static */ void nsCommonRegistry::GetAppDescForScheme( |
698 |
+ const nsACString& aScheme, nsAString& aDesc) { |
|
699 |
+ if (nsKDEUtils::kdeSupport()) |
|
700 |
+ return nsKDERegistry::GetAppDescForScheme(aScheme, aDesc); |
|
701 |
+ return nsGNOMERegistry::GetAppDescForScheme(aScheme, aDesc); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
702 |
+} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
703 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
704 |
+/* static */ already_AddRefed<nsMIMEInfoBase> |
1190 | 705 |
+nsCommonRegistry::GetFromExtension(const nsACString& aFileExt) { |
706 |
+ if (nsKDEUtils::kdeSupport()) |
|
707 |
+ return nsKDERegistry::GetFromExtension(aFileExt); |
|
708 |
+ return nsGNOMERegistry::GetFromExtension(aFileExt); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
709 |
+} |
1190 | 710 |
+ |
711 |
+/* static */ already_AddRefed<nsMIMEInfoBase> nsCommonRegistry::GetFromType( |
|
712 |
+ const nsACString& aMIMEType) { |
|
713 |
+ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::GetFromType(aMIMEType); |
|
714 |
+ return nsGNOMERegistry::GetFromType(aMIMEType); |
|
715 |
+} |
|
1191 | 716 |
diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler/unix/nsCommonRegistry.h |
717 |
new file mode 100644 |
|
1196 | 718 |
index 0000000000000000000000000000000000000000..075413e2fbb165862956c7753a750bfdfb5d389b |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
719 |
--- /dev/null |
1191 | 720 |
+++ b/uriloader/exthandler/unix/nsCommonRegistry.h |
760 | 721 |
@@ -0,0 +1,28 @@ |
546 | 722 |
+/* This Source Code Form is subject to the terms of the Mozilla Public |
723 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
724 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
725 |
+ |
760 | 726 |
+#ifndef nsCommonRegistry_h__ |
727 |
+#define nsCommonRegistry_h__ |
|
728 |
+ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
729 |
+#include "nsIURI.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
730 |
+#include "nsCOMPtr.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
731 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
732 |
+class nsMIMEInfoBase; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
733 |
+ |
1190 | 734 |
+class nsCommonRegistry { |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
735 |
+ public: |
1190 | 736 |
+ static bool HandlerExists(const char* aProtocolScheme); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
737 |
+ |
1190 | 738 |
+ static nsresult LoadURL(nsIURI* aURL); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
739 |
+ |
1190 | 740 |
+ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
741 |
+ |
1190 | 742 |
+ static already_AddRefed<nsMIMEInfoBase> GetFromExtension( |
743 |
+ const nsACString& aFileExt); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
744 |
+ |
1190 | 745 |
+ static already_AddRefed<nsMIMEInfoBase> GetFromType( |
746 |
+ const nsACString& aMIMEType); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
747 |
+}; |
760 | 748 |
+ |
749 |
+#endif |
|
1191 | 750 |
diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp |
751 |
new file mode 100644 |
|
1196 | 752 |
index 0000000000000000000000000000000000000000..082035566f0b82c14f866c2fbed34c0884f27d34 |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
753 |
--- /dev/null |
1191 | 754 |
+++ b/uriloader/exthandler/unix/nsKDERegistry.cpp |
1190 | 755 |
@@ -0,0 +1,75 @@ |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
756 |
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
546 | 757 |
+/* This Source Code Form is subject to the terms of the Mozilla Public |
758 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
759 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
760 |
+ |
1172 | 761 |
+#include "mozilla/StaticPrefs_browser.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
762 |
+#include "nsKDERegistry.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
763 |
+#include "prlink.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
764 |
+#include "prmem.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
765 |
+#include "nsString.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
766 |
+#include "nsMIMEInfoUnix.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
767 |
+#include "nsKDEUtils.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
768 |
+ |
1190 | 769 |
+/* static */ bool nsKDERegistry::HandlerExists(const char* aProtocolScheme) { |
770 |
+ nsTArray<nsCString> command; |
|
771 |
+ command.AppendElement("HANDLEREXISTS"_ns); |
|
772 |
+ command.AppendElement(nsAutoCString(aProtocolScheme)); |
|
773 |
+ return nsKDEUtils::command(command); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
774 |
+} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
775 |
+ |
1190 | 776 |
+/* static */ nsresult nsKDERegistry::LoadURL(nsIURI* aURL) { |
777 |
+ nsTArray<nsCString> command; |
|
778 |
+ command.AppendElement("OPEN"_ns); |
|
779 |
+ nsCString url; |
|
780 |
+ aURL->GetSpec(url); |
|
781 |
+ command.AppendElement(url); |
|
782 |
+ bool rv = nsKDEUtils::command(command); |
|
783 |
+ if (!rv) return NS_ERROR_FAILURE; |
|
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
546
diff
changeset
|
784 |
+ |
1190 | 785 |
+ return NS_OK; |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
786 |
+} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
787 |
+ |
1190 | 788 |
+/* static */ void nsKDERegistry::GetAppDescForScheme(const nsACString& aScheme, |
789 |
+ nsAString& aDesc) { |
|
790 |
+ nsTArray<nsCString> command; |
|
791 |
+ command.AppendElement("GETAPPDESCFORSCHEME"_ns); |
|
792 |
+ command.AppendElement(aScheme); |
|
793 |
+ nsTArray<nsCString> output; |
|
794 |
+ if (nsKDEUtils::command(command, &output) && output.Length() == 1) |
|
795 |
+ CopyUTF8toUTF16(output[0], aDesc); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
796 |
+} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
797 |
+ |
1190 | 798 |
+/* static */ already_AddRefed<nsMIMEInfoBase> nsKDERegistry::GetFromExtension( |
799 |
+ const nsACString& aFileExt) { |
|
800 |
+ NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot"); |
|
801 |
+ nsTArray<nsCString> command; |
|
802 |
+ command.AppendElement("GETFROMEXTENSION"_ns); |
|
803 |
+ command.AppendElement(aFileExt); |
|
804 |
+ return GetFromHelper(command); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
805 |
+} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
806 |
+ |
1190 | 807 |
+/* static */ already_AddRefed<nsMIMEInfoBase> nsKDERegistry::GetFromType( |
808 |
+ const nsACString& aMIMEType) { |
|
809 |
+ nsTArray<nsCString> command; |
|
810 |
+ command.AppendElement("GETFROMTYPE"_ns); |
|
811 |
+ command.AppendElement(aMIMEType); |
|
812 |
+ return GetFromHelper(command); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
813 |
+} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
814 |
+ |
1190 | 815 |
+/* static */ already_AddRefed<nsMIMEInfoBase> nsKDERegistry::GetFromHelper( |
816 |
+ const nsTArray<nsCString>& command) { |
|
817 |
+ nsTArray<nsCString> output; |
|
818 |
+ if (nsKDEUtils::command(command, &output) && output.Length() == 3) { |
|
819 |
+ nsCString mimetype = output[0]; |
|
820 |
+ RefPtr<nsMIMEInfoUnix> mimeInfo = new nsMIMEInfoUnix(mimetype); |
|
821 |
+ NS_ENSURE_TRUE(mimeInfo, nullptr); |
|
822 |
+ nsCString description = output[1]; |
|
823 |
+ mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); |
|
824 |
+ nsCString handlerAppName = output[2]; |
|
825 |
+ mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk); |
|
826 |
+ mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); |
|
827 |
+ return mimeInfo.forget(); |
|
828 |
+ } |
|
829 |
+ return nullptr; |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
830 |
+} |
1191 | 831 |
diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h |
832 |
new file mode 100644 |
|
1196 | 833 |
index 0000000000000000000000000000000000000000..c6a41b331b2b5ead6142171f08d8b8a7872ca516 |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
834 |
--- /dev/null |
1191 | 835 |
+++ b/uriloader/exthandler/unix/nsKDERegistry.h |
1190 | 836 |
@@ -0,0 +1,35 @@ |
546 | 837 |
+/* This Source Code Form is subject to the terms of the Mozilla Public |
838 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
839 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
840 |
+ |
757 | 841 |
+#ifndef nsKDERegistry_h__ |
842 |
+#define nsKDERegistry_h__ |
|
843 |
+ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
844 |
+#include "nsIURI.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
845 |
+#include "nsCOMPtr.h" |
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
846 |
+#include "nsTArray.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
847 |
+ |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
848 |
+class nsMIMEInfoBase; |
1190 | 849 |
+// class nsAutoCString; |
850 |
+// class nsCString; |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
851 |
+ |
1190 | 852 |
+class nsKDERegistry { |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
853 |
+ public: |
1190 | 854 |
+ static bool HandlerExists(const char* aProtocolScheme); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
855 |
+ |
1190 | 856 |
+ static nsresult LoadURL(nsIURI* aURL); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
857 |
+ |
1190 | 858 |
+ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
859 |
+ |
1190 | 860 |
+ static already_AddRefed<nsMIMEInfoBase> GetFromExtension( |
861 |
+ const nsACString& aFileExt); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
862 |
+ |
1190 | 863 |
+ static already_AddRefed<nsMIMEInfoBase> GetFromType( |
864 |
+ const nsACString& aMIMEType); |
|
865 |
+ |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
866 |
+ private: |
1190 | 867 |
+ static already_AddRefed<nsMIMEInfoBase> GetFromHelper( |
868 |
+ const nsTArray<nsCString>& command); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
869 |
+}; |
757 | 870 |
+ |
1190 | 871 |
+#endif // nsKDERegistry_h__ |
1191 | 872 |
diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
1196 | 873 |
index 330c4411597f1a19105601e256a2c3bc71c61780..c96c1f3ca5a05c3b6bce321d7a975aa040865fa8 100644 |
1191 | 874 |
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
875 |
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp |
|
1196 | 876 |
@@ -5,16 +5,19 @@ |
932 | 877 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
878 |
|
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
879 |
#include "nsMIMEInfoUnix.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
880 |
-#include "nsGNOMERegistry.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
881 |
+#include "nsCommonRegistry.h" |
127
4c86470ed796
Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
64
diff
changeset
|
882 |
#include "nsIGIOService.h" |
236
a4f5954df3a3
update for 2.0/4.0rc1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
229
diff
changeset
|
883 |
#include "nsNetCID.h" |
a4f5954df3a3
update for 2.0/4.0rc1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
229
diff
changeset
|
884 |
#include "nsIIOService.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
885 |
#ifdef MOZ_ENABLE_DBUS |
1089 | 886 |
# include "nsDBusHandlerApp.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
887 |
#endif |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
888 |
+#if defined(XP_UNIX) && !defined(XP_MACOSX) |
1190 | 889 |
+# include "nsKDEUtils.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
890 |
+#endif |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
891 |
|
1097 | 892 |
nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) { |
932 | 893 |
- return nsGNOMERegistry::LoadURL(aURI); |
894 |
+ return nsCommonRegistry::LoadURL(aURI); |
|
895 |
} |
|
127
4c86470ed796
Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
64
diff
changeset
|
896 |
|
932 | 897 |
NS_IMETHODIMP |
1196 | 898 |
@@ -29,15 +32,15 @@ nsMIMEInfoUnix::GetHasDefaultHandler(bool* _retval) { |
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
899 |
*_retval = false; |
738 | 900 |
|
850 | 901 |
if (mClass == eProtocolInfo) { |
738 | 902 |
- *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get()); |
903 |
+ *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get()); |
|
904 |
} else { |
|
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
905 |
RefPtr<nsMIMEInfoBase> mimeInfo = |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
906 |
- nsGNOMERegistry::GetFromType(mSchemeOrType); |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
907 |
+ nsCommonRegistry::GetFromType(mSchemeOrType); |
738 | 908 |
if (!mimeInfo) { |
909 |
nsAutoCString ext; |
|
910 |
nsresult rv = GetPrimaryExtension(ext); |
|
911 |
if (NS_SUCCEEDED(rv)) { |
|
912 |
- mimeInfo = nsGNOMERegistry::GetFromExtension(ext); |
|
913 |
+ mimeInfo = nsCommonRegistry::GetFromExtension(ext); |
|
914 |
} |
|
127
4c86470ed796
Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
64
diff
changeset
|
915 |
} |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
916 |
if (mimeInfo) *_retval = true; |
1196 | 917 |
@@ -59,6 +62,21 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile* aFile) { |
1032
8220ea23b47d
remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1021
diff
changeset
|
918 |
nsAutoCString nativePath; |
8220ea23b47d
remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1021
diff
changeset
|
919 |
aFile->GetNativePath(nativePath); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
920 |
|
1190 | 921 |
+ if (nsKDEUtils::kdeSupport()) { |
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
922 |
+ bool supports; |
1190 | 923 |
+ if (NS_SUCCEEDED(GetHasDefaultHandler(&supports)) && supports) { |
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
924 |
+ nsTArray<nsCString> command; |
1190 | 925 |
+ command.AppendElement("OPEN"_ns); |
926 |
+ command.AppendElement(nativePath); |
|
927 |
+ command.AppendElement("MIMETYPE"_ns); |
|
928 |
+ command.AppendElement(mSchemeOrType); |
|
929 |
+ if (nsKDEUtils::command(command)) return NS_OK; |
|
64
7bb1edb78dd5
Update to 1.9.2.4/3.6.4pre to prepare the bigger Lorentz merge
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
59
diff
changeset
|
930 |
+ } |
1190 | 931 |
+ if (!GetDefaultApplication()) return NS_ERROR_FILE_NOT_FOUND; |
64
7bb1edb78dd5
Update to 1.9.2.4/3.6.4pre to prepare the bigger Lorentz merge
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
59
diff
changeset
|
932 |
+ |
1188 | 933 |
+ return LaunchWithIProcess(GetDefaultApplication(), nativePath); |
64
7bb1edb78dd5
Update to 1.9.2.4/3.6.4pre to prepare the bigger Lorentz merge
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
59
diff
changeset
|
934 |
+ } |
7bb1edb78dd5
Update to 1.9.2.4/3.6.4pre to prepare the bigger Lorentz merge
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
59
diff
changeset
|
935 |
+ |
127
4c86470ed796
Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
64
diff
changeset
|
936 |
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); |
850 | 937 |
if (!giovfs) { |
938 |
return NS_ERROR_FAILURE; |
|
1191 | 939 |
diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
1196 | 940 |
index 7f6eaa46f2ee0d5155b83bfb07d8040584935772..f7627e790c47e1ae007b072b4bb47b18de1ae417 100644 |
1191 | 941 |
--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
942 |
+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp |
|
1196 | 943 |
@@ -10,7 +10,7 @@ |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
944 |
#include "nsOSHelperAppService.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
945 |
#include "nsMIMEInfoUnix.h" |
659 | 946 |
#ifdef MOZ_WIDGET_GTK |
1089 | 947 |
-# include "nsGNOMERegistry.h" |
948 |
+# include "nsCommonRegistry.h" |
|
1159 | 949 |
# ifdef MOZ_BUILD_APP_IS_BROWSER |
950 |
# include "nsIToolkitShellService.h" |
|
951 |
# include "nsIGNOMEShellService.h" |
|
1196 | 952 |
@@ -1106,7 +1106,7 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists( |
1020
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
953 |
if (!XRE_IsContentProcess()) { |
659 | 954 |
#ifdef MOZ_WIDGET_GTK |
1020
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
955 |
// Check the GNOME registry for a protocol handler |
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
956 |
- *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme); |
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
957 |
+ *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme); |
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
958 |
#else |
d2c159cb9bf2
rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1014
diff
changeset
|
959 |
*aHandlerExists = false; |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
960 |
#endif |
1196 | 961 |
@@ -1126,7 +1126,7 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists( |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
962 |
NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription( |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
963 |
const nsACString& aScheme, nsAString& _retval) { |
659 | 964 |
#ifdef MOZ_WIDGET_GTK |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
965 |
- nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval); |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
966 |
+ nsCommonRegistry::GetAppDescForScheme(aScheme, _retval); |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
967 |
return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
968 |
#else |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
969 |
return NS_ERROR_NOT_AVAILABLE; |
1196 | 970 |
@@ -1231,7 +1231,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHelperAppService::GetFromExtension( |
659 | 971 |
#ifdef MOZ_WIDGET_GTK |
1178 | 972 |
LOG("Looking in GNOME registry\n"); |
899 | 973 |
RefPtr<nsMIMEInfoBase> gnomeInfo = |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
974 |
- nsGNOMERegistry::GetFromExtension(aFileExt); |
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
975 |
+ nsCommonRegistry::GetFromExtension(aFileExt); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
976 |
if (gnomeInfo) { |
1178 | 977 |
LOG("Got MIMEInfo from GNOME registry\n"); |
653 | 978 |
return gnomeInfo.forget(); |
1196 | 979 |
@@ -1344,7 +1344,7 @@ already_AddRefed<nsMIMEInfoBase> nsOSHelperAppService::GetFromType( |
850 | 980 |
|
659 | 981 |
#ifdef MOZ_WIDGET_GTK |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
982 |
if (handler.IsEmpty()) { |
899 | 983 |
- RefPtr<nsMIMEInfoBase> gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType); |
984 |
+ RefPtr<nsMIMEInfoBase> gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType); |
|
850 | 985 |
if (gnomeInfo) { |
1178 | 986 |
LOG("Got MIMEInfo from GNOME registry without extensions; setting them " |
987 |
"to %s\n", |
|
1191 | 988 |
diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build |
1196 | 989 |
index c6a765df9e5a4c95f77e9ee1b4ebbf9913a81e15..6e9028169ac594a24f90a4f58dc493c8332c6bf8 100644 |
1191 | 990 |
--- a/widget/gtk/moz.build |
991 |
+++ b/widget/gtk/moz.build |
|
1196 | 992 |
@@ -161,6 +161,7 @@ LOCAL_INCLUDES += [ |
1152 | 993 |
"/layout/xul", |
994 |
"/other-licenses/atk-1.0", |
|
995 |
"/third_party/cups/include", |
|
996 |
+ "/toolkit/xre", |
|
997 |
"/widget", |
|
998 |
"/widget/headless", |
|
1191 | 999 |
"/widget/x11", |
1000 |
diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp |
|
1196 | 1001 |
index 22d0f46b9563734c7afb4292417124f3cd171a12..b2a68711eb344d5ac41a7133751b2c19d574f532 100644 |
1191 | 1002 |
--- a/widget/gtk/nsFilePicker.cpp |
1003 |
+++ b/widget/gtk/nsFilePicker.cpp |
|
1196 | 1004 |
@@ -5,6 +5,7 @@ |
10
1920f0ff04a3
Make mozilla-kde.patch compile with 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
9
diff
changeset
|
1005 |
|
1121 | 1006 |
#include <dlfcn.h> |
1007 |
#include <gtk/gtk.h> |
|
1008 |
+#include <gdk/gdkx.h> |
|
837 | 1009 |
#include <sys/types.h> |
1010 |
#include <sys/stat.h> |
|
1011 |
#include <unistd.h> |
|
1196 | 1012 |
@@ -28,6 +29,8 @@ |
1159 | 1013 |
#include "WidgetUtilsGtk.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1014 |
|
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1015 |
#include "nsFilePicker.h" |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1016 |
+#include "nsKDEUtils.h" |
1125 | 1017 |
+#include "nsURLHelper.h" |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1018 |
|
1159 | 1019 |
#undef LOG |
1020 |
#ifdef MOZ_LOGGING |
|
1196 | 1021 |
@@ -242,7 +245,8 @@ NS_IMETHODIMP |
1097 | 1022 |
nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) { |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1023 |
if (aFilter.EqualsLiteral("..apps")) { |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1024 |
// No platform specific thing we can do here, really.... |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1025 |
- return NS_OK; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1026 |
+ // Unless it's KDE. |
1190 | 1027 |
+ if (mMode != modeOpen || !nsKDEUtils::kdeSupport()) return NS_OK; |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1028 |
} |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1029 |
|
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
546
diff
changeset
|
1030 |
nsAutoCString filter, name; |
1196 | 1031 |
@@ -352,6 +356,31 @@ nsFilePicker::Open(nsIFilePickerShownCallback* aCallback) { |
589 | 1032 |
// Can't show two dialogs concurrently with the same filepicker |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
1033 |
if (mRunning) return NS_ERROR_NOT_AVAILABLE; |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1034 |
|
589 | 1035 |
+ // KDE file picker is not handled via callback |
1190 | 1036 |
+ if (nsKDEUtils::kdeSupport()) { |
589 | 1037 |
+ mCallback = aCallback; |
1038 |
+ mRunning = true; |
|
1013
a71985fab8e5
Bug 1069962 Tumbleweed: OpenSuse's Firefox version crashes when "cancel" pressed in "File Upload" dialogue, e.g. TYPO3, BUGZILLA
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1007
diff
changeset
|
1039 |
+ NS_ADDREF_THIS(); |
1190 | 1040 |
+ g_idle_add( |
1041 |
+ [](gpointer data) -> gboolean { |
|
1042 |
+ nsFilePicker* queuedPicker = (nsFilePicker*)data; |
|
1043 |
+ nsIFilePicker::ResultCode result; |
|
1044 |
+ queuedPicker->kdeFileDialog(&result); |
|
1045 |
+ if (queuedPicker->mCallback) { |
|
1046 |
+ queuedPicker->mCallback->Done(result); |
|
1047 |
+ queuedPicker->mCallback = nullptr; |
|
1048 |
+ } else { |
|
1049 |
+ queuedPicker->mResult = result; |
|
1050 |
+ } |
|
1051 |
+ queuedPicker->mRunning = false; |
|
1052 |
+ NS_RELEASE(queuedPicker); |
|
1053 |
+ return G_SOURCE_REMOVE; |
|
1054 |
+ }, |
|
1055 |
+ this); |
|
999
932b3ad009d5
improve KDE patch:
Ignaz Forster <ignaz.forster@muenchen.de>
parents:
994
diff
changeset
|
1056 |
+ |
589 | 1057 |
+ return NS_OK; |
1058 |
+ } |
|
399
20f8b5f0aea6
port KDE patches to Gecko 11
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
398
diff
changeset
|
1059 |
+ |
1124 | 1060 |
NS_ConvertUTF16toUTF8 title(mTitle); |
589 | 1061 |
|
1097 | 1062 |
GtkWindow* parent_widget = |
1196 | 1063 |
@@ -633,6 +662,205 @@ void nsFilePicker::Done(void* file_chooser, gint response) { |
541
830e50bbfc79
working Aurora 17.0 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
538
diff
changeset
|
1064 |
NS_RELEASE_THIS(); |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1065 |
} |
1082 | 1066 |
|
1190 | 1067 |
+nsCString nsFilePicker::kdeMakeFilter(int index) { |
1068 |
+ nsCString buf = mFilters[index]; |
|
1069 |
+ for (PRUint32 i = 0; i < buf.Length(); ++i) |
|
1070 |
+ if (buf[i] == ';') // KDE separates just using spaces |
|
1071 |
+ buf.SetCharAt(' ', i); |
|
1072 |
+ if (!mFilterNames[index].IsEmpty()) { |
|
1073 |
+ buf += "|"; |
|
1074 |
+ buf += mFilterNames[index].get(); |
|
1075 |
+ } |
|
1076 |
+ return buf; |
|
1077 |
+} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1078 |
+ |
1190 | 1079 |
+static PRInt32 windowToXid(nsIWidget* widget) { |
1080 |
+ GtkWindow* parent_widget = |
|
1081 |
+ GTK_WINDOW(widget->GetNativeData(NS_NATIVE_SHELLWIDGET)); |
|
1082 |
+ GdkWindow* gdk_window = |
|
1083 |
+ gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(parent_widget))); |
|
1084 |
+ return GDK_WINDOW_XID(gdk_window); |
|
1085 |
+} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1086 |
+ |
1190 | 1087 |
+NS_IMETHODIMP nsFilePicker::kdeFileDialog(nsIFilePicker::ResultCode* aReturn) { |
1088 |
+ NS_ENSURE_ARG_POINTER(aReturn); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1089 |
+ |
1190 | 1090 |
+ if (mMode == modeOpen && mFilters.Length() == 1 && |
1091 |
+ mFilters[0].EqualsLiteral("..apps")) |
|
1092 |
+ return kdeAppsDialog(aReturn); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1093 |
+ |
1190 | 1094 |
+ nsCString title; |
1095 |
+ title.Adopt(ToNewUTF8String(mTitle)); |
|
1096 |
+ |
|
1097 |
+ const char* arg = NULL; |
|
1098 |
+ if (mAllowURLs) { |
|
1099 |
+ switch (mMode) { |
|
1100 |
+ case nsIFilePicker::modeOpen: |
|
1101 |
+ case nsIFilePicker::modeOpenMultiple: |
|
1102 |
+ arg = "GETOPENURL"; |
|
1103 |
+ break; |
|
1104 |
+ case nsIFilePicker::modeSave: |
|
1105 |
+ arg = "GETSAVEURL"; |
|
1106 |
+ break; |
|
1107 |
+ case nsIFilePicker::modeGetFolder: |
|
1108 |
+ arg = "GETDIRECTORYURL"; |
|
1109 |
+ break; |
|
1110 |
+ } |
|
1111 |
+ } else { |
|
1112 |
+ switch (mMode) { |
|
1113 |
+ case nsIFilePicker::modeOpen: |
|
1114 |
+ case nsIFilePicker::modeOpenMultiple: |
|
1115 |
+ arg = "GETOPENFILENAME"; |
|
1116 |
+ break; |
|
1117 |
+ case nsIFilePicker::modeSave: |
|
1118 |
+ arg = "GETSAVEFILENAME"; |
|
1119 |
+ break; |
|
1120 |
+ case nsIFilePicker::modeGetFolder: |
|
1121 |
+ arg = "GETDIRECTORYFILENAME"; |
|
1122 |
+ break; |
|
1123 |
+ } |
|
1124 |
+ } |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1125 |
+ |
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
546
diff
changeset
|
1126 |
+ nsAutoCString directory; |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1127 |
+ if (mDisplayDirectory) { |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1128 |
+ mDisplayDirectory->GetNativePath(directory); |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1129 |
+ } else if (mPrevDisplayDirectory) { |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1130 |
+ mPrevDisplayDirectory->GetNativePath(directory); |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1131 |
+ } |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1132 |
+ |
1190 | 1133 |
+ nsAutoCString startdir; |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1134 |
+ if (!directory.IsEmpty()) { |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1135 |
+ startdir = directory; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1136 |
+ } |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1137 |
+ if (mMode == nsIFilePicker::modeSave) { |
1190 | 1138 |
+ if (!startdir.IsEmpty()) { |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1139 |
+ startdir += "/"; |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1140 |
+ startdir += ToNewUTF8String(mDefault); |
1190 | 1141 |
+ } else |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1142 |
+ startdir = ToNewUTF8String(mDefault); |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1143 |
+ } |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1144 |
+ |
1190 | 1145 |
+ nsAutoCString filters; |
1146 |
+ PRInt32 count = mFilters.Length(); |
|
1147 |
+ if (count == 0) // just in case |
|
1148 |
+ filters = "*"; |
|
1149 |
+ else { |
|
1150 |
+ filters = kdeMakeFilter(0); |
|
1151 |
+ for (PRInt32 i = 1; i < count; ++i) { |
|
1152 |
+ filters += "\n"; |
|
1153 |
+ filters += kdeMakeFilter(i); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1154 |
+ } |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1155 |
+ } |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1156 |
+ |
1190 | 1157 |
+ nsTArray<nsCString> command; |
1158 |
+ command.AppendElement(nsAutoCString(arg)); |
|
1159 |
+ command.AppendElement(startdir); |
|
1160 |
+ if (mMode != nsIFilePicker::modeGetFolder) { |
|
1161 |
+ command.AppendElement(filters); |
|
1162 |
+ nsAutoCString selected; |
|
1163 |
+ selected.AppendInt(mSelectedType); |
|
1164 |
+ command.AppendElement(selected); |
|
1165 |
+ } |
|
1166 |
+ command.AppendElement(title); |
|
1167 |
+ if (mMode == nsIFilePicker::modeOpenMultiple) |
|
1168 |
+ command.AppendElement("MULTIPLE"_ns); |
|
1169 |
+ if (PRInt32 xid = windowToXid(mParentWidget)) { |
|
1170 |
+ command.AppendElement("PARENT"_ns); |
|
1171 |
+ nsAutoCString parent; |
|
1172 |
+ parent.AppendInt(xid); |
|
1173 |
+ command.AppendElement(parent); |
|
1174 |
+ } |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1175 |
+ |
1190 | 1176 |
+ nsTArray<nsCString> output; |
1177 |
+ if (nsKDEUtils::commandBlockUi( |
|
1178 |
+ command, |
|
1179 |
+ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), |
|
1180 |
+ &output)) { |
|
1181 |
+ *aReturn = nsIFilePicker::returnOK; |
|
1182 |
+ mFiles.Clear(); |
|
1183 |
+ if (mMode != nsIFilePicker::modeGetFolder) { |
|
1184 |
+ mSelectedType = atoi(output[0].get()); |
|
1185 |
+ output.RemoveElementAt(0); |
|
1186 |
+ } |
|
1187 |
+ if (mMode == nsIFilePicker::modeOpenMultiple) { |
|
1188 |
+ mFileURL.Truncate(); |
|
1189 |
+ PRUint32 count = output.Length(); |
|
1190 |
+ for (PRUint32 i = 0; i < count; ++i) { |
|
1191 |
+ nsCOMPtr<nsIFile> localfile; |
|
1192 |
+ nsresult rv = NS_NewNativeLocalFile(output[i], PR_FALSE, |
|
1193 |
+ getter_AddRefs(localfile)); |
|
1194 |
+ if (NS_SUCCEEDED(rv)) mFiles.AppendObject(localfile); |
|
1195 |
+ } |
|
1196 |
+ } else { |
|
1197 |
+ if (output.Length() == 0) |
|
1198 |
+ mFileURL = nsCString(); |
|
1199 |
+ else if (mAllowURLs) |
|
1200 |
+ mFileURL = output[0]; |
|
1201 |
+ else // GetFile() actually requires it to be url even for local files :-/ |
|
1202 |
+ { |
|
1203 |
+ nsCOMPtr<nsIFile> localfile; |
|
1204 |
+ nsresult rv = NS_NewNativeLocalFile(output[0], PR_FALSE, |
|
1205 |
+ getter_AddRefs(localfile)); |
|
1206 |
+ if (NS_SUCCEEDED(rv)) |
|
1207 |
+ rv = net_GetURLSpecFromActualFile(localfile, mFileURL); |
|
1208 |
+ } |
|
1209 |
+ } |
|
1210 |
+ // Remember last used directory. |
|
1211 |
+ nsCOMPtr<nsIFile> file; |
|
1212 |
+ GetFile(getter_AddRefs(file)); |
|
1213 |
+ if (file) { |
|
1214 |
+ nsCOMPtr<nsIFile> dir; |
|
1215 |
+ file->GetParent(getter_AddRefs(dir)); |
|
1216 |
+ nsCOMPtr<nsIFile> localDir(dir); |
|
1217 |
+ if (localDir) { |
|
1218 |
+ localDir.swap(mPrevDisplayDirectory); |
|
1219 |
+ } |
|
1220 |
+ } |
|
1221 |
+ if (mMode == nsIFilePicker::modeSave) { |
|
1222 |
+ nsCOMPtr<nsIFile> file; |
|
1223 |
+ GetFile(getter_AddRefs(file)); |
|
1224 |
+ if (file) { |
|
1225 |
+ bool exists = false; |
|
1226 |
+ file->Exists(&exists); |
|
1227 |
+ if (exists) // TODO do overwrite check in the helper app |
|
1228 |
+ *aReturn = nsIFilePicker::returnReplace; |
|
1229 |
+ } |
|
1230 |
+ } |
|
1231 |
+ } else { |
|
1232 |
+ *aReturn = nsIFilePicker::returnCancel; |
|
1233 |
+ } |
|
1234 |
+ return NS_OK; |
|
1235 |
+} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1236 |
+ |
1190 | 1237 |
+NS_IMETHODIMP nsFilePicker::kdeAppsDialog(nsIFilePicker::ResultCode* aReturn) { |
1238 |
+ NS_ENSURE_ARG_POINTER(aReturn); |
|
1239 |
+ |
|
1240 |
+ nsCString title; |
|
1241 |
+ title.Adopt(ToNewUTF8String(mTitle)); |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1242 |
+ |
1190 | 1243 |
+ nsTArray<nsCString> command; |
1244 |
+ command.AppendElement("APPSDIALOG"_ns); |
|
1245 |
+ command.AppendElement(title); |
|
1246 |
+ if (PRInt32 xid = windowToXid(mParentWidget)) { |
|
1247 |
+ command.AppendElement("PARENT"_ns); |
|
1248 |
+ nsAutoCString parent; |
|
1249 |
+ parent.AppendInt(xid); |
|
1250 |
+ command.AppendElement(parent); |
|
1251 |
+ } |
|
1252 |
+ |
|
1253 |
+ nsTArray<nsCString> output; |
|
1254 |
+ if (nsKDEUtils::commandBlockUi( |
|
1255 |
+ command, |
|
1256 |
+ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), |
|
1257 |
+ &output)) { |
|
1258 |
+ *aReturn = nsIFilePicker::returnOK; |
|
1259 |
+ mFileURL = output.Length() > 0 ? output[0] : nsCString(); |
|
1260 |
+ } else { |
|
1261 |
+ *aReturn = nsIFilePicker::returnCancel; |
|
1262 |
+ } |
|
1263 |
+ return NS_OK; |
|
1264 |
+} |
|
541
830e50bbfc79
working Aurora 17.0 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
538
diff
changeset
|
1265 |
+ |
1082 | 1266 |
// All below functions available as of GTK 3.20+ |
1097 | 1267 |
void* nsFilePicker::GtkFileChooserNew(const gchar* title, GtkWindow* parent, |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
1268 |
GtkFileChooserAction action, |
1191 | 1269 |
diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h |
1196 | 1270 |
index 496df4937277d96485376176296ee836aa261ec7..a4c1862ec042f4465d53bc95f138afb87260ba07 100644 |
1191 | 1271 |
--- a/widget/gtk/nsFilePicker.h |
1272 |
+++ b/widget/gtk/nsFilePicker.h |
|
1196 | 1273 |
@@ -74,6 +74,12 @@ class nsFilePicker : public nsBaseFilePicker { |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
1274 |
private: |
1097 | 1275 |
static nsIFile* mPrevDisplayDirectory; |
881 | 1276 |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1277 |
+ bool kdeRunning(); |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1278 |
+ bool getKdeRunning(); |
1190 | 1279 |
+ NS_IMETHODIMP kdeFileDialog(nsIFilePicker::ResultCode* aReturn); |
1280 |
+ NS_IMETHODIMP kdeAppsDialog(nsIFilePicker::ResultCode* aReturn); |
|
1281 |
+ nsCString kdeMakeFilter(int index); |
|
881 | 1282 |
+ |
1097 | 1283 |
void* GtkFileChooserNew(const gchar* title, GtkWindow* parent, |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
1284 |
GtkFileChooserAction action, |
1097 | 1285 |
const gchar* accept_label); |
1191 | 1286 |
diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp |
1196 | 1287 |
index 88ee06d78db60a84343fd3d23c16e163aead37c3..834d6a2d353cc1bd11916de8a28f5d05a86d9031 100644 |
1191 | 1288 |
--- a/xpcom/components/ManifestParser.cpp |
1289 |
+++ b/xpcom/components/ManifestParser.cpp |
|
1196 | 1290 |
@@ -43,6 +43,7 @@ |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1291 |
#include "nsIScriptError.h" |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1292 |
#include "nsIXULAppInfo.h" |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1293 |
#include "nsIXULRuntime.h" |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1294 |
+#include "nsKDEUtils.h" |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1295 |
|
935
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
932
diff
changeset
|
1296 |
using namespace mozilla; |
9ae2b79d3bb1
prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
932
diff
changeset
|
1297 |
|
1196 | 1298 |
@@ -394,6 +395,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf, |
1141 | 1299 |
constexpr auto kOs = u"os"_ns; |
1300 |
constexpr auto kOsVersion = u"osversion"_ns; |
|
1301 |
constexpr auto kABI = u"abi"_ns; |
|
1302 |
+ constexpr auto kDesktop = u"desktop"_ns; |
|
1303 |
constexpr auto kProcess = u"process"_ns; |
|
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1304 |
#if defined(MOZ_WIDGET_ANDROID) |
1141 | 1305 |
constexpr auto kTablet = u"tablet"_ns; |
1196 | 1306 |
@@ -453,6 +455,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf, |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1307 |
} |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1308 |
|
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1309 |
nsAutoString osVersion; |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1310 |
+ nsAutoString desktop; |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1311 |
#if defined(XP_WIN) |
1089 | 1312 |
# pragma warning(push) |
1313 |
# pragma warning(disable : 4996) // VC12+ deprecates GetVersionEx |
|
1196 | 1314 |
@@ -461,14 +464,17 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf, |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
1315 |
nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion, |
779 | 1316 |
info.dwMinorVersion); |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1317 |
} |
1141 | 1318 |
+ desktop = u"win"_ns; |
1089 | 1319 |
# pragma warning(pop) |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1320 |
#elif defined(MOZ_WIDGET_COCOA) |
1130 | 1321 |
SInt32 majorVersion = nsCocoaFeatures::macOSVersionMajor(); |
1322 |
SInt32 minorVersion = nsCocoaFeatures::macOSVersionMinor(); |
|
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
1323 |
nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", majorVersion, minorVersion); |
1141 | 1324 |
+ desktop = u"macosx"_ns); |
659 | 1325 |
#elif defined(MOZ_WIDGET_GTK) |
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
1326 |
nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", gtk_major_version, |
779 | 1327 |
gtk_minor_version); |
1141 | 1328 |
+ desktop = nsKDEUtils::kdeSession() ? u"kde"_ns : u"gnome"_ns; |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1329 |
#elif defined(MOZ_WIDGET_ANDROID) |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1330 |
bool isTablet = false; |
1184 | 1331 |
if (jni::IsAvailable()) { |
1196 | 1332 |
@@ -476,6 +482,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf, |
1184 | 1333 |
osVersion.Assign(release->ToString()); |
932 | 1334 |
isTablet = java::GeckoAppShell::IsTablet(); |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1335 |
} |
1141 | 1336 |
+ desktop = u"android"_ns; |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1337 |
#endif |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1338 |
|
885 | 1339 |
if (XRE_IsContentProcess()) { |
1196 | 1340 |
@@ -576,6 +583,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf, |
1156 | 1341 |
: eUnspecified; |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1342 |
#endif |
850 | 1343 |
int flags = 0; |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1344 |
+ TriState stDesktop = eUnspecified; |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1345 |
|
779 | 1346 |
while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && |
1347 |
ok) { |
|
1196 | 1348 |
@@ -585,6 +593,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf, |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1349 |
if (CheckStringFlag(kApplication, wtoken, appID, stApp) || |
985 | 1350 |
CheckOsFlag(kOs, wtoken, osTarget, stOs) || |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1351 |
CheckStringFlag(kABI, wtoken, abi, stABI) || |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1352 |
+ CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || |
807
f54c68340963
Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
779
diff
changeset
|
1353 |
CheckStringFlag(kProcess, wtoken, process, stProcess) || |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1354 |
CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) || |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1355 |
CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) || |
1196 | 1356 |
@@ -644,6 +653,7 @@ void ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf, |
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1357 |
|
1085
87f893cf45b9
Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1082
diff
changeset
|
1358 |
if (!ok || stApp == eBad || stAppVersion == eBad || |
1190 | 1359 |
stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || |
1360 |
+ stDesktop == eBad || |
|
419
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1361 |
#ifdef MOZ_WIDGET_ANDROID |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1362 |
stTablet == eBad || |
f6b055dd94bc
commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
409
diff
changeset
|
1363 |
#endif |
1191 | 1364 |
diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build |
1196 | 1365 |
index 95ee64e985ac34dd6a3191f1948afa6d05adcb73..9af8f80497b7390b7ca434b6ee3b86b2baf47489 100644 |
1191 | 1366 |
--- a/xpcom/components/moz.build |
1367 |
+++ b/xpcom/components/moz.build |
|
1196 | 1368 |
@@ -71,6 +71,7 @@ LOCAL_INCLUDES += [ |
1152 | 1369 |
"/js/xpconnect/loader", |
1370 |
"/layout/build", |
|
1371 |
"/modules/libjar", |
|
1372 |
+ "/toolkit/xre", |
|
779 | 1373 |
] |
1374 |
||
1152 | 1375 |
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": |
1191 | 1376 |
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp |
1196 | 1377 |
index 08c77360de6fdbf3dc579ea49243dbdc18f37ebc..eedd5bcf86bde3ecd795bbbcbf94799f19135323 100644 |
1191 | 1378 |
--- a/xpcom/io/nsLocalFileUnix.cpp |
1379 |
+++ b/xpcom/io/nsLocalFileUnix.cpp |
|
1196 | 1380 |
@@ -51,6 +51,7 @@ |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1381 |
|
515 | 1382 |
#ifdef MOZ_WIDGET_GTK |
1089 | 1383 |
# include "nsIGIOService.h" |
1384 |
+# include "nsKDEUtils.h" |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1385 |
#endif |
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1386 |
|
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
1387 |
#ifdef MOZ_WIDGET_COCOA |
1196 | 1388 |
@@ -2172,10 +2173,18 @@ nsLocalFile::Reveal() { |
1067 | 1389 |
} |
1390 |
||
515 | 1391 |
#ifdef MOZ_WIDGET_GTK |
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
1392 |
+ nsAutoCString url; |
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
1393 |
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); |
850 | 1394 |
- if (!giovfs) { |
1190 | 1395 |
- return NS_ERROR_FAILURE; |
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
1396 |
+ url = mPath; |
1190 | 1397 |
+ if (nsKDEUtils::kdeSupport()) { |
748
72ba5129e5fd
full rebase to Aurora 32
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
738
diff
changeset
|
1398 |
+ nsTArray<nsCString> command; |
1190 | 1399 |
+ command.AppendElement("REVEAL"_ns); |
1400 |
+ command.AppendElement(mPath); |
|
1401 |
+ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE; |
|
1402 |
} |
|
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1403 |
+ |
1190 | 1404 |
+ if (!giovfs) return NS_ERROR_FAILURE; |
9
bc5dfe5b853a
Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1405 |
+ |
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
1406 |
return giovfs->RevealFile(this); |
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
1407 |
#elif defined(MOZ_WIDGET_COCOA) |
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
1408 |
CFURLRef url; |
1196 | 1409 |
@@ -2197,6 +2206,13 @@ nsLocalFile::Launch() { |
1067 | 1410 |
} |
1411 |
||
686
ab25aac2aa83
Firefox 26.0b5 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
680
diff
changeset
|
1412 |
#ifdef MOZ_WIDGET_GTK |
1190 | 1413 |
+ if (nsKDEUtils::kdeSupport()) { |
748
72ba5129e5fd
full rebase to Aurora 32
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
738
diff
changeset
|
1414 |
+ nsTArray<nsCString> command; |
1190 | 1415 |
+ command.AppendElement("OPEN"_ns); |
1416 |
+ command.AppendElement(mPath); |
|
1417 |
+ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE; |
|
748
72ba5129e5fd
full rebase to Aurora 32
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
738
diff
changeset
|
1418 |
+ } |
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
1419 |
+ |
748
72ba5129e5fd
full rebase to Aurora 32
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
738
diff
changeset
|
1420 |
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); |
850 | 1421 |
if (!giovfs) { |
1422 |
return NS_ERROR_FAILURE; |