mirror of
https://github.com/zotero/zotero.git
synced 2026-10-07 02:58:09 +00:00
Add unused Zotero.Prefs.resetBranch()
I wrote this for account unlinking (since nsIPrefBranch.resetBranch() isn't implemented) but decided we didn't want to delete all prefs for that.
This commit is contained in:
parent
a7021f80ca
commit
a62161dfc1
1 changed files with 14 additions and 0 deletions
|
|
@ -2106,6 +2106,20 @@ Zotero.Prefs = new function(){
|
|||
}
|
||||
|
||||
|
||||
this.resetBranch = function (exclude = []) {
|
||||
var keys = this.prefBranch.getChildList("", {});
|
||||
for (let key of keys) {
|
||||
if (this.prefBranch.prefHasUserValue(key)) {
|
||||
if (exclude.includes(key)) {
|
||||
continue;
|
||||
}
|
||||
Zotero.debug("Clearing " + key);
|
||||
this.prefBranch.clearUserPref(key);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Import settings bundles
|
||||
this.importSettings = function (str, uri) {
|
||||
var ps = Services.prompt;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue