Exemplo n.º 1
0
void
target_cds_found (GUPnPServiceProxy *target_cds_proxy)
{
        cds_proxy = target_cds_proxy;

        if (dest_container != NULL) {
                container_found (dest_container);
        } else {
                /* Find a suitable container */
                search_container (target_cds_proxy);
        }
}
Exemplo n.º 2
0
static void
browse_cb (GUPnPServiceProxy       *cds_proxy,
           GUPnPServiceProxyAction *action,
           gpointer                 user_data)
{
        GError *error;
        char *result;
        char *container_id;

        error = NULL;
        if (!gupnp_service_proxy_end_action (cds_proxy,
                                             action,
                                             &error,
                                             "Result",
                                                G_TYPE_STRING,
                                                &result,
                                             NULL)) {
                g_critical ("Failed to browse root container: %s",
                            error->message);

                g_error_free (error);

                application_exit ();

                return;
        }

        g_assert (result != NULL);

        container_id = parse_result (result);
        if (container_id == NULL) {
                g_critical ("Failed to find a suitable container for upload.");
                g_free (result);

                application_exit ();

                return;
        } else {
                container_found (container_id);
                g_free (container_id);
        }

        g_free (result);
}