#6368 NORM 8.2.0 (: Accidently entering a space character in the search field hides all journal entries

Zarro Boogs per Child bugtracker at laptop.org
Wed Jul 2 13:41:26 EDT 2008


#6368: Accidently entering a space character in the search field hides all journal
entries
--------------------------------+-------------------------------------------
   Reporter:  garycmartin       |       Owner:  tomeu                            
       Type:  defect            |      Status:  new                              
   Priority:  normal            |   Milestone:  8.2.0 (was Update.2)             
  Component:  journal-activity  |     Version:  Development build as of this date
 Resolution:                    |    Keywords:  8.2.0:? r+                       
Next_action:  code              |    Verified:  0                                
  Blockedby:                    |    Blocking:                                   
--------------------------------+-------------------------------------------
Changes (by erikos):

  * keywords:  8.2.0:? r? => 8.2.0:? r+


Comment:

 You only need to check once for the string to be empty. This works fine
 for me. r+ otherwise

 {{{
 --- a/journaltoolbox.py
 +++ b/journaltoolbox.py
 @@ -171,17 +171,21 @@ class SearchToolbar(gtk.Toolbar):
              date_from, date_to = self._get_date_range()
              query['mtime'] = {'start': date_from, 'end': date_to}
          if self._search_entry.props.text:
 -            text = self._search_entry.props.text.strip()
 +            text = self._search_entry.props.text.strip(' ')

              if not text.startswith('"'):
                  query_text = ''
                  words = text.split(' ')
                  for word in words:
 -                    query_text += word.strip() + '* '
 +                    if word:
 +                        if query_text:
 +                            query_text += ' '
 +                        query_text += word + '*'
              else:
                  query_text = text

 -            query['query'] = query_text
 +            if query_text:
 +                query['query'] = query_text

          return query
 }}}

-- 
Ticket URL: <http://dev.laptop.org/ticket/6368#comment:7>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list