~jibel/synaptic/bugs.309906.385739.403165

« back to all changes in this revision

Viewing changes to gtk/rgmainwindow.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-09-22 15:57:58 UTC
  • Revision ID: james.westby@ubuntu.com-20080922155758-gvuvtlz618753x61
Tags: 0.62.1ubuntu9
* gtk/rgmainwindow.cc:
  - only xapian search when more than one char is used
    in the search querry (LP: #260739)
* common/rpackagelister.{cc,h}:
  - expand partial strings in search as you type so that
    "ged" finds "gedit" (LP: #261423)
* 10_ubuntu_maintenance_gui.dpatch:
  - make sure to look only for immutable release files
    when calculating the support time

Show diffs side-by-side

added added

removed removed

Lines of Context:
298
298
               setAdjustment);
299
299
 
300
300
   const gchar *str = gtk_entry_get_text(GTK_ENTRY(_entry_fast_search));
301
 
   if(str != NULL && strlen(str) > 0) {
 
301
   if(str != NULL && strlen(str) > 1) {
302
302
      if(_config->FindB("Debug::Synaptic::View",false))
303
303
         cerr << "RGMainWindow::refreshTable: rerun limitBySearch" << endl;
304
304
      _lister->limitBySearch(str);
1116
1116
                "fixed_height_mode", TRUE,
1117
1117
                NULL);
1118
1118
 
 
1119
   // we need to set a empty model first so that gtklistview
 
1120
   // can do its cleanup, if we do not do that, then the cleanup
 
1121
   // code in gtktreeview gets confused and throws
 
1122
   // Gtk-CRITICAL **: gtk_tree_view_unref_tree_helper: assertion `node != NULL' failed
 
1123
   // at us, see LP: #38397 for more information
 
1124
   gtk_tree_view_set_model(GTK_TREE_VIEW(_treeView), NULL);
1119
1125
   _pkgList = GTK_TREE_MODEL(gtk_pkg_list_new(_lister));
1120
1126
   gtk_tree_view_set_model(GTK_TREE_VIEW(_treeView), _pkgList);
1121
1127
   gtk_tree_view_set_search_column(GTK_TREE_VIEW(_treeView), NAME_COLUMN);
2879
2885
{
2880
2886
   RGMainWindow *me = (RGMainWindow *) data;
2881
2887
   const gchar *str = gtk_entry_get_text(GTK_ENTRY(me->_entry_fast_search));
 
2888
 
2882
2889
   me->_fastSearchEventID = -1;
2883
 
 
 
2890
   me->setBusyCursor(true);
 
2891
   RGFlushInterface();
2884
2892
   if(str == NULL || strlen(str) < 1) {
 
2893
      // if the user has cleared the search, refresh the view
2885
2894
      me->_lister->reapplyFilter();
2886
2895
      me->refreshTable();
2887
 
      return FALSE;
 
2896
 
 
2897
      me->setBusyCursor(false);
 
2898
   } else if(strlen(str) > 1) {
 
2899
      // only search when there is more than one char entered, single
 
2900
      // char searches tend to be very slow
 
2901
      me->setBusyCursor(true);
 
2902
      RGFlushInterface();
 
2903
      me->refreshTable();
2888
2904
   }
 
2905
   me->setBusyCursor(false);
2889
2906
 
2890
 
   me->_lister->limitBySearch(str);
2891
 
   me->_lister->limitBySearch(str);
2892
 
   me->refreshTable();
2893
2907
   return FALSE;
2894
2908
}
2895
2909