Commit 6785ea56 authored by Zeeshan Ali (Khattak)'s avatar Zeeshan Ali (Khattak)

Use g_object_new to create GUPnPContext objects

Use g_object_new() to create GUPnPContext objects so we can pass in
constructor props not part of gupnp_context_new().
parent aa8dad5a
......@@ -141,7 +141,12 @@ create_loopback_context (gpointer data)
"port", &port,
NULL);
context = gupnp_context_new (main_context, LOOPBACK_IP, port, &error);
context = g_object_new (GUPNP_TYPE_CONTEXT,
"main-context", main_context,
"host-ip", LOOPBACK_IP,
"port", port,
"error", &error,
NULL);
if (error) {
g_warning ("Error creating GUPnP context: %s\n",
error->message);
......@@ -177,10 +182,12 @@ create_context_for_device (NMDevice *nm_device,
"port", &port,
NULL);
nm_device->context = gupnp_context_new (main_context,
ip4_str,
port,
&error);
nm_device->context = g_object_new (GUPNP_TYPE_CONTEXT,
"main-context", main_context,
"host-ip", ip4_str,
"port", port,
"error", &error,
NULL);
if (error) {
g_warning ("Error creating GUPnP context: %s\n",
error->message);
......
......@@ -107,10 +107,12 @@ create_and_signal_context (GUPnPUnixContextManager *manager,
NULL);
error = NULL;
context = gupnp_context_new (main_context,
host_ip,
port,
&error);
context = g_object_new (GUPNP_TYPE_CONTEXT,
"main-context", main_context,
"host-ip", host_ip,
"port", port,
"error", &error,
NULL);
if (error != NULL) {
g_warning ("Failed to create context for host/IP '%s': %s\n",
host_ip,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment