[epiphany/wip/ephy-sync] bookmarks-properties-grid: Split some code into a file-static helper function



commit 36a72f9f44b6159b55257b79ae7c5aaeecd3f33e
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Mon Aug 29 19:09:34 2016 +0300

    bookmarks-properties-grid: Split some code into a file-static helper function

 src/ephy-bookmark-properties-grid.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/ephy-bookmark-properties-grid.c b/src/ephy-bookmark-properties-grid.c
index 5b2d852..0d6b388 100644
--- a/src/ephy-bookmark-properties-grid.c
+++ b/src/ephy-bookmark-properties-grid.c
@@ -390,24 +390,22 @@ ephy_bookmark_properties_grid_constructed (GObject *object)
 }
 
 static void
-ephy_bookmark_properties_grid_destroy (GtkWidget *widget)
+ephy_bookmark_properties_grid_check_prev_values (EphyBookmarkPropertiesGrid *self)
 {
-  EphyBookmarkPropertiesGrid *self = EPHY_BOOKMARK_PROPERTIES_GRID (widget);
-
   if (ephy_bookmark_is_uploaded (self->bookmark) == FALSE)
-    goto out;
+    return;
 
   /* Check if any actual changes were made to the name, address or tags. If yes,
    * set the uploaded flag to FALSE. */
 
   if (g_strcmp0 (self->prev_name, ephy_bookmark_get_title (self->bookmark)) != 0) {
     ephy_bookmark_set_uploaded (self->bookmark, FALSE);
-    goto out;
+    return;
   }
 
   if (g_strcmp0 (self->prev_address, ephy_bookmark_get_url (self->bookmark)) != 0) {
     ephy_bookmark_set_uploaded (self->bookmark, FALSE);
-    goto out;
+    return;
   }
 
   if (self->prev_tags != NULL) {
@@ -420,7 +418,7 @@ ephy_bookmark_properties_grid_destroy (GtkWidget *widget)
       if (!g_sequence_lookup (self->prev_tags, g_sequence_get (iter),
                               (GCompareDataFunc)ephy_bookmark_tags_compare, NULL)) {
         ephy_bookmark_set_uploaded (self->bookmark, FALSE);
-        goto out;
+        return;
       }
     }
 
@@ -430,12 +428,18 @@ ephy_bookmark_properties_grid_destroy (GtkWidget *widget)
       if (!g_sequence_lookup (tags, g_sequence_get (iter),
                               (GCompareDataFunc)ephy_bookmark_tags_compare, NULL)) {
         ephy_bookmark_set_uploaded (self->bookmark, FALSE);
-        goto out;
+        return;
       }
     }
   }
+}
+
+static void
+ephy_bookmark_properties_grid_destroy (GtkWidget *widget)
+{
+  EphyBookmarkPropertiesGrid *self = EPHY_BOOKMARK_PROPERTIES_GRID (widget);
 
-out:
+  ephy_bookmark_properties_grid_check_prev_values (self);
   ephy_bookmarks_manager_save_to_file_async (self->manager, NULL, NULL, NULL);
 
   g_clear_pointer (&self->prev_name, g_free);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]