Use opath as primary identification of rooms in studio rooms list

This commit is contained in:
Nedko Arnaudov 2010-03-06 17:18:48 +02:00
parent 2fd730ea55
commit a459a2a19c
2 changed files with 7 additions and 6 deletions

View File

@ -795,7 +795,7 @@ static void ladish_studio_get_room_list(struct dbus_method_call * call_ptr)
if (!dbus_message_iter_open_container(&array_iter, DBUS_TYPE_STRUCT, NULL, &struct_iter))
goto fail_unref;
if (!dbus_message_iter_append_basic(&struct_iter, DBUS_TYPE_STRING, &name))
if (!dbus_message_iter_append_basic(&struct_iter, DBUS_TYPE_STRING, &opath))
goto fail_unref;
if (!dbus_message_iter_open_container(&struct_iter, DBUS_TYPE_ARRAY, "{sv}", &dict_iter))
@ -804,7 +804,7 @@ static void ladish_studio_get_room_list(struct dbus_method_call * call_ptr)
if (!dbus_maybe_add_dict_entry_string(&dict_iter, "template", template_name))
goto fail_unref;
if (!dbus_maybe_add_dict_entry_string(&dict_iter, "opath", opath))
if (!dbus_maybe_add_dict_entry_string(&dict_iter, "name", name))
goto fail_unref;
if (!dbus_message_iter_close_container(&struct_iter, &dict_iter))
@ -883,7 +883,7 @@ METHOD_ARGS_BEGIN(NewRoom, "New studio room")
METHOD_ARGS_END
METHOD_ARGS_BEGIN(GetRoomList, "Get list of rooms in this studio")
METHOD_ARG_DESCRIBE_OUT("room_list", "a(sa{sv})", "List of studio rooms, name and properties")
METHOD_ARG_DESCRIBE_OUT("room_list", "a(sa{sv})", "List of studio rooms: opaths and properties")
METHOD_ARGS_END
METHOD_ARGS_BEGIN(DeleteRoom, "Delete studio room")

View File

@ -260,16 +260,17 @@ def main():
print("--- studio room list")
for room in studio_iface.GetRoomList():
#print repr(room)
name = room[0]
opath = room[0]
name = room[1]["name"]
if room[1].has_key("template"):
template = str(room[1]["template"])
else:
template = None
if template:
print('"%s" from template "%s"' % (name, template))
print('"%s" from template "%s" (%s)' % (name, template, opath))
else:
print('"%s"' % name)
print('"%s" (%s)' % (name, opath))
elif arg == 'sdelroom':
print("--- studio room delete")
if index >= len(sys.argv):