diff options
author | Moonchild <moonchild@palemoon.org> | 2020-02-07 10:57:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-07 10:57:04 +0100 |
commit | 6c82d043a1fbcda650057467ae2858025290ed25 (patch) | |
tree | 0e6ed8ca0a0d12653351c67d8de62a372c954f29 /toolkit/components/apppicker/content/appPicker.js | |
parent | a6ef90b1830e263fefda7bcb6e7b74464044a678 (diff) | |
parent | fa52fa60b70c5883acd4a8edd8e1f89c3d5f3920 (diff) | |
download | UXP-6c82d043a1fbcda650057467ae2858025290ed25.tar UXP-6c82d043a1fbcda650057467ae2858025290ed25.tar.gz UXP-6c82d043a1fbcda650057467ae2858025290ed25.tar.lz UXP-6c82d043a1fbcda650057467ae2858025290ed25.tar.xz UXP-6c82d043a1fbcda650057467ae2858025290ed25.zip |
Merge pull request #1394 from MoonchildProductions/appconst-work
The rest of removing AppConstants for Platform
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); |