reduce size of config file from 100k to some bytes... we just save non default values...
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sun, 1 Jan 2006 21:08:24 +0000 (21:08 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sun, 1 Jan 2006 21:08:24 +0000 (21:08 +0000)
size matters :)

lib/python/Components/config.py

index 82a5d6d..51e753c 100644 (file)
@@ -547,7 +547,8 @@ class configElement:
        def reload(self):
                self.loadData()
        def save(self):
-               configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
+               if self.defaultValue != self.value:
+                       configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
 
 class configElement_nonSave(configElement):
        def __init__(self, configPath, control, defaultValue, vals):