[polari/gnome-3-24] telepathyClient: Use GNetworkMonitor::network-changed signal
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/gnome-3-24] telepathyClient: Use GNetworkMonitor::network-changed signal
- Date: Wed, 21 Jun 2017 16:46:45 +0000 (UTC)
commit f33fb71dc5e09bb46a2033491377ee7dab0eae3e
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Jun 21 13:42:52 2017 +0200
telepathyClient: Use GNetworkMonitor::network-changed signal
Unlike notify::network-available that is emitted when the availability
of a default route changes, ::network-changed is emitted on any network
changes, for example when previously unavailable ranges become available
after connecting to a VPN network. As this may well be the reason for a
previous connection failure, it makes sense for us to reconnect accounts
in response.
https://bugzilla.gnome.org/show_bug.cgi?id=784047
src/telepathyClient.js | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 0144853..17d4c53 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -198,13 +198,13 @@ const TelepathyClient = new Lang.Class({
this._onAccountStatusChanged(this._accountsMonitor, a);
});
- this._networkMonitor.connect('notify::network-available',
- Lang.bind(this, this._onNetworkAvailableChanged));
- this._onNetworkAvailableChanged();
+ this._networkMonitor.connect('network-changed',
+ Lang.bind(this, this._onNetworkChanged));
+ this._onNetworkChanged(this._networkMonitor,
+ this._networkMonitor.network_available);
},
- _onNetworkAvailableChanged: function() {
- let connected = this._networkMonitor.network_available;
+ _onNetworkChanged: function(mon, connected) {
let presence = connected ? Tp.ConnectionPresenceType.AVAILABLE
: Tp.ConnectionPresenceType.OFFLINE;
debug('Network changed to %s'.format(connected ? 'available'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]