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:
+13
-6
@@ -88,12 +88,19 @@ class ACSS(dict):
|
|||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if not isinstance(other, ACSS):
|
if not isinstance(other, ACSS):
|
||||||
return False
|
return False
|
||||||
if self.get(ACSS.FAMILY) != other.get(ACSS.FAMILY):
|
compareKeys = (
|
||||||
return False
|
ACSS.FAMILY,
|
||||||
if self.get(ACSS.RATE) != other.get(ACSS.RATE):
|
ACSS.RATE,
|
||||||
return False
|
ACSS.AVERAGE_PITCH,
|
||||||
if self.get(ACSS.AVERAGE_PITCH) != other.get(ACSS.AVERAGE_PITCH):
|
ACSS.GAIN,
|
||||||
return False
|
ACSS.PITCH_RANGE,
|
||||||
|
ACSS.STRESS,
|
||||||
|
ACSS.RICHNESS,
|
||||||
|
ACSS.PUNCTUATIONS,
|
||||||
|
)
|
||||||
|
for key in compareKeys:
|
||||||
|
if self.get(key) != other.get(key):
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def __setitem__ (self, key, value):
|
def __setitem__ (self, key, value):
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ __date__ = "$Date$"
|
|||||||
__copyright__ = "Copyright (c) 2010 Consorcio Fernando de los Rios."
|
__copyright__ = "Copyright (c) 2010 Consorcio Fernando de los Rios."
|
||||||
__license__ = "LGPL"
|
__license__ = "LGPL"
|
||||||
|
|
||||||
|
import copy
|
||||||
import importlib
|
import importlib
|
||||||
import os
|
import os
|
||||||
from gi.repository import Gio, GLib
|
from gi.repository import Gio, GLib
|
||||||
@@ -232,6 +233,10 @@ class SettingsManager(object):
|
|||||||
value = getattr(settings, key)
|
value = getattr(settings, key)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
value = copy.deepcopy(value)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
self.defaultGeneral[key] = value
|
self.defaultGeneral[key] = value
|
||||||
|
|
||||||
def _getCustomizedSettings(self):
|
def _getCustomizedSettings(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user