After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 684297 - Can't retrieve all "upnp:createClass" attributes with existing gupnp_didl_lite_container APIs
Can't retrieve all "upnp:createClass" attributes with existing gupnp_didl_lit...
Status: RESOLVED FIXED
Product: gupnp-av
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-18 14:11 UTC by cguiraud
Modified: 2019-02-22 05:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for getting createClass attributes (31.92 KB, patch)
2012-09-18 14:14 UTC, cguiraud
needs-work Details | Review
v2 (31.53 KB, patch)
2012-09-21 10:16 UTC, cguiraud
committed Details | Review

Description cguiraud 2012-09-18 14:11:13 UTC
Existing gupnp_didl_lite_container_get_create_classes (...)) API doesn't allow to retrieve the "IncludeDerived" and friendlyName attributes of the "upnp:createClass" elements, the returned result is a Glist of UTF8 string representing the class name.
    
To enable the retrieval of these attributes, I propose the following change to add:

- A new GUPnPDIDLLiteCreateClasses GObject with the "upnp:createClass" properties (content, includeDerived, friendly name) and their related Getter/Setter APIs.
    
- A new GUPnPDIDLLiteContainer GObject method to get all its "upnp:createClass" elements as a GList of GUPnPDIDLLiteCreateClasses objects:
    
GList * gupnp_didl_lite_container_get_create_classes_full(
    					GUPnPDIDLLiteContainer *container);
Comment 1 cguiraud 2012-09-18 14:14:27 UTC
Created attachment 224633 [details] [review]
Patch for getting createClass attributes
Comment 2 Jens Georg 2012-09-21 07:41:34 UTC
Review of attachment 224633 [details] [review]:

- Patch has trailing whitespaces
- I think "All rights reserved." clashes with (L)GPL.

::: libgupnp-av/gupnp-didl-lite-container.c
@@ +279,3 @@
+ * @container: #GUPnPDIDLLiteContainer
+ *
+ * Gets the list of create classes of the @ocontainer.

typo: ocontainer -> container

@@ +313,3 @@
+
+                cc = gupnp_didl_lite_create_class_new_from_xml (
+        g_return_val_if_fail (GUPNP_IS_DIDL_LITE_CONTAINER (container), NULL);

Weird indent.

::: libgupnp-av/gupnp-didl-lite-createclass-private.h
@@ +31,3 @@
+G_BEGIN_DECLS
+
+GUPnPDIDLLiteCreateClass *

Please mark as G_GNUC_INTERNAL

::: libgupnp-av/gupnp-didl-lite-createclass.c
@@ +411,3 @@
+ * Creates a new #GUPnPDIDLLiteCreateClass for the @xml_node.
+ *
+ * Return value: A new #GUPnPDIDLLiteCreateClass object. Unref after usage.

Could add (transfer full) annotation, but not strictly necessary because it's internal API.

::: libgupnp-av/gupnp-didl-lite-object-private.h
@@ +36,3 @@
                                          xmlNs       *dlna_ns);
 
+GUPnPXMLDoc *

Please mark as G_GNUC_INTERNAL
Comment 3 cguiraud 2012-09-21 09:32:21 UTC
the "All rights reserved." also appears in upstream files:
<gupnp/libgupnp/gupnp-connman-manager.c>
<gupnp/libgupnp/gupnp-connman-manager.h>
I guess it should be removed from there too ?
Comment 4 Jens Georg 2012-09-21 09:39:49 UTC
Those were done by Intel and I didn't pay attention ;) Patch welcome, of course :)
Comment 5 cguiraud 2012-09-21 10:16:21 UTC
Created attachment 224915 [details] [review]
v2

I've applied changes reported by the patch V1 review.
Comment 6 Jens Georg 2012-09-24 10:36:50 UTC
Pushed slightly adapted to master