Ticket #362: sugar-profile-clear-reg.patch

File sugar-profile-clear-reg.patch, 894 bytes (added by dsd, 15 years ago)
  • profile.py

    From: Daniel Drake <dsd@laptop.org>
    
    Ensure that server.backup1 is removed from the config when it has been
    unset by clear_registration() in the network control panel.
    
    old new  
    102102            _set_key(cp, 'Buddy', 'NickName', self.nick_name.encode('utf8'))
    103103        if self.color:
    104104            _set_key(cp, 'Buddy', 'Color', self.color.to_string())
     105
     106        # Added by Daniel Drake for Paraguay
     107        # Needed for controlpanel.model.network.clear_registration to work
     108        try:
     109            cp.remove_option('Server', 'Backup1')
     110        except:
     111            pass
     112
    105113        if self.backup1:
    106114            _set_key(cp, 'Server', 'Backup1', self.backup1)
     115
    107116        if self.jabber_server is not None:
    108117            _set_key(cp, 'Jabber', 'Server', self.jabber_server)
    109118