summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-12 14:40:39 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-12 14:40:39 (EDT)
commit4830a1e90c1a66c63d6fb5974382ace2f31dbe44 (patch)
treeccde60b0242cb31d0f400c0ad8972bff4dc9d696 /src
parent76e79c399f9f94f401e9021b1f8780f2d625400d (diff)
downloadmarquee-4830a1e90c1a66c63d6fb5974382ace2f31dbe44.zip
marquee-4830a1e90c1a66c63d6fb5974382ace2f31dbe44.tar.gz
marquee-4830a1e90c1a66c63d6fb5974382ace2f31dbe44.tar.bz2
MqFindToolbar: Move WebKitFindController setup to constructed
Diffstat (limited to 'src')
-rw-r--r--src/find-toolbar.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/find-toolbar.c b/src/find-toolbar.c
index 31b5bc4..e0cbd54 100644
--- a/src/find-toolbar.c
+++ b/src/find-toolbar.c
@@ -212,10 +212,31 @@ failed_to_find_text_cb(WebKitFindController G_GNUC_UNUSED *find_controller,
}
static void
+constructed(GObject *object)
+{
+ 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));
+ 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",
+ G_CALLBACK(failed_to_find_text_cb), find_toolbar);
+}
+
+static void
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;
@@ -300,12 +321,6 @@ mq_find_toolbar_init(MqFindToolbar *find_toolbar)
find_toolbar->match_case = FALSE;
find_toolbar->searching = FALSE;
- find_toolbar->find_controller = webkit_web_view_get_find_controller(
- WEBKIT_WEB_VIEW(find_toolbar->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",
- G_CALLBACK(failed_to_find_text_cb), find_toolbar);
}
GtkWidget *