banshee r4213 - in trunk/banshee: . src/Libraries/Hyena/Hyena.Query
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4213 - in trunk/banshee: . src/Libraries/Hyena/Hyena.Query
- Date: Tue, 15 Jul 2008 12:48:39 +0000 (UTC)
Author: gburt
Date: Tue Jul 15 12:48:39 2008
New Revision: 4213
URL: http://svn.gnome.org/viewvc/banshee?rev=4213&view=rev
Log:
2008-07-15 Gabriel Burt <gabriel burt gmail com>
* src/Libraries/Hyena/Hyena.Query/UserQueryParser.cs: Patch from Michael
Kaiser fixing issue with parsing user queries starting with a "-" (BGO
#538203). Fixes the two broken query parsing unit tests.
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Libraries/Hyena/Hyena.Query/UserQueryParser.cs
Modified: trunk/banshee/src/Libraries/Hyena/Hyena.Query/UserQueryParser.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.Query/UserQueryParser.cs (original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.Query/UserQueryParser.cs Tue Jul 15 12:48:39 2008
@@ -136,17 +136,20 @@
// Only push a node if the current_parent is not the same as this token
if (current_parent.Keyword == Keyword.Not ||
current_parent.Keyword == (token.ID == TokenID.Or ? Keyword.And : Keyword.Or)) {
+
QueryListNode list = new QueryListNode (token.ID == TokenID.Or ? Keyword.Or : Keyword.And);
QueryListNode p = current_parent.Parent;
+
if (p != null) {
current_parent.Parent.RemoveChild (current_parent);
}
- if (current_parent.ChildCount <= 1) {
- list.TakeChildren (current_parent);
- } else {
+ if (current_parent.Keyword == Keyword.Not || current_parent.ChildCount > 1) {
list.AddChild (current_parent);
+ } else {
+ list.TakeChildren (current_parent);
}
+
current_parent = p;
NodePush (list);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]