[banshee] Code tweak in AddinView



commit a56a25d867420ddf17eb13feaa6b7f02c39d80a3
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Sun Dec 20 13:55:19 2009 -0800

    Code tweak in AddinView

 .../Banshee.Addins.Gui/AddinView.cs                |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs b/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
index 4e38c72..6e2eee8 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Addins.Gui/AddinView.cs
@@ -167,14 +167,17 @@ namespace Banshee.Addins.Gui
                 return addins;
             }
 
-            return addins.Where (a => { return
-                StringUtil.SearchKey (a.Name).Contains (search) ||
-                StringUtil.SearchKey (a.Description.Description).Contains (search) ||
-                StringUtil.SearchKey (Catalog.GetString (a.Name)).Contains (search) ||
-                StringUtil.SearchKey (Catalog.GetString (a.Description.Description)).Contains (search) ||
-                StringUtil.SearchKey (a.Description.Category).Contains (search) ||
-                StringUtil.SearchKey (Catalog.GetString (a.Description.Category)).Contains (search);
-            });
+            return addins.Where (a => a.MatchStrings ().Any (s => {
+                return StringUtil.SearchKey (s).Contains (search) ||
+                       StringUtil.SearchKey (Catalog.GetString (s)).Contains (search);
+            }));
+        }
+
+        public static IEnumerable<string> MatchStrings (this Addin a)
+        {
+            yield return a.Name;
+            yield return a.Description.Description;
+            yield return a.Description.Category;
         }
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]