Permalink
Browse files

Fix g_key_file_set_list_separator binding

Test now passes, and setting ListSeparator doesn't break lists.
  • Loading branch information...
1 parent dd0fe5a commit db21571d4209529a430fb5a312893a35be4e13ff @lamalex lamalex committed Aug 18, 2010
Showing with 11 additions and 1 deletion.
  1. +9 −0 GKeyFile/GKeyFile.custom
  2. +1 −0 GKeyFile/GKeyFile.metadata
  3. +1 −1 GKeyFile/Tests/src/GKeyFileTests.cs
View
@@ -125,3 +125,12 @@
GLib.Marshaller.Free (raw_ret);
return ret;
}
+
+ [DllImport("libglib-2.0.dll")]
+ static extern void g_key_file_set_list_separator(IntPtr raw, byte separator);
+
+ public char ListSeparator {
+ set {
+ g_key_file_set_list_separator(Handle, (byte) value);
+ }
+ }
@@ -15,6 +15,7 @@
<attr path="/api/namespace/struct[@cname='GKeyFile']/method[@cname='g_key_file_get_boolean_list']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GKeyFile']/method[@cname='g_key_file_get_integer_list']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GKeyFile']/method[@cname='g_key_file_get_double_list']" name="hidden">1</attr>
+ <attr path="/api/namespace/struct[@cname='GKeyFile']/method[@cname='g_key_file_set_list_separator']" name="hidden">1</attr>
<attr path="/api/namespace/struct[@cname='GKeyFile']/method[@cname='g_key_file_load_from_dirs']/parameters/parameter[@name='search_dirs']" name="type">GStrv</attr>
@@ -110,7 +110,7 @@ public void GetNonstandardSeperatorStringList ()
{
GKeyFile keyFile = new GKeyFile (test_file_name);
string [] expected = new string [] { "one one", "two", "threee", "for" };
- keyFile.ListSeparator = ":";
+ keyFile.ListSeparator = ':';
CollectionAssert.AreEqual (expected, keyFile.GetStringList ("Group1", "NonSemicolonStringList"));
}

0 comments on commit db21571

Please sign in to comment.