[meld/VersionControlRework: 75/123] tree: Python-ify the treeview search callback string handling



commit b4a8decc4768b5d1df719ed8ad7756a7ba0242e7
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue Mar 31 08:30:01 2015 +1000

    tree: Python-ify the treeview search callback string handling

 meld/tree.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/meld/tree.py b/meld/tree.py
index fbd1ee7..8bcb5ff 100644
--- a/meld/tree.py
+++ b/meld/tree.py
@@ -236,14 +236,14 @@ class DiffTreeStore(Gtk.TreeStore):
         # If the key contains a path separator, search the whole path,
         # otherwise just use the filename. If the key is all lower-case, do a
         # case-insensitive match.
-        abs_search = key.find('/') >= 0
+        abs_search = '/' in key
         lower_key = key.islower()
 
         for path in model.value_paths(it):
             if not path:
                 continue
-            lineText = path if abs_search else os.path.basename(path)
-            lineText = lineText.lower() if lower_key else lineText
-            if lineText.find(key) != -1:
+            text = path if abs_search else os.path.basename(path)
+            text = text.lower() if lower_key else text
+            if key in text:
                 return False
         return True


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