summaryrefslogtreecommitdiffstats
path: root/toolkit/components/apppicker/content/appPicker.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 21:49:04 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 21:49:04 +0200
commit39dac57259cff8b61db0b22cb2ad0a8adb02692e (patch)
tree52a026cc8c22793eb17fd0f5e22adce1ae08a1dd /toolkit/components/apppicker/content/appPicker.js
parenta1cce3b2b00bbd9f4983013ddd8934a7bccb9e99 (diff)
parentc2d9ab62f3d097c9e0e00184cab1f546554f5eaa (diff)
downloadUXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar
UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.gz
UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.lz
UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.tar.xz
UXP-39dac57259cff8b61db0b22cb2ad0a8adb02692e.zip
Merge branch 'redwood' into 28.9-platform
Diffstat (limited to 'toolkit/components/apppicker/content/appPicker.js')
-rw-r--r--toolkit/components/apppicker/content/appPicker.js40
1 files changed, 19 insertions, 21 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);