Avanced search in "Any Clause" mode: directory filter would not filter but add an ORed clause! Fixes issue #269

This commit is contained in:
Jean-Francois Dockes 2015-09-28 10:00:32 +02:00
parent 0183b8cbb8
commit 3c9248d28a
2 changed files with 18 additions and 3 deletions

View file

@ -424,9 +424,20 @@ void AdvSearch::runSearch()
if (!subtreeCMB->currentText().isEmpty()) {
QString current = subtreeCMB->currentText();
sdata->addClause(new Rcl::SearchDataClausePath(
(const char*)current.toLocal8Bit(),
direxclCB->isChecked()));
Rcl::SearchDataClausePath *pathclause =
new Rcl::SearchDataClausePath((const char*)current.toLocal8Bit(),
direxclCB->isChecked());
if (sdata->getTp() == SCLT_AND) {
sdata->addClause(pathclause);
} else {
STD_SHARED_PTR<SearchData>
nsdata(new SearchData(SCLT_AND, stemLang));
nsdata->addClause(new Rcl::SearchDataClauseSub(sdata));
nsdata->addClause(pathclause);
sdata = nsdata;
}
// Keep history clean and sorted. Maybe there would be a
// simpler way to do this
list<QString> entries;

View file

@ -150,6 +150,10 @@ public:
m_tp = tp;
}
SClType getTp() {
return m_tp;
}
void setMaxExpand(int max)
{
m_softmaxexpand = max;