diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-23 13:41:53 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-23 13:41:53 -0500 |
commit | be18578af63e60da83d25e44fa731213ddf087e2 (patch) | |
tree | 0c611b29e663e87540f122d0b2989278e46ab638 /toolkit/obsolete/content/nsUserSettings.js | |
parent | 7eb2c156ba826a0ebf05db56a9fccf46094478ea (diff) | |
download | UXP-be18578af63e60da83d25e44fa731213ddf087e2.tar UXP-be18578af63e60da83d25e44fa731213ddf087e2.tar.gz UXP-be18578af63e60da83d25e44fa731213ddf087e2.tar.lz UXP-be18578af63e60da83d25e44fa731213ddf087e2.tar.xz UXP-be18578af63e60da83d25e44fa731213ddf087e2.zip |
Revert "Restore toolkit/obsolete"
This reverts commit b61927d4cdb92636758c4c80d5050b3266486529.
Diffstat (limited to 'toolkit/obsolete/content/nsUserSettings.js')
-rw-r--r-- | toolkit/obsolete/content/nsUserSettings.js | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/toolkit/obsolete/content/nsUserSettings.js b/toolkit/obsolete/content/nsUserSettings.js deleted file mode 100644 index e0c378caf..000000000 --- a/toolkit/obsolete/content/nsUserSettings.js +++ /dev/null @@ -1,108 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - - -/** - * nsPreferences - a wrapper around nsIPrefService. Provides built in - * exception handling to make preferences access simpler. - **/ -var nsPreferences = { - get mPrefService() - { - return Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); - }, - - setBoolPref: function (aPrefName, aPrefValue) - { - try - { - this.mPrefService.setBoolPref(aPrefName, aPrefValue); - } - catch (e) - { - } - }, - - getBoolPref: function (aPrefName, aDefVal) - { - try - { - return this.mPrefService.getBoolPref(aPrefName); - } - catch (e) - { - return aDefVal != undefined ? aDefVal : null; - } - return null; // quiet warnings - }, - - setUnicharPref: function (aPrefName, aPrefValue) - { - try - { - var str = Components.classes["@mozilla.org/supports-string;1"] - .createInstance(Components.interfaces.nsISupportsString); - str.data = aPrefValue; - this.mPrefService.setComplexValue(aPrefName, - Components.interfaces.nsISupportsString, str); - } - catch (e) - { - } - }, - - copyUnicharPref: function (aPrefName, aDefVal) - { - try - { - return this.mPrefService.getComplexValue(aPrefName, - Components.interfaces.nsISupportsString).data; - } - catch (e) - { - return aDefVal != undefined ? aDefVal : null; - } - return null; // quiet warnings - }, - - setIntPref: function (aPrefName, aPrefValue) - { - try - { - this.mPrefService.setIntPref(aPrefName, aPrefValue); - } - catch (e) - { - } - }, - - getIntPref: function (aPrefName, aDefVal) - { - try - { - return this.mPrefService.getIntPref(aPrefName); - } - catch (e) - { - return aDefVal != undefined ? aDefVal : null; - } - return null; // quiet warnings - }, - - getLocalizedUnicharPref: function (aPrefName, aDefVal) - { - try - { - return this.mPrefService.getComplexValue(aPrefName, - Components.interfaces.nsIPrefLocalizedString).data; - } - catch (e) - { - return aDefVal != undefined ? aDefVal : null; - } - return null; // quiet warnings - } -}; - |