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:
Storm Dragon
2026-01-13 10:19:37 -05:00
parent 9bdb7510c9
commit 475dfb70ed
2 changed files with 18 additions and 6 deletions

View File

@@ -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):

View File

@@ -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):