summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-02-16 12:03:02 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-02-16 12:03:02 +0100
commit816babd47ffe25842f68144f9197cfef73759796 (patch)
tree50d1f36bf8a6ed4705a267fd54689da5ce860fcf
parentf431158ae2412ed23bd4d2336af00d2b5c170d31 (diff)
downloaduca-net-816babd47ffe25842f68144f9197cfef73759796.tar.gz
uca-net-816babd47ffe25842f68144f9197cfef73759796.tar.bz2
uca-net-816babd47ffe25842f68144f9197cfef73759796.tar.xz
uca-net-816babd47ffe25842f68144f9197cfef73759796.zip
Set host and connect in constructed method
-rw-r--r--uca-net-camera.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/uca-net-camera.c b/uca-net-camera.c
index 6088ef3..d755a07 100644
--- a/uca-net-camera.c
+++ b/uca-net-camera.c
@@ -233,6 +233,19 @@ ufo_net_camera_initable_init (GInitable *initable,
}
static void
+uca_net_camera_constructed (GObject *object)
+{
+ UcaNetCameraPrivate *priv;
+
+ priv = UCA_NET_CAMERA_GET_PRIVATE (object);
+
+ if (priv->host == NULL)
+ priv->host = g_strdup ("localhost");
+
+ priv->connection = g_socket_client_connect_to_host (priv->client, priv->host, 8989, NULL, &priv->construct_error);
+}
+
+static void
uca_net_camera_initable_iface_init (GInitableIface *iface)
{
iface->init = ufo_net_camera_initable_init;
@@ -246,6 +259,7 @@ uca_net_camera_class_init (UcaNetCameraClass *klass)
oclass->set_property = uca_net_camera_set_property;
oclass->get_property = uca_net_camera_get_property;
+ oclass->constructed = uca_net_camera_constructed;
oclass->dispose = uca_net_camera_dispose;
oclass->finalize = uca_net_camera_finalize;
@@ -282,11 +296,6 @@ uca_net_camera_init (UcaNetCamera *self)
priv->construct_error = NULL;
priv->client = g_socket_client_new ();
-
- if (priv->host == NULL)
- priv->host = g_strdup ("localhost");
-
- priv->connection = g_socket_client_connect_to_host (priv->client, priv->host, 8989, NULL, &priv->construct_error);
}
G_MODULE_EXPORT GType