Implement inSet in beagle xesam adaptor
"Anders Rune Jensen" <[email protected]>
| Newsgroups | gmane.comp.gnome.dashboard.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi With the new libbeagle interface he is a patch that implements the missing inSet keyword in the Xesam interface. -- Anders Rune Jensen http://people.iola.dk/anders/ _______________________________________________ Dashboard-hackers mailing list [email protected] http://mail.gnome.org/mailman/listinfo/dashboard-hackers
inset-beagle-xesam.diff
(text/x-patch, 1.1 KB)
Index: src/Parser.cs
===================================================================
--- src/Parser.cs (revision 4279)
+++ src/Parser.cs (working copy)
@@ -70,6 +70,7 @@
return q;
}
+
private static string ParseXesamCollectible(XPathNavigator nav, CollectibleType col)
{
// Got XPathNavigator:
@@ -107,7 +108,20 @@
nav.MoveToParent();
break;
case "inSet":
- Console.Error.WriteLine("TBD: {0}", nav.Name);
+ nav.MoveToFirstChild();
+
+ string name = ParseXesamField(nav);
+
+ bool first = false;
+ while (nav.MoveToNext()) {
+ if (!first)
+ first = true;
+ else
+ q += " or ";
+ q += name + ":" + nav.Value;
+ }
+
+ nav.MoveToParent();
break;
case "contains":
goto case "equals";
@@ -156,7 +170,7 @@
return q;
}
- public static string ParseXesamQuery(string xmlQuery)
+ public static string ParseXesamQuery(string xmlQuery)
{
XmlTextReader tReader = new XmlTextReader(new System.IO.StringReader(xmlQuery));