From fed4022da4597deb50ded5232ac6677e1e4e9aaa Mon Sep 17 00:00:00 2001 From: Michael Wiencek Date: Mon, 20 Jan 2014 00:04:20 -0600 Subject: [PATCH] Fix issue related to QSettings saving booleans as strings --- picard/config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/picard/config.py b/picard/config.py index b0d8d3d7f..aa5333fd2 100644 --- a/picard/config.py +++ b/picard/config.py @@ -192,7 +192,14 @@ class TextOption(Option): class BoolOption(Option): - convert = bool + @staticmethod + def convert(value): + # The QSettings IniFormat saves boolean values as the strings "true" + # and "false". Thus, explicit boolean and string comparisons are used + # to determine the value. NOTE: In PyQt >= 4.8.3, QSettings.value has + # an optional "type" parameter that avoids this. But we still support + # PyQt >= 4.5, so that is not used. + return value is True or value == "true" class IntOption(Option):