[Pkg-mozext-commits] [requestpolicy] 145/257: [ref] common.js: move `clearPref()` to `Prefs`

David Prévot taffit at moszumanska.debian.org
Thu Jan 28 03:20:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit f03dfcbe90ee40660ac58e8b32ab2f20034bcc1d
Author: Martin Kimmerle <dev at 256k.de>
Date:   Tue Nov 17 18:14:21 2015 +0100

    [ref] common.js: move `clearPref()` to `Prefs`
---
 src/content/lib/prefs.jsm        | 11 +++++++++++
 src/content/settings/common.js   | 11 -----------
 src/content/settings/oldrules.js |  6 +++---
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/content/lib/prefs.jsm b/src/content/lib/prefs.jsm
index 3343ca8..1dab227 100644
--- a/src/content/lib/prefs.jsm
+++ b/src/content/lib/prefs.jsm
@@ -121,6 +121,17 @@ let Prefs = (function() {
              isPrefEmpty('allowedOriginsToDestinations'));
   };
 
+  self.clearPref = function (aPrefName) {
+    try {
+      if (rpPrefBranch.prefHasUserValue(aPrefName)) {
+        rpPrefBranch.clearUserPref(aPrefName);
+      }
+    } catch (e) {
+      Logger.dump('Clearing pref failed: ' + e.toString());
+    }
+    Services.prefs.savePrefFile(null);
+  };
+
 
 
   function observePref(subject, topic, data) {
diff --git a/src/content/settings/common.js b/src/content/settings/common.js
index 582fdc8..1590478 100644
--- a/src/content/settings/common.js
+++ b/src/content/settings/common.js
@@ -240,17 +240,6 @@ common.prefStringToObj = function (prefString) {
   return prefObj;
 };
 
-common.clearPref = function (pref) {
-  try {
-    if (rpPrefBranch.prefHasUserValue(pref)) {
-      rpPrefBranch.clearUserPref(pref);
-    }
-  } catch (e) {
-    Logger.dump('Clearing pref failed: ' + e.toString());
-  }
-  Services.prefs.savePrefFile(null);
-};
-
 common.addAllowRules = function (rules) {
   for (var i in rules) {
     var ruleData = rules[i];
diff --git a/src/content/settings/oldrules.js b/src/content/settings/oldrules.js
index 4784657..4dfdc77 100644
--- a/src/content/settings/oldrules.js
+++ b/src/content/settings/oldrules.js
@@ -53,9 +53,9 @@ function addRulesTableRow(table, ruleAction, origin, dest, ruleData) {
 }
 
 function deleteOldRules() {
-  common.clearPref('allowedOrigins');
-  common.clearPref('allowedDestinations');
-  common.clearPref('allowedOriginsToDestinations');
+  Prefs.clearPref('allowedOrigins');
+  Prefs.clearPref('allowedDestinations');
+  Prefs.clearPref('allowedOriginsToDestinations');
   $("#doimport").hide();
   $("#deletedone").show();
   $("#showReimportOptions").hide();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list