static void __netconfig_network_notify_result(const char *sig_name, const char *key)
{
- gboolean reply;
+ GVariantBuilder *builder;
GVariant *params;
- GVariantBuilder *builder = NULL;
- GDBusConnection *connection = NULL;
- GError *error = NULL;
- const char *prop_key = "key";
INFO("[Signal] %s %s", sig_name, key);
- connection = netdbus_get_connection();
- if (connection == NULL) {
- ERR("Failed to get GDBus Connection");
- return;
- }
-
builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(builder, "{sv}", prop_key, g_variant_new_string(key));
- params = g_variant_new("(@a{sv})", g_variant_builder_end(builder));
+ g_variant_builder_add(builder, "{sv}", "key", g_variant_new_string(key));
+ params = g_variant_new("(@a{sv})", g_variant_builder_end(builder));
g_variant_builder_unref(builder);
- reply = g_dbus_connection_emit_signal(connection,
- NULL,
- NETCONFIG_NETWORK_PATH,
- NETCONFIG_NETWORK_INTERFACE,
- sig_name,
- params,
- &error);
-
- if (reply != TRUE) {
- if (error != NULL) {
- ERR("Failed to send signal [%s]", error->message);
- g_error_free(error);
- }
- return;
- }
+ netconfig_dbus_emit_signal(NULL,
+ NETCONFIG_NETWORK_PATH,
+ NETCONFIG_NETWORK_INTERFACE,
+ sig_name,
+ params);
- INFO("Sent signal (%s), key (%s)", sig_name, key);
return;
}