Skip to content

Commit

Permalink
bugfix for searching in summary, get rid of params
Browse files Browse the repository at this point in the history
  • Loading branch information
gabi2 committed Jan 22, 2013
1 parent 8207b25 commit ee18bf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
31 changes: 9 additions & 22 deletions src/NCPkgFilterSearch.cc
Expand Up @@ -182,13 +182,7 @@ bool NCPkgFilterSearch::match( std::string s1, std::string s2, bool ignoreCase )


bool NCPkgFilterSearch::fillSearchList( std::string & expr,
bool ignoreCase,
bool checkName,
bool checkKeywords,
bool checkSummary,
bool checkDescr,
bool checkProvides,
bool checkRequires )
bool ignoreCase )
{
NCPkgTable * packageList = packager->PackageList();

Expand All @@ -200,6 +194,7 @@ bool NCPkgFilterSearch::fillSearchList( std::string & expr,
// clear the package table
packageList->itemsCleared ();

NCPkgSearchSettings *settings = packager->SearchSettings();
zypp::PoolQuery q;

switch ( searchMode->getCurrentItem() )
Expand Down Expand Up @@ -227,17 +222,17 @@ bool NCPkgFilterSearch::fillSearchList( std::string & expr,

if ( !ignoreCase )
q.setCaseSensitive();
if ( checkName )
if ( settings->doCheckName() )
q.addAttribute( zypp::sat::SolvAttr::name );
if ( checkSummary )
if ( settings->doCheckSummary() )
q.addAttribute( zypp::sat::SolvAttr::summary );
if ( checkKeywords )
if ( settings->doCheckKeywords() )
q.addAttribute( zypp::sat::SolvAttr::keywords );
if ( checkDescr )
if ( settings->doCheckDescr() )
q.addAttribute( zypp::sat::SolvAttr::description );
if ( checkProvides )
if ( settings->doCheckProvides() )
q.addAttribute( zypp::sat::SolvAttr::provides );
if ( checkRequires )
if ( settings->doCheckRequires() )
// attribute SolvAttr::requires means "required by"
q.addAttribute( zypp::sat::SolvAttr::requires );

Expand Down Expand Up @@ -306,20 +301,12 @@ bool NCPkgFilterSearch::fillSearchList( std::string & expr,
//
bool NCPkgFilterSearch::showSearchResultPackages()
{
NCPkgSearchSettings *settings = packager->SearchSettings();
std::string filter = getSearchExpression();

if ( !packager->isYouMode() )
{
// fill the package list with packages matching the search expression
fillSearchList( filter, getCheckBoxValue( ignoreCase ),
settings->doCheckName(),
settings->doCheckSummary(),
settings->doCheckKeywords(),
settings->doCheckDescr(),
settings->doCheckProvides(),
settings->doCheckRequires()
);
fillSearchList( filter, getCheckBoxValue( ignoreCase ) );
}

return true;
Expand Down
10 changes: 2 additions & 8 deletions src/NCPkgFilterSearch.h
Expand Up @@ -101,14 +101,8 @@ class NCPkgFilterSearch : public NCLayoutBox {
virtual bool showSearchResultPackages();

bool match ( std::string s1, std::string s2, bool ignoreCase );
bool fillSearchList( std::string & expr,
bool ignoreCase,
bool checkName,
bool checkKeywords,
bool checkSummary,
bool checkDescr,
bool checkProvides,
bool checkRequires );

bool fillSearchList( std::string & expr, bool ignoreCase );

NCInputField * getSearchField() { return searchExpr; }

Expand Down

0 comments on commit ee18bf8

Please sign in to comment.