diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-06 09:38:29 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-02-06 09:38:29 -0500 |
commit | cd87677798bd001320937c237ca2d2d236c0f89f (patch) | |
tree | 482255ca06279f9d0d0e038f1c1574d7e1c5afcf /toolkit/components/apppicker/content/appPicker.js | |
parent | 0ab5c6474c6018c9f0b1910904038848e6cdcc18 (diff) | |
download | UXP-cd87677798bd001320937c237ca2d2d236c0f89f.tar UXP-cd87677798bd001320937c237ca2d2d236c0f89f.tar.gz UXP-cd87677798bd001320937c237ca2d2d236c0f89f.tar.lz UXP-cd87677798bd001320937c237ca2d2d236c0f89f.tar.xz UXP-cd87677798bd001320937c237ca2d2d236c0f89f.zip |
Issue #65 - Remove AppConstants from toolkit/components/apppicker
Diffstat (limited to 'toolkit/components/apppicker/content/appPicker.js')
-rw-r--r-- | toolkit/components/apppicker/content/appPicker.js | 40 |
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); |