Attempt to fix bug that causes settings to reinitialize when a change is made. This is a sneaky one, so can't be sure, but hopefully.
This commit is contained in:
@@ -88,12 +88,19 @@ class ACSS(dict):
|
||||
def __eq__(self, other):
|
||||
if not isinstance(other, ACSS):
|
||||
return False
|
||||
if self.get(ACSS.FAMILY) != other.get(ACSS.FAMILY):
|
||||
return False
|
||||
if self.get(ACSS.RATE) != other.get(ACSS.RATE):
|
||||
return False
|
||||
if self.get(ACSS.AVERAGE_PITCH) != other.get(ACSS.AVERAGE_PITCH):
|
||||
return False
|
||||
compareKeys = (
|
||||
ACSS.FAMILY,
|
||||
ACSS.RATE,
|
||||
ACSS.AVERAGE_PITCH,
|
||||
ACSS.GAIN,
|
||||
ACSS.PITCH_RANGE,
|
||||
ACSS.STRESS,
|
||||
ACSS.RICHNESS,
|
||||
ACSS.PUNCTUATIONS,
|
||||
)
|
||||
for key in compareKeys:
|
||||
if self.get(key) != other.get(key):
|
||||
return False
|
||||
return True
|
||||
|
||||
def __setitem__ (self, key, value):
|
||||
|
||||
@@ -32,6 +32,7 @@ __date__ = "$Date$"
|
||||
__copyright__ = "Copyright (c) 2010 Consorcio Fernando de los Rios."
|
||||
__license__ = "LGPL"
|
||||
|
||||
import copy
|
||||
import importlib
|
||||
import os
|
||||
from gi.repository import Gio, GLib
|
||||
@@ -232,6 +233,10 @@ class SettingsManager(object):
|
||||
value = getattr(settings, key)
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
value = copy.deepcopy(value)
|
||||
except Exception:
|
||||
pass
|
||||
self.defaultGeneral[key] = value
|
||||
|
||||
def _getCustomizedSettings(self):
|
||||
|
||||
Reference in New Issue
Block a user