[rygel] Can't use 'foreach' on strv from dynamic dbus calls
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Subject: [rygel] Can't use 'foreach' on strv from dynamic dbus calls
- Date: Mon, 11 May 2009 18:35:39 -0400 (EDT)
commit d085cd621b172c89874d2089e97b34369df03fe9
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Tue May 12 01:27:23 2009 +0300
Can't use 'foreach' on strv from dynamic dbus calls
Sizes of arrays returned by dynamic dbus calls are uknown, hence we
can't iterate over them using 'foreach' loop.
---
src/plugins/external/rygel-external-item.vala | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/plugins/external/rygel-external-item.vala b/src/plugins/external/rygel-external-item.vala
index 055270d..d57d34f 100644
--- a/src/plugins/external/rygel-external-item.vala
+++ b/src/plugins/external/rygel-external-item.vala
@@ -70,8 +70,9 @@ public class Rygel.ExternalItem : MediaItem {
props.Get (ITEM_IFACE, "urls", out value);
weak string[] uris = (string[]) value.get_boxed ();
- foreach (var uri in uris) {
- var tmp = uri.replace ("://@HOSTNAME@", parent.host_ip);
+ for (var i = 0; uris[i] != null; i++) {
+ var tmp = uris[i].replace ("://@HOSTNAME@", parent.host_ip);
+
this.uris.add (tmp);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]