From 2837514fc705de3cfb31b746457dd1baa5e47faf Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 21 Dec 2012 21:42:41 +0200 Subject: [PATCH] obexd: Implement Type transfer property --- obexd/src/manager.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/obexd/src/manager.c b/obexd/src/manager.c index 1b612e53b..f18ce57e6 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -367,6 +367,29 @@ static gboolean transfer_get_name(const GDBusPropertyTable *property, return TRUE; } +static gboolean transfer_type_exists(const GDBusPropertyTable *property, + void *data) +{ + struct obex_transfer *transfer = data; + struct obex_session *session = transfer->session; + + return session->type != NULL; +} + +static gboolean transfer_get_type(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct obex_transfer *transfer = data; + struct obex_session *session = transfer->session; + + if (session->type == NULL) + return FALSE; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &session->type); + + return TRUE; +} + static gboolean transfer_size_exists(const GDBusPropertyTable *property, void *data) { @@ -441,6 +464,7 @@ static const GDBusMethodTable transfer_methods[] = { static const GDBusPropertyTable transfer_properties[] = { { "Status", "s", transfer_get_status }, { "Name", "s", transfer_get_name, NULL, transfer_name_exists }, + { "Type", "s", transfer_get_type, NULL, transfer_type_exists }, { "Size", "t", transfer_get_size, NULL, transfer_size_exists }, { "Filename", "s", transfer_get_filename, NULL, transfer_filename_exists }, -- 2.47.3