forked from openlp/openlp
Add settings migration for phonon to system change
This commit is contained in:
parent
baa59f9321
commit
50c0a173eb
@ -59,6 +59,20 @@ def recent_files_conv(value):
|
|||||||
return []
|
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 Settings(QtCore.QSettings):
|
||||||
"""
|
"""
|
||||||
Class to wrap QSettings.
|
Class to wrap QSettings.
|
||||||
@ -146,7 +160,7 @@ class Settings(QtCore.QSettings):
|
|||||||
'core/override position': False,
|
'core/override position': False,
|
||||||
'core/application version': '0.0',
|
'core/application version': '0.0',
|
||||||
'images/background color': '#000000',
|
'images/background color': '#000000',
|
||||||
'media/players': 'webkit',
|
'media/players': 'system,webkit',
|
||||||
'media/override player': QtCore.Qt.Unchecked,
|
'media/override player': QtCore.Qt.Unchecked,
|
||||||
'players/background color': '#000000',
|
'players/background color': '#000000',
|
||||||
'servicemanager/last directory': '',
|
'servicemanager/last directory': '',
|
||||||
@ -325,7 +339,9 @@ class Settings(QtCore.QSettings):
|
|||||||
# Changed during 2.2.x development.
|
# Changed during 2.2.x development.
|
||||||
# ('advanced/stylesheet fix', '', []),
|
# ('advanced/stylesheet fix', '', []),
|
||||||
# ('general/recent files', 'core/recent files', [(recent_files_conv, None)]),
|
# ('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
|
@staticmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user