Ticket #2187: 0001-Sugar-Ad-hoc-network-reconnect-after-suspend-2187.patch

File 0001-Sugar-Ad-hoc-network-reconnect-after-suspend-2187.patch, 1.7 KB (added by erikos, 12 years ago)

Sugar Ad-hoc network: reconnect after suspend

  • src/jarabe/model/adhoc.py

    From bde38e446d076a9774b0cd8fa5d7556d34dc922e Mon Sep 17 00:00:00 2001
    From: Simon Schampijer <simon@schampijer.de>
    Date: Wed, 15 Sep 2010 09:58:29 +0200
    Subject: [PATCH] Sugar Ad-hoc network: reconnect after suspend #2187
    
    ---
     src/jarabe/model/adhoc.py |   15 +--------------
     1 files changed, 1 insertions(+), 14 deletions(-)
    
    diff --git a/src/jarabe/model/adhoc.py b/src/jarabe/model/adhoc.py
    index ad0c941..0ff3e22 100644
    a b class AdHocManager(gobject.GObject): 
    134134    def _update_state(self):
    135135        self.emit('state-changed', self._current_channel, self._device_state)
    136136
    137     def _have_configured_connections(self):
    138         return len(network.get_settings().connections) > 0
    139 
    140137    def autoconnect(self):
    141         """Autoconnect to an Ad-hoc network"""
    142         if self._device_state != network.DEVICE_STATE_DISCONNECTED:
    143             return
    144         elif self._have_configured_connections():
    145             self._autoconnect_adhoc_timer()
    146         else:
    147             self._autoconnect_adhoc()
    148 
    149     def _autoconnect_adhoc_timer(self):
    150138        """Start a timer which basically looks for 30 seconds of inactivity
    151139        on the device, then does autoconnect to an Ad-hoc network.
    152140
    class AdHocManager(gobject.GObject): 
    157145                self._AUTOCONNECT_TIMEOUT, self.__idle_check_cb)
    158146
    159147    def __idle_check_cb(self):
    160         if  self._device_state == network.DEVICE_STATE_DISCONNECTED:
    161             logging.debug("Connect to Ad-hoc network due to inactivity.")
     148        if self._device_state == network.DEVICE_STATE_DISCONNECTED:
    162149            self._autoconnect_adhoc()
    163150        return False
    164151