summaryrefslogtreecommitdiffstats
path: root/toolkit/components
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-06 09:38:29 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:38:54 +0200
commit0084e719539d1ca985a9de7388a43501e728d4ef (patch)
treefc42023d566aa15834123e4c249fc8ed1dd75128 /toolkit/components
parentdbeceecde2ac036d12aece182a3a12ee67be7175 (diff)
downloadUXP-0084e719539d1ca985a9de7388a43501e728d4ef.tar
UXP-0084e719539d1ca985a9de7388a43501e728d4ef.tar.gz
UXP-0084e719539d1ca985a9de7388a43501e728d4ef.tar.lz
UXP-0084e719539d1ca985a9de7388a43501e728d4ef.tar.xz
UXP-0084e719539d1ca985a9de7388a43501e728d4ef.zip
Issue #65 - Remove AppConstants from toolkit/components/apppicker
Diffstat (limited to 'toolkit/components')
-rw-r--r--toolkit/components/apppicker/content/appPicker.js40
-rw-r--r--toolkit/components/apppicker/jar.mn2
2 files changed, 20 insertions, 22 deletions
diff --git a/toolkit/components/apppicker/content/appPicker.js b/toolkit/components/apppicker/content/appPicker.js
index 469a6ca23..21a007632 100644
--- a/toolkit/components/apppicker/content/appPicker.js
+++ b/toolkit/components/apppicker/content/appPicker.js
@@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-
function AppPicker() {}
AppPicker.prototype =
@@ -115,19 +113,19 @@ AppPicker.prototype =
* Retrieve the pretty description from the file
*/
getFileDisplayName: function getFileDisplayName(file) {
- if (AppConstants.platform == "win") {
- if (file instanceof Components.interfaces.nsILocalFileWin) {
- try {
- return file.getVersionInfoField("FileDescription");
- } catch (e) {}
- }
- } else if (AppConstants.platform == "macosx") {
- if (file instanceof Components.interfaces.nsILocalFileMac) {
- try {
- return file.bundleDisplayName;
- } catch (e) {}
- }
+#ifdef XP_WIN
+ if (file instanceof Components.interfaces.nsILocalFileWin) {
+ try {
+ return file.getVersionInfoField("FileDescription");
+ } catch (e) {}
+ }
+#elifdef XP_MACOSX
+ if (file instanceof Components.interfaces.nsILocalFileMac) {
+ try {
+ return file.bundleDisplayName;
+ } catch (e) {}
}
+#endif
return file.leafName;
},
@@ -183,13 +181,13 @@ AppPicker.prototype =
var fileLoc = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var startLocation;
- if (AppConstants.platform == "win") {
- startLocation = "ProgF"; // Program Files
- } else if (AppConstants.platform == "macosx") {
- startLocation = "LocApp"; // Local Applications
- } else {
- startLocation = "Home";
- }
+#ifdef XP_WIN
+ startLocation = "ProgF"; // Program Files
+#elifdef XP_MACOSX
+ startLocation = "LocApp"; // Local Applications
+#else
+ startLocation = "Home";
+#endif
fp.displayDirectory =
fileLoc.get(startLocation, Components.interfaces.nsILocalFile);
diff --git a/toolkit/components/apppicker/jar.mn b/toolkit/components/apppicker/jar.mn
index 60e029d8a..d8431c3fe 100644
--- a/toolkit/components/apppicker/jar.mn
+++ b/toolkit/components/apppicker/jar.mn
@@ -4,5 +4,5 @@
toolkit.jar:
content/global/appPicker.xul (content/appPicker.xul)
- content/global/appPicker.js (content/appPicker.js)
+* content/global/appPicker.js (content/appPicker.js)