- if (defaultValue != self.value) or (self.saveDefaults == True):
- configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
+ if self.value != defaultValue or self.saveDefaults:
+ configfile.setKey(self.configPath, self.datatoFile(self.controlType, self.value))
+ else:
+ try:
+ oldValue = configfile.getKey(self.configPath)
+ except:
+ oldValue = None
+ if oldValue is not None and oldValue != defaultValue:
+ configfile.setKey(self.configPath, self.datatoFile(self.controlType, self.value), True)