[rygel] core: Handle int list options
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Subject: [rygel] core: Handle int list options
- Date: Fri, 12 Jun 2009 12:24:50 -0400 (EDT)
commit 0314635dc88fe262fa689bccc59ba48ae5becd3f
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Thu Jun 11 23:01:21 2009 +0300
core: Handle int list options
src/rygel/rygel-cmdline-config.vala | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/rygel/rygel-cmdline-config.vala b/src/rygel/rygel-cmdline-config.vala
index 11494ed..e433184 100644
--- a/src/rygel/rygel-cmdline-config.vala
+++ b/src/rygel/rygel-cmdline-config.vala
@@ -253,7 +253,27 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration {
public Gee.ArrayList<int> get_int_list (string section,
string key)
throws GLib.Error {
- throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ ArrayList<int> value = null;
+ foreach (var option in plugin_options) {
+ var tokens = option.split (":", 3);
+ if (tokens[0] != null &&
+ tokens[1] != null &&
+ tokens[2] != null &&
+ tokens[0] == section &&
+ tokens[1] == key) {
+ value = new ArrayList<int> ();
+ foreach (var val_token in tokens[2].split (",", -1)) {
+ value.add (val_token.to_int ());
+ }
+ break;
+ }
+ }
+
+ if (value != null) {
+ return value;
+ } else {
+ throw new ConfigurationError.NO_VALUE_SET ("No value available");
+ }
}
public bool get_bool (string section,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]