[rygel] core: Set X_DLNACAP according to configuration
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Set X_DLNACAP according to configuration
- Date: Mon, 19 Mar 2012 18:45:16 +0000 (UTC)
commit 97191f5ae08ffdcc3fd0113691fc435519fccbc7
Author: Jens Georg <mail jensge org>
Date: Sun Mar 18 22:02:10 2012 +0100
core: Set X_DLNACAP according to configuration
https://bugzilla.gnome.org/show_bug.cgi?id=667781
src/rygel/rygel-root-device-factory.vala | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-root-device-factory.vala b/src/rygel/rygel-root-device-factory.vala
index 982ab75..bb73ee6 100644
--- a/src/rygel/rygel-root-device-factory.vala
+++ b/src/rygel/rygel-root-device-factory.vala
@@ -116,6 +116,7 @@ internal class Rygel.RootDeviceFactory {
this.set_friendly_name_and_udn (device_element,
plugin.name,
plugin.title);
+ this.set_dlnacap (device_element);
if (plugin.description != null) {
this.set_description (device_element, plugin.description);
@@ -175,6 +176,30 @@ internal class Rygel.RootDeviceFactory {
}
}
+ private void set_dlnacap (Xml.Node *device_element) {
+ var element = XMLUtils.get_element (device_element,
+ "X_DLNACAP",
+ null);
+
+ var content = "";
+ var allow_upload = true;
+ var allow_delete = false;
+
+ try {
+ allow_upload = config.get_allow_upload ();
+ allow_delete = config.get_allow_deletion ();
+ } catch (Error error) { }
+
+ if (allow_upload) {
+ content += "av-upload,image-upload,audio-upload";
+ }
+
+ if (allow_delete) {
+ content += ",create-item-with-OCM-destroy-item";
+ }
+ element->set_content (content);
+ }
+
private void set_description (Xml.Node *device_element,
string description) {
Xml.Node *element = XMLUtils.get_element (device_element,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]