[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [torbutton/master] Bug 3100: Remove some old toggle pref helper functions
commit 216d0633d0f4666aeecedd6efcea018b74557541
Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date: Fri Feb 8 18:13:04 2013 -0800
Bug 3100: Remove some old toggle pref helper functions
---
src/chrome/content/torbutton.js | 92 ---------------------------------------
1 files changed, 0 insertions(+), 92 deletions(-)
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index 7652fff..0475bc8 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -962,98 +962,6 @@ function torbutton_update_statusbar(mode)
}
}
-// Bug 1506 P0: This is support code for preserving user prefs during
-// toggle.
-//
-// XXX: Hrmm, this may not always be called with ints (see bug 1006).
-// Possibly because some other addon sets odd values for a pref
-// that can be either int or char? Can maybe just wrap in try block
-// for now.
-function torbutton_setIntPref(pref, save, val, mode, changed) {
- if(!changed) return; // Handle the pref change cases via observers
- try {
- if(mode) {
- if(m_tb_prefs.prefHasUserValue(pref)) {
- m_tb_prefs.setIntPref("extensions.torbutton.saved."+save,
- m_tb_prefs.getIntPref(pref));
- } else if(m_tb_prefs.prefHasUserValue("extensions.torbutton.saved."+save)) {
- m_tb_prefs.clearUserPref("extensions.torbutton.saved."+save);
- }
- m_tb_prefs.setIntPref(pref, val);
- } else {
- if(m_tb_prefs.prefHasUserValue("extensions.torbutton.saved."+save)) {
- m_tb_prefs.setIntPref(pref,
- m_tb_prefs.getIntPref("extensions.torbutton.saved."+save));
- } else if(m_tb_prefs.prefHasUserValue(pref)) {
- m_tb_prefs.clearUserPref(pref);
- }
- }
- } catch(e) {
- var msg = "Torbutton BUG: torbutton_setIntPref failed for "+pref
- +"/"+save+" to value "+val+": "+e;
- torbutton_log(5, msg);
- window.alert(msg);
- }
-}
-
-// Bug 1506 P0: This is support code for preserving user prefs during
-// toggle.
-function torbutton_setCharPref(pref, save, val, mode, changed) {
- if(!changed) return; // Handle the pref change cases via observers
- try {
- if(mode) {
- if(m_tb_prefs.prefHasUserValue(pref)) {
- m_tb_prefs.setCharPref("extensions.torbutton.saved."+save,
- m_tb_prefs.getCharPref(pref));
- } else if(m_tb_prefs.prefHasUserValue("extensions.torbutton.saved."+save)) {
- m_tb_prefs.clearUserPref("extensions.torbutton.saved."+save);
- }
- m_tb_prefs.setCharPref(pref, val);
- } else {
- if(m_tb_prefs.prefHasUserValue("extensions.torbutton.saved."+save)) {
- m_tb_prefs.setCharPref(pref,
- m_tb_prefs.getCharPref("extensions.torbutton.saved."+save));
- } else if(m_tb_prefs.prefHasUserValue(pref)) {
- m_tb_prefs.clearUserPref(pref);
- }
- }
- } catch(e) {
- var msg = "Torbutton BUG: torbutton_setCharPref failed for "+pref
- +"/"+save+" to value "+val+": "+e;
- torbutton_log(5, msg);
- window.alert(msg);
- }
-}
-
-// Bug 1506 P0: This is support code for preserving user prefs during
-// toggle.
-function torbutton_setBoolPref(pref, save, val, mode, changed) {
- if(!changed) return; // Handle the pref change cases via observers
- try {
- if(mode) {
- if(m_tb_prefs.prefHasUserValue(pref)) {
- m_tb_prefs.setBoolPref("extensions.torbutton.saved."+save,
- m_tb_prefs.getBoolPref(pref));
- } else if(m_tb_prefs.prefHasUserValue("extensions.torbutton.saved."+save)) {
- m_tb_prefs.clearUserPref("extensions.torbutton.saved."+save);
- }
- m_tb_prefs.setBoolPref(pref, val);
- } else {
- if(m_tb_prefs.prefHasUserValue("extensions.torbutton.saved."+save)) {
- m_tb_prefs.setBoolPref(pref,
- m_tb_prefs.getBoolPref("extensions.torbutton.saved."+save));
- } else if(m_tb_prefs.prefHasUserValue(pref)) {
- m_tb_prefs.clearUserPref(pref);
- }
- }
- } catch(e) {
- var msg = "Torbutton BUG: torbutton_setBoolPref failed for "+pref
- +"/"+save+" to value "+val+": "+e;
- torbutton_log(5, msg);
- window.alert(msg);
- }
-}
-
// Bug 1506 P4: Timezone spoofing is pretty important
function torbutton_set_timezone(mode, startup) {
/* Windows doesn't call tzset() automatically.. Linux and MacOS
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits