Logo Search packages:      
Sourcecode: packagesearch version File versions

void NPlugin::DebtagsPlugin::evaluateSearch (  )  [protected, slot]

This evaluates the current search

Todo:
fix the Expression Filter (hopefully Enrico will make it a template)

Definition at line 222 of file debtagsplugin.cpp.

References _container, _isInactive, _pProvider, _searchResult, NPlugin::DebtagsPluginContainer::collection(), createSearchExpression(), NPlugin::IProvider::reportBusy(), and NPlugin::IProvider::reportReady().

Referenced by init().

{
      _pProvider->reportBusy(this, tr("Performing full text search on Package Database"));
//    statusBar()->message(tr("Searching Package Database for tags"));
      _searchResult.clear();
      string expression = createSearchExpression();
      if (expression.empty()) // if nothing is selected, do not show anything
      {
            _isInactive = true;
      }
      else
      {
            _isInactive = false;
            if (_pTagsDisplay->_pExcludeTagsView->count()!=0)     // if we want to exclude some tags
            {
                  // send the package collection through the filter into the result
                  // and than copy the result to the _searchResult
                  Tagcoll::FilterChain<int, string> filters;
                  #warning this must be fixed!!
                  #warning this must be fixed!!
                  #warning this must be fixed!!
                  /// @todo fix the Expression Filter (hopefully Enrico will make it a template)
/*                Tagcoll::ExpressionFilter filter;
                  if ( !filter.setExpression(expression) )  // no error should occur!
                        cerr << "Programmers error please report to bensmail@gmx.net: Error in tag expression "
                              << endl;
                  filters.appendFilter(&filter);
                  Tagcoll::TagCollection result;
                  filters.setConsumer(&result);
                  _container.collection()->output(filters);
                  _searchResult = result.getAllItems();*/
            }
            else  // do not use TagcollFilter
            {
                  QListBox* pIncludeTagsView = _pTagsDisplay->_pIncludeTagsView;
                  Tagcoll::OpSet<string> ts;
                  for (uint i = 0; i < pIncludeTagsView->count(); ++i)
                  {
                        ts.insert( toString(pIncludeTagsView->text(i)) );
                  }
                  _searchResult = _container.collection()->getCompanionItems(ts);
            }
      }
      _pProvider->reportReady(this);
      emit searchChanged(this);
}


Generated by  Doxygen 1.6.0   Back to index