[openlp-dev] Migrating multiple settings to a single setting

Raoul Snyman raoul at snyman.info
Wed Nov 8 13:21:43 EST 2017


Hi guys,

We've got a settings migration system which will migrate an old setting 
to a new setting. I want to migrate a group of settings to a single new 
setting, but this is not currently supported. Here's what I'm trying to 
do:

With the current monitor settings, we store the monitor number the user 
has selected in the settings dialog, the size of the screen, and if the 
size is overridden. I want to migrate this all to a single setting which 
contains a JSON object which allows us to (in the future) support more 
monitors and more detailed settings for each monitor.

One of the ideas that I had was to read the new value before writing it. 
I'm not sure if this is a good way to do it, but perhaps that could 
work? e.g.

   ('monitor', 'monitors', [upgrade_monitor, '{}']),
   ('x position', 'monitors', [upgrade_x_position, '{}']),
   ('y position', 'monitors', [upgrade_y_position, '{}']),
   ('width', 'monitors', [upgrade_width, '{}']),
   ('height', 'monitors', [upgrade_height, '{}']),

Any other ideas?


-- 
Raoul Snyman
+1 (520) 490-9743
raoul at snyman.info


More information about the openlp-dev mailing list