From 50c0a173eba32fcc2b7ddb85d3a69f4a0343789e Mon Sep 17 00:00:00 2001 From: Jonathan Springer Date: Mon, 7 Dec 2015 16:41:15 -0500 Subject: [PATCH] Add settings migration for phonon to system change --- openlp/core/common/settings.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 869e70993..be78c7b79 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -59,6 +59,20 @@ def recent_files_conv(value): return [] +def media_players_conv(string): + """ + If phonon is in the setting string replace it with system + :param string: String to convert + :return: Converted string + """ + values = string.split(',') + for index, value in enumerate(values): + if value == 'phonon': + values[index] = 'system' + string = ','.join(values) + return string + + class Settings(QtCore.QSettings): """ Class to wrap QSettings. @@ -146,7 +160,7 @@ class Settings(QtCore.QSettings): 'core/override position': False, 'core/application version': '0.0', 'images/background color': '#000000', - 'media/players': 'webkit', + 'media/players': 'system,webkit', 'media/override player': QtCore.Qt.Unchecked, 'players/background color': '#000000', 'servicemanager/last directory': '', @@ -325,7 +339,9 @@ class Settings(QtCore.QSettings): # Changed during 2.2.x development. # ('advanced/stylesheet fix', '', []), # ('general/recent files', 'core/recent files', [(recent_files_conv, None)]), - ('songs/search as type', 'advanced/search as type', []) + ('songs/search as type', 'advanced/search as type', []), + ('media/players', 'media/players_temp', [(media_players_conv, None)]), # Convert phonon to system + ('media/players_temp', 'media/players', []) # Move temp setting from above to correct setting ] @staticmethod