X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fclock.c;h=e2cc19faf2eff050f70b7dcdf2447a45dacd8696;hb=8a494c57ceba6c98ff89a4af2e50f32b8ad85cf5;hp=adb18869f4b57006a60786ab28f53b75daa08364;hpb=7a1a8e658bf3fcba09efbb842fdf6c739a5cea67;p=framework%2Fconnectivity%2Fconnman.git diff --git a/src/clock.c b/src/clock.c index adb1886..e2cc19f 100644 --- a/src/clock.c +++ b/src/clock.c @@ -2,7 +2,7 @@ * * Connection Manager * - * Copyright (C) 2007-2010 Intel Corporation. All rights reserved. + * Copyright (C) 2007-2012 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -271,11 +271,15 @@ static DBusMessage *set_property(DBusConnection *conn, while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING) { const char *val; + GSList *new_head; dbus_message_iter_get_basic(&entry, &val); - list = g_slist_prepend(list, strdup(val)); - count++; + new_head = __connman_timeserver_add_list(list, val); + if (list != new_head) { + count++; + list = new_head; + } dbus_message_iter_next(&entry); } @@ -304,14 +308,19 @@ static DBusMessage *set_property(DBusConnection *conn, return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } -static GDBusMethodTable clock_methods[] = { - { "GetProperties", "", "a{sv}", get_properties }, - { "SetProperty", "sv", "", set_property }, +static const GDBusMethodTable clock_methods[] = { + { GDBUS_METHOD("GetProperties", + NULL, GDBUS_ARGS({ "properties", "a{sv}" }), + get_properties) }, + { GDBUS_METHOD("SetProperty", + GDBUS_ARGS({ "name", "s" }, { "value", "v" }), NULL, + set_property) }, { }, }; -static GDBusSignalTable clock_signals[] = { - { "PropertyChanged", "sv" }, +static const GDBusSignalTable clock_signals[] = { + { GDBUS_SIGNAL("PropertyChanged", + GDBUS_ARGS({ "name", "s" }, { "value", "v" })) }, { }, };