added conjunction choice in advsearch

This commit is contained in:
dockes 2006-11-14 17:56:40 +00:00
parent 9c68941431
commit 4dff7f2614
2 changed files with 20 additions and 3 deletions

View File

@ -74,12 +74,25 @@
<number>7</number>
</property>
<property name="text">
<string>Search for files&lt;br&gt;having all of:</string>
<string>Search for &lt;br&gt;documents&lt;br&gt;satisfying:</string>
</property>
<property name="toolTip" stdset="0">
<string>All non blank fields will be combined with AND conjunctions. &lt;br&gt;All fields except "exact phrase" can accept a mix of simple words, and phrases enclosed in double quotes.&lt;br&gt;There are two &lt;em&gt;Any of these&lt;/em&gt; fields so you can search for things like: &lt;br&gt;&lt;em&gt;(apple OR pear) AND (green OR sour)&lt;/em&gt;</string>
</property>
</widget>
<widget class="QComboBox">
<property name="name">
<cstring>conjunctCMB</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>8</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer2</cstring>

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.8 2006-11-14 17:41:12 dockes Exp $ (C) 2005 J.F.Dockes";
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.9 2006-11-14 17:56:40 dockes Exp $ (C) 2005 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@ -70,6 +70,9 @@ void AdvSearch::init()
this, SLOT(saveFileTypes()));
connect(addClausePB, SIGNAL(clicked()), this, SLOT(addClause()));
conjunctCMB->insertItem(tr("All clauses"));
conjunctCMB->insertItem(tr("Any clause"));
// Create preconfigured clauses
andWords = new SearchClauseW(this);
andWords->tpChange(1);
@ -214,7 +217,8 @@ void AdvSearch::restrictFtCB_toggled(bool on)
using namespace Rcl;
void AdvSearch::searchPB_clicked()
{
RefCntr<SearchData> sdata(new SearchData(SCLT_AND));
RefCntr<SearchData> sdata(new SearchData(conjunctCMB->currentItem() == 0 ?
SCLT_AND : SCLT_OR));
bool hasnotnot = false;
bool hasnot = false;
SearchDataClause *cl;