~osomon/gnome-session/fix-1718446

« back to all changes in this revision

Viewing changes to debian/unity-gnome-shell-migration.17.10.py

  • Committer: Didier Roche
  • Date: 2017-10-06 10:39:38 UTC
  • Revision ID: didier.roche@canonical.com-20171006103938-m0ci9036ese15d6x
* New upstream release
* debian/unity-gnome-shell-migration.17.10.py:
  - reset the rhythmbox plugins key and rename the migration script for
    people who installed pre-alpha getting the glib fix where some
    applications weren't supporting the per session override.
    (LP: #1720754)
  - rename it so that can applies to upgraders (the script is idempotent)

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
    dock_settings.sync() # force sync to avoid race
82
82
 
83
83
 
 
84
def reset_rhythmbox_plugins():
 
85
    '''We had a glib bug for list plugins, people installing 17.10 beta or before
 
86
    were reset to default non override defaults, if this is the case, reset them
 
87
    again.
 
88
    '''
 
89
    rh_settings = Gio.Settings.new("org.gnome.rhythmbox.plugins")
 
90
    if not rh_settings.is_writable("active-plugins"):
 
91
        print("Can't reset Rhythmbox key as not writable")
 
92
        return
 
93
    # only migrate if default system values were set
 
94
    if rh_settings.get_strv("active-plugins") != ['power-manager', 'generic-player', 'android', 'audiocd', 'iradio', 'mmkeys']:
 
95
        return
 
96
    rh_settings.reset("active-plugins")
 
97
    rh_settings.sync()
 
98
 
 
99
 
84
100
if __name__ == "__main__":
85
101
    source = Gio.SettingsSchemaSource.get_default()
86
102
    # Unity or GS not installed
92
108
 
93
109
    migrate_unity_launchers()
94
110
    migrate_launcher_properties()
 
111
    reset_rhythmbox_plugins()