Add hooks for saving and loading service details
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 23 Apr 2009 15:33:22 +0000 (16:33 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 23 Apr 2009 15:33:22 +0000 (16:33 +0100)
src/service.c

index 2b60783..9522294 100644 (file)
@@ -274,6 +274,8 @@ static DBusMessage *set_property(DBusConnection *conn,
                if (service->network != NULL)
                        connman_network_set_string(service->network,
                                "WiFi.Passphrase", service->passphrase);
+
+               __connman_storage_save_service(service);
        }
 
        return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
@@ -373,6 +375,8 @@ static DBusMessage *remove_service(DBusConnection *conn,
 
        connman_service_set_favorite(service, FALSE);
 
+       __connman_storage_save_service(service);
+
        return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 }
 
@@ -689,6 +693,8 @@ struct connman_service *connman_service_get(const char *identifier)
 
        service->identifier = g_strdup(identifier);
 
+       __connman_storage_load_service(service);
+
        iter = g_sequence_insert_sorted(service_list, service,
                                                service_compare, NULL);