mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Enable resetable and String prefs.
This allows both boolean and string-type preferences. It also implements a system where prefs that are read from a configuration file can be reset back to their initial value, which is useful in a number of cases e.g. when running tests to ensure that each test starts with the same values for the prefs.
This commit is contained in:
parent
d811f2d1ba
commit
79e548905e
10 changed files with 174 additions and 33 deletions
|
@ -9,7 +9,7 @@ use euclid::size::{Size2D, TypedSize2D};
|
|||
use geometry::ScreenPx;
|
||||
use getopts::Options;
|
||||
use num_cpus;
|
||||
use prefs;
|
||||
use prefs::{self, PrefValue};
|
||||
use std::cmp;
|
||||
use std::default::Default;
|
||||
use std::env;
|
||||
|
@ -614,7 +614,7 @@ pub fn from_cmdline_args(args: &[String]) {
|
|||
// This must happen after setting the default options, since the prefs rely on
|
||||
// on the resource path.
|
||||
for pref in opt_match.opt_strs("pref").iter() {
|
||||
prefs::set_pref(pref, true);
|
||||
prefs::set_pref(pref, PrefValue::Boolean(true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue