diff -r 5b6a77d85cf7 -r 5cc97240e238 gmyth-upnp/src/gmyth_upnp.c --- a/gmyth-upnp/src/gmyth_upnp.c Wed May 23 21:49:19 2007 +0100 +++ b/gmyth-upnp/src/gmyth_upnp.c Thu May 24 01:26:10 2007 +0100 @@ -8,8 +8,6 @@ * * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia. * @author Rosfran Lins Borges - * - *//* * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -178,13 +176,29 @@ G_OBJECT_CLASS (gmyth_upnp_parent_class)->finalize (object); } +gchar * +gmyth_upnp_device_status_to_string( GMythUPnPDeviceStatus status ) +{ + if ( status == CgUpnpDeviceStatusAdded ) + return "Added"; + else if ( status == CgUpnpDeviceStatusUpdated ) + return "Updated"; + else if ( status == CgUpnpDeviceStatusInvalid ) + return "Invalid"; + else if ( status == CgUpnpDeviceStatusRemoved ) + return "Removed"; + + return ""; +} + /** * GObject's signal handler */ static void _mythtv_device_found( GMythUPnP *gmyth_upnp, GMythUPnPDeviceStatus status, gchar* udn ) { - g_debug( "status = %d, UDN = %s\n", status, udn ); + g_debug( "Device: [status = %s, UDN = %s]\n", + gmyth_upnp_device_status_to_string( status ), udn ); } /** @@ -250,6 +264,8 @@ gmyth_upnp->port = gmyth_uri_get_port( uri ); gmyth_upnp->protocol = gmyth_uri_get_protocol( uri ); + gmyth_debug("MythTV UPnP service [ %s, %d ].", gmyth_upnp->host, gmyth_upnp->port); + upnp_servers_list = g_list_append( upnp_servers_list, gmyth_upnp ); if ( uri != NULL )