diff src/changesetitem.cpp @ 566:1e76d1009167

Show matching branch names in search results as well as matching on comment
author Chris Cannam
date Wed, 29 Feb 2012 10:44:34 +0000
parents 533519ebc0cb
children 641ccce7c771
line wrap: on
line diff
--- a/src/changesetitem.cpp	Wed Feb 29 10:38:28 2012 +0000
+++ b/src/changesetitem.cpp	Wed Feb 29 10:44:34 2012 +0000
@@ -92,11 +92,18 @@
 }    
 
 bool
-ChangesetItem::setSearchText(QString text)
+ChangesetItem::matchSearchText(QString text)
 {
     m_searchText = text;
-    m_searchMatches = (m_changeset->comment().contains
-                       (text, Qt::CaseInsensitive));
+    m_searchMatches = false;
+    if (m_showBranch) {
+        m_searchMatches = (m_changeset->branch().contains
+                           (text, Qt::CaseInsensitive));
+    }
+    if (!m_searchMatches) {
+        m_searchMatches = (m_changeset->comment().contains
+                           (text, Qt::CaseInsensitive));
+    }
     return m_searchMatches;
 }