got rid of the static clause names
This commit is contained in:
parent
39679977db
commit
77bd215632
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.9 2006-11-14 17:56:40 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.10 2006-11-14 18:29:09 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -49,6 +49,8 @@ using std::string;
|
|||||||
|
|
||||||
extern RclConfig *rclconfig;
|
extern RclConfig *rclconfig;
|
||||||
|
|
||||||
|
static const int initclausetypes[] = {1, 3, 0, 0, 2, 5};
|
||||||
|
|
||||||
void AdvSearch::init()
|
void AdvSearch::init()
|
||||||
{
|
{
|
||||||
// signals and slots connections
|
// signals and slots connections
|
||||||
@ -74,29 +76,9 @@ void AdvSearch::init()
|
|||||||
conjunctCMB->insertItem(tr("Any clause"));
|
conjunctCMB->insertItem(tr("Any clause"));
|
||||||
|
|
||||||
// Create preconfigured clauses
|
// Create preconfigured clauses
|
||||||
andWords = new SearchClauseW(this);
|
for (unsigned int i = 0; i < sizeof(initclausetypes) / sizeof(int); i++) {
|
||||||
andWords->tpChange(1);
|
addClause(initclausetypes[i]);
|
||||||
clauseVBox->addWidget(andWords);
|
}
|
||||||
|
|
||||||
phrase = new SearchClauseW(this);
|
|
||||||
phrase->tpChange(3);
|
|
||||||
clauseVBox->addWidget(phrase);
|
|
||||||
|
|
||||||
orWords = new SearchClauseW(this);
|
|
||||||
orWords->tpChange(0);
|
|
||||||
clauseVBox->addWidget(orWords);
|
|
||||||
|
|
||||||
orWords1 = new SearchClauseW(this);
|
|
||||||
orWords1->tpChange(0);
|
|
||||||
clauseVBox->addWidget(orWords1);
|
|
||||||
|
|
||||||
noWords = new SearchClauseW(this);
|
|
||||||
noWords->tpChange(2);
|
|
||||||
clauseVBox->addWidget(noWords);
|
|
||||||
|
|
||||||
fileName = new SearchClauseW(this);
|
|
||||||
fileName->tpChange(5);
|
|
||||||
clauseVBox->addWidget(fileName);
|
|
||||||
|
|
||||||
// Initialize lists of accepted and ignored mime types from config
|
// Initialize lists of accepted and ignored mime types from config
|
||||||
// and settings
|
// and settings
|
||||||
@ -160,8 +142,11 @@ void AdvSearch::saveFileTypes()
|
|||||||
}
|
}
|
||||||
rwSettings(true);
|
rwSettings(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdvSearch::addClause()
|
void AdvSearch::addClause()
|
||||||
|
{
|
||||||
|
addClause(0);
|
||||||
|
}
|
||||||
|
void AdvSearch::addClause(int tp)
|
||||||
{
|
{
|
||||||
SearchClauseW *w = new SearchClauseW(this);
|
SearchClauseW *w = new SearchClauseW(this);
|
||||||
m_clauseWins.push_back(w);
|
m_clauseWins.push_back(w);
|
||||||
@ -169,9 +154,10 @@ void AdvSearch::addClause()
|
|||||||
this, SLOT(searchPB_clicked()));
|
this, SLOT(searchPB_clicked()));
|
||||||
clauseVBox->addWidget(w);
|
clauseVBox->addWidget(w);
|
||||||
w->show();
|
w->show();
|
||||||
|
w->tpChange(tp);
|
||||||
// Have to adjust the size else we lose the bottom buttons! Why?
|
// Have to adjust the size else we lose the bottom buttons! Why?
|
||||||
QSize sz = AdvSearchBaseLayout->sizeHint();
|
QSize sz = AdvSearchBaseLayout->sizeHint();
|
||||||
resize(QSize(sz.width()+20, sz.height()+40));
|
resize(QSize(sz.width()+40, sz.height()+80));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move selected file types from the ignored to the searched box
|
// Move selected file types from the ignored to the searched box
|
||||||
@ -221,52 +207,10 @@ void AdvSearch::searchPB_clicked()
|
|||||||
SCLT_AND : SCLT_OR));
|
SCLT_AND : SCLT_OR));
|
||||||
bool hasnotnot = false;
|
bool hasnotnot = false;
|
||||||
bool hasnot = false;
|
bool hasnot = false;
|
||||||
SearchDataClause *cl;
|
|
||||||
|
|
||||||
if ((cl = andWords->getClause())) {
|
|
||||||
switch (cl->m_tp) {
|
|
||||||
case SCLT_EXCL: hasnot = true; break;
|
|
||||||
default: hasnotnot = true; break;
|
|
||||||
}
|
|
||||||
sdata->addClause(cl);
|
|
||||||
}
|
|
||||||
if ((cl = phrase->getClause())) {
|
|
||||||
switch (cl->m_tp) {
|
|
||||||
case SCLT_EXCL: hasnot = true; break;
|
|
||||||
default: hasnotnot = true; break;
|
|
||||||
}
|
|
||||||
sdata->addClause(cl);
|
|
||||||
}
|
|
||||||
if ((cl = orWords->getClause())) {
|
|
||||||
switch (cl->m_tp) {
|
|
||||||
case SCLT_EXCL: hasnot = true; break;
|
|
||||||
default: hasnotnot = true; break;
|
|
||||||
}
|
|
||||||
sdata->addClause(cl);
|
|
||||||
}
|
|
||||||
if ((cl = orWords1->getClause())) {
|
|
||||||
switch (cl->m_tp) {
|
|
||||||
case SCLT_EXCL: hasnot = true; break;
|
|
||||||
default: hasnotnot = true; break;
|
|
||||||
}
|
|
||||||
sdata->addClause(cl);
|
|
||||||
}
|
|
||||||
if ((cl = noWords->getClause())) {
|
|
||||||
switch (cl->m_tp) {
|
|
||||||
case SCLT_EXCL: hasnot = true; break;
|
|
||||||
default: hasnotnot = true; break;
|
|
||||||
}
|
|
||||||
sdata->addClause(cl);
|
|
||||||
}
|
|
||||||
if ((cl = fileName->getClause())) {
|
|
||||||
switch (cl->m_tp) {
|
|
||||||
case SCLT_EXCL: hasnot = true; break;
|
|
||||||
default: hasnotnot = true; break;
|
|
||||||
}
|
|
||||||
sdata->addClause(cl);
|
|
||||||
}
|
|
||||||
for (list<SearchClauseW*>::iterator it = m_clauseWins.begin();
|
for (list<SearchClauseW*>::iterator it = m_clauseWins.begin();
|
||||||
it != m_clauseWins.end(); it++) {
|
it != m_clauseWins.end(); it++) {
|
||||||
|
SearchDataClause *cl;
|
||||||
if ((cl = (*it)->getClause())) {
|
if ((cl = (*it)->getClause())) {
|
||||||
switch (cl->m_tp) {
|
switch (cl->m_tp) {
|
||||||
case SCLT_EXCL: hasnot = true; break;
|
case SCLT_EXCL: hasnot = true; break;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#ifndef _ADVSEARCH_W_H_INCLUDED_
|
#ifndef _ADVSEARCH_W_H_INCLUDED_
|
||||||
#define _ADVSEARCH_W_H_INCLUDED_
|
#define _ADVSEARCH_W_H_INCLUDED_
|
||||||
/* @(#$Id: advsearch_w.h,v 1.5 2006-11-14 17:41:12 dockes Exp $ (C) 2005 J.F.Dockes */
|
/* @(#$Id: advsearch_w.h,v 1.6 2006-11-14 18:29:09 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -36,12 +36,6 @@ public:
|
|||||||
: AdvSearchBase(parent,name,modal,fl)
|
: AdvSearchBase(parent,name,modal,fl)
|
||||||
{init();}
|
{init();}
|
||||||
~AdvSearch(){}
|
~AdvSearch(){}
|
||||||
SearchClauseW* andWords;
|
|
||||||
SearchClauseW* phrase;
|
|
||||||
SearchClauseW* orWords;
|
|
||||||
SearchClauseW* orWords1;
|
|
||||||
SearchClauseW* noWords;
|
|
||||||
SearchClauseW* fileName;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void delFiltypPB_clicked();
|
virtual void delFiltypPB_clicked();
|
||||||
@ -53,6 +47,7 @@ public slots:
|
|||||||
virtual void browsePB_clicked();
|
virtual void browsePB_clicked();
|
||||||
virtual void saveFileTypes();
|
virtual void saveFileTypes();
|
||||||
virtual void addClause();
|
virtual void addClause();
|
||||||
|
virtual void addClause(int);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void startSearch(RefCntr<Rcl::SearchData>);
|
void startSearch(RefCntr<Rcl::SearchData>);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user