[epiphany/wip/google-safe-browsing: 26/27] gsb-service: Add update-finished signal



commit 4a72e243f4d57158cb0af8a7dc1e1970d14c9aef
Author: Gabriel Ivascu <gabrielivascu gnome org>
Date:   Tue Sep 26 20:43:31 2017 +0300

    gsb-service: Add update-finished signal

 lib/safe-browsing/ephy-gsb-service.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/lib/safe-browsing/ephy-gsb-service.c b/lib/safe-browsing/ephy-gsb-service.c
index ae96c28..c2435ab 100644
--- a/lib/safe-browsing/ephy-gsb-service.c
+++ b/lib/safe-browsing/ephy-gsb-service.c
@@ -65,6 +65,13 @@ enum {
 
 static GParamSpec *obj_properties[LAST_PROP];
 
+enum {
+  UPDATE_FINISHED,
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+
 static gboolean ephy_gsb_service_update (EphyGSBService *self);
 
 typedef struct {
@@ -326,6 +333,7 @@ ephy_gsb_service_update_finished_cb (EphyGSBService *self,
                                      gpointer        user_data)
 {
   self->is_updating = FALSE;
+  g_signal_emit (self, signals[UPDATE_FINISHED], 0);
   ephy_gsb_service_schedule_update (self);
 }
 
@@ -506,6 +514,13 @@ ephy_gsb_service_class_init (EphyGSBServiceClass *klass)
                          G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
   g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
+
+  signals[UPDATE_FINISHED] =
+    g_signal_new ("update-finished",
+                  EPHY_TYPE_GSB_SERVICE,
+                  G_SIGNAL_RUN_LAST,
+                  0, NULL, NULL, NULL,
+                  G_TYPE_NONE, 0);
 }
 
 EphyGSBService *


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