~gtg-user/gtg/auto_pep8

« back to all changes in this revision

Viewing changes to GTG/plugins/notification_area/notification_area.py

Better handling of preferences loading (bug #1094307)

Show diffs side-by-side

added added

removed removed

Lines of Context:
385
385
 
386
386
### Preferences methods #######################################################
387
387
    def preferences_load(self):
388
 
        data = self.__plugin_api.load_configuration_object(self.PLUGIN_NAME,
389
 
                                                         "preferences")
390
 
        # We first load the preferences then update the dict
391
 
        # This way new default options are recognized with old cfg files
392
 
        self.preferences = self.DEFAULT_PREFERENCES
393
 
        if isinstance(data, dict):
394
 
            self.preferences.update(data)
 
388
        self.preferences = self.__plugin_api.load_configuration_object(
 
389
            self.PLUGIN_NAME, "preferences",
 
390
            default_values = self.DEFAULT_PREFERENCES)
395
391
 
396
392
    def preferences_store(self):
397
393
        self.__plugin_api.save_configuration_object(self.PLUGIN_NAME,