Skip to content

Commit

Permalink
Fix issue related to QSettings saving booleans as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mwiencek committed Jan 20, 2014
1 parent b9b6bfe commit fed4022
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion picard/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit fed4022

Please sign in to comment.