Send signal when service name changes
authorKalle Valo <kalle.valo@canonical.com>
Fri, 11 Jun 2010 13:29:59 +0000 (16:29 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 14 Jun 2010 20:57:04 +0000 (22:57 +0200)
Needed for operator name changes in ofono.

src/service.c

index 4ddf6c0..4d0afc5 100644 (file)
@@ -2874,6 +2874,7 @@ void __connman_service_update_from_network(struct connman_network *network)
        connman_uint8_t strength, value;
        connman_bool_t roaming;
        GSequenceIter *iter;
+       const char *name;
 
        DBG("network %p", network);
 
@@ -2884,6 +2885,15 @@ void __connman_service_update_from_network(struct connman_network *network)
        if (service->network == NULL)
                return;
 
+       name = connman_network_get_string(service->network, "Name");
+       if (g_strcmp0(service->name, name) != 0) {
+               g_free(service->name);
+               service->name = g_strdup(name);
+               connman_dbus_property_changed_basic(service->path,
+                               CONNMAN_SERVICE_INTERFACE, "Name",
+                               DBUS_TYPE_STRING, &service->name);
+       }
+
        strength = connman_network_get_uint8(service->network, "Strength");
        if (strength == service->strength)
                goto roaming;