[epiphany/gnome-3-26] sync: Return early if there is no network connectivity
- From: Gabriel Ivașcu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-26] sync: Return early if there is no network connectivity
- Date: Tue, 14 Nov 2017 20:53:16 +0000 (UTC)
commit 28cd260c76ef1f4643f82405b1de8b70824ef920
Author: Gabriel Ivascu <gabrielivascu gnome org>
Date: Tue Nov 14 20:08:45 2017 +0200
sync: Return early if there is no network connectivity
https://bugzilla.gnome.org/show_bug.cgi?id=790286
lib/sync/ephy-sync-service.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/lib/sync/ephy-sync-service.c b/lib/sync/ephy-sync-service.c
index b757b98..c43da76 100644
--- a/lib/sync/ephy-sync-service.c
+++ b/lib/sync/ephy-sync-service.c
@@ -1375,11 +1375,18 @@ ephy_sync_service_sync_collection (EphySyncService *self,
static gboolean
ephy_sync_service_sync_internal (EphySyncService *self)
{
+ GNetworkMonitor *monitor;
guint index = 0;
guint num_managers;
g_assert (ephy_sync_utils_user_is_signed_in ());
+ monitor = g_network_monitor_get_default ();
+ if (g_network_monitor_get_connectivity (monitor) != G_NETWORK_CONNECTIVITY_FULL) {
+ g_signal_emit (self, signals[SYNC_FINISHED], 0);
+ return G_SOURCE_CONTINUE;
+ }
+
if (!self->managers) {
g_signal_emit (self, signals[SYNC_FINISHED], 0);
return G_SOURCE_CONTINUE;
@@ -2191,10 +2198,16 @@ synchronizable_deleted_cb (EphySynchronizableManager *manager,
EphySynchronizable *synchronizable,
EphySyncService *self)
{
+ GNetworkMonitor *monitor;
+
g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
g_assert (EPHY_IS_SYNC_SERVICE (self));
+ monitor = g_network_monitor_get_default ();
+ if (g_network_monitor_get_connectivity (monitor) != G_NETWORK_CONNECTIVITY_FULL)
+ return;
+
if (!ephy_sync_utils_user_is_signed_in ())
return;
@@ -2207,10 +2220,16 @@ synchronizable_modified_cb (EphySynchronizableManager *manager,
gboolean should_force,
EphySyncService *self)
{
+ GNetworkMonitor *monitor;
+
g_assert (EPHY_IS_SYNCHRONIZABLE_MANAGER (manager));
g_assert (EPHY_IS_SYNCHRONIZABLE (synchronizable));
g_assert (EPHY_IS_SYNC_SERVICE (self));
+ monitor = g_network_monitor_get_default ();
+ if (g_network_monitor_get_connectivity (monitor) != G_NETWORK_CONNECTIVITY_FULL)
+ return;
+
if (!ephy_sync_utils_user_is_signed_in ())
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]