Re: [gupnp] boolean properties in DIDL-Lite



Hi,

On Thu, 2009-04-09 at 15:35 +0300, Zeeshan Ali (Khattak) wrote:
> On Thu, Apr 9, 2009 at 3:13 PM, Sven Neumann <s neumann phase-zero de> wrote:
> > If you agree that this should be changed, I can provide a patch.
> 
>   Yup, nice catch. :) Please do.

Ok, here we go...


Sven

>From 4e2a57f1a8bd02a4e2294e1ca00e4c812c30f3c3 Mon Sep 17 00:00:00 2001
From: Sven Neumann <s neumann phase-zero de>
Date: Thu, 9 Apr 2009 14:56:32 +0200
Subject: [PATCH] use '1' and '0' to express boolean properties in DIDL-Lite XML

---
 libgupnp-av/gupnp-didl-lite-writer.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libgupnp-av/gupnp-didl-lite-writer.c b/libgupnp-av/gupnp-didl-lite-writer.c
index 21721bd..22a6342 100644
--- a/libgupnp-av/gupnp-didl-lite-writer.c
+++ b/libgupnp-av/gupnp-didl-lite-writer.c
@@ -233,9 +233,9 @@ gupnp_didl_lite_writer_start_container (GUPnPDIDLLiteWriter *writer,
         }
 
         g_string_append (writer->priv->str, "\" restricted=\"");
-        g_string_append (writer->priv->str, restricted ? "true" : "false");
+        g_string_append_c (writer->priv->str, restricted ? '1' : '0');
         g_string_append (writer->priv->str, "\" searchable=\"");
-        g_string_append (writer->priv->str, searchable ? "true" : "false");
+        g_string_append_c (writer->priv->str, searchable ? '1' : '0');
         g_string_append (writer->priv->str, "\">");
 }
 
@@ -296,7 +296,7 @@ gupnp_didl_lite_writer_start_item (GUPnPDIDLLiteWriter *writer,
         }
 
         g_string_append (writer->priv->str, "\" restricted=\"");
-        g_string_append (writer->priv->str, restricted ? "true" : "false");
+        g_string_append_c (writer->priv->str, restricted ? '1' : '0');
         g_string_append (writer->priv->str, "\">");
 }
 
@@ -753,7 +753,7 @@ gupnp_didl_lite_writer_add_boolean (GUPnPDIDLLiteWriter *writer,
 
         begin_property_simple (writer, property, prefix, ns_uri);
 
-        g_string_append (writer->priv->str, value ? "true" : "false");
+        g_string_append_c (writer->priv->str, value ? '1' : '0');
 
         end_property (writer, property, prefix);
 }
-- 
1.5.6.3



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]