diff options
-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; |