[gnome-maps] application: Use GNetworkMonitor::connectivity instead of can_reach_async()
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] application: Use GNetworkMonitor::connectivity instead of can_reach_async()
- Date: Sun, 8 Oct 2017 19:30:05 +0000 (UTC)
commit 233aecfbe086596afc3eab77e7a6f37da23d14d1
Author: Marcus Lundblad <ml update uu se>
Date: Wed Oct 4 21:50:36 2017 +0200
application: Use GNetworkMonitor::connectivity instead of can_reach_async()
can_reach_async() doesn't seem to work well from a Flatpak.
Relying on the connectivity property should be enough, and also should
handle the captive portal case (if the user's system has enable
captive portal detection in NetworkManager).
https://bugzilla.gnome.org/show_bug.cgi?id=777706
src/application.js | 13 +------------
1 files changed, 1 insertions(+), 12 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index b1631f9..9cc5888 100644
--- a/src/application.js
+++ b/src/application.js
@@ -123,18 +123,7 @@ var Application = new Lang.Class({
},
_checkNetwork: function() {
- let addr = new Gio.NetworkAddress({ hostname: 'tile.openstreetmap.org',
- port: 80 });
-
- networkMonitor.can_reach_async(addr, null, (function(networkMonitor, res) {
- try {
- if (networkMonitor.can_reach_finish(res))
- this.connected = true;
- } catch(e) {
- this.connected = false;
- Utils.debug('Connection failed: ' + e.message);
- }
- }).bind(this));
+ this.connected = networkMonitor.connectivity === Gio.NetworkConnectivity.FULL;
},
_showContact: function(id) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]