diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-13 00:28:18 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-13 00:28:18 (EDT) |
commit | 30cd0c6825f204dd3bb20cf92fcf045f9044e9fd (patch) | |
tree | 45278ec5bc605b011704a30c55f90329ee41ac26 /src | |
parent | f4faadcbd076b053ae9d1b4fddef35f5115c85ca (diff) | |
download | marquee-30cd0c6825f204dd3bb20cf92fcf045f9044e9fd.zip marquee-30cd0c6825f204dd3bb20cf92fcf045f9044e9fd.tar.gz marquee-30cd0c6825f204dd3bb20cf92fcf045f9044e9fd.tar.bz2 |
MqFindToolbar: Get find controller on property setting
We don't need a constructed method for this.
Diffstat (limited to 'src')
-rw-r--r-- | src/find-toolbar.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/find-toolbar.c b/src/find-toolbar.c index 3d3616c..22982fa 100644 --- a/src/find-toolbar.c +++ b/src/find-toolbar.c @@ -28,7 +28,6 @@ struct _MqFindToolbar { GtkRevealer parent_instance; - MqWebView *web_view; GtkWidget *search_entry; GtkWidget *matches_label; gboolean match_case; @@ -174,19 +173,10 @@ failed_to_find_text_cb(WebKitFindController G_GNUC_UNUSED *find_controller, } static void -constructed(GObject *object) +set_web_view(MqFindToolbar *find_toolbar, MqWebView *web_view) { - MqFindToolbar *find_toolbar; - - if (G_OBJECT_CLASS(mq_find_toolbar_parent_class)->constructed) { - G_OBJECT_CLASS(mq_find_toolbar_parent_class)->constructed( - object); - } - - find_toolbar = MQ_FIND_TOOLBAR(object); - find_toolbar->find_controller = webkit_web_view_get_find_controller( - WEBKIT_WEB_VIEW(find_toolbar->web_view)); + WEBKIT_WEB_VIEW(web_view)); g_signal_connect(find_toolbar->find_controller, "found-text", G_CALLBACK(found_text_cb), find_toolbar); g_signal_connect(find_toolbar->find_controller, "failed-to-find-text", @@ -197,13 +187,9 @@ static void get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { - MqFindToolbar *find_toolbar; - - find_toolbar = MQ_FIND_TOOLBAR(object); - switch (property_id) { case PROP_WEB_VIEW: - g_value_set_object(value, find_toolbar->web_view); + g_value_set_object(value, NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, @@ -222,7 +208,7 @@ set_property(GObject *object, guint property_id, const GValue *value, switch (property_id) { case PROP_WEB_VIEW: - find_toolbar->web_view = g_value_get_object(value); + set_web_view(find_toolbar, g_value_get_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, @@ -236,7 +222,6 @@ mq_find_toolbar_class_init(MqFindToolbarClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); - object_class->constructed = constructed; object_class->get_property = get_property; object_class->set_property = set_property; |