[epiphany/wip/sync: 29/47] sync-service: Use g_return_if_fail() instead of plain return
- From: Gabriel Ivașcu <gabrielivascu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/sync: 29/47] sync-service: Use g_return_if_fail() instead of plain return
- Date: Tue, 7 Mar 2017 18:13:19 +0000 (UTC)
commit a416525df2187456d725b5146707ab7ab786a3d5
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date: Fri Feb 24 15:11:59 2017 +0200
sync-service: Use g_return_if_fail() instead of plain return
src/sync/ephy-sync-service.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/sync/ephy-sync-service.c b/src/sync/ephy-sync-service.c
index c27557b..b582265 100644
--- a/src/sync/ephy-sync-service.c
+++ b/src/sync/ephy-sync-service.c
@@ -616,7 +616,9 @@ ephy_sync_service_dispose (GObject *object)
{
EphySyncService *self = EPHY_SYNC_SERVICE (object);
- ephy_sync_service_stop_periodical_sync (self);
+ if (ephy_sync_service_is_signed_in (self))
+ ephy_sync_service_stop_periodical_sync (self);
+
ephy_sync_service_clear_storage_credentials (self);
ephy_sync_service_clear_tokens (self);
g_clear_pointer (&self->user_email, g_free);
@@ -1155,11 +1157,9 @@ ephy_sync_service_delete_bookmark (EphySyncService *self,
char *endpoint;
g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
+ g_return_if_fail (ephy_sync_service_is_signed_in (self));
g_return_if_fail (EPHY_IS_BOOKMARK (bookmark));
- if (ephy_sync_service_is_signed_in (self) == FALSE)
- return;
-
endpoint = g_strdup_printf ("storage/%s/%s",
EPHY_BOOKMARKS_COLLECTION,
ephy_bookmark_get_id (bookmark));
@@ -1430,9 +1430,7 @@ ephy_sync_service_start_periodical_sync (EphySyncService *self,
gboolean now)
{
g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
-
- if (ephy_sync_service_is_signed_in (self) == FALSE)
- return;
+ g_return_if_fail (ephy_sync_service_is_signed_in (self));
if (now == TRUE)
do_periodical_sync (self);
@@ -1444,9 +1442,7 @@ void
ephy_sync_service_stop_periodical_sync (EphySyncService *self)
{
g_return_if_fail (EPHY_IS_SYNC_SERVICE (self));
-
- if (ephy_sync_service_is_signed_in (self) == FALSE)
- return;
+ g_return_if_fail (ephy_sync_service_is_signed_in (self));
if (self->source_id != 0) {
g_source_remove (self->source_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]