query: extract the collapse count from xapian + small cleanups

This commit is contained in:
Jean-Francois Dockes
2011-01-17 11:25:05 +01:00
parent 9b738ebb61
commit 34511918d9
7 changed files with 27 additions and 31 deletions
+7 -3
View File
@@ -754,7 +754,7 @@ void RclMain::startPreview(int docnum, Rcl::Doc doc, int mod)
}
if (curPreview == 0) {
HiliteData hdata;
reslist->getTerms(hdata.terms, hdata.groups, hdata.gslks);
m_source->getTerms(hdata.terms, hdata.groups, hdata.gslks);
curPreview = new Preview(reslist->listId(), hdata);
if (curPreview == 0) {
@@ -1217,12 +1217,16 @@ void RclMain::startManual(const string& index)
// significant terms, and add them to the simple search entry.
void RclMain::docExpand(Rcl::Doc doc)
{
LOGDEB(("RclMain::docExpand()\n"));
if (!rcldb)
return;
list<string> terms;
terms = reslist->expand(doc);
if (terms.empty())
terms = m_source->expand(doc);
if (terms.empty()) {
LOGDEB(("RclMain::docExpand: no terms\n"));
return;
}
// Do we keep the original query. I think we'd better not.
// rcldb->expand is set to keep the original query terms instead.
QString text;// = sSearch->queryText->currentText();
-13
View File
@@ -336,19 +336,6 @@ void ResList::languageChange()
setWindowTitle(tr("Result list"));
}
bool ResList::getTerms(vector<string>& terms,
vector<vector<string> >& groups, vector<int>& gslks)
{
return m_source->getTerms(terms, groups, gslks);
}
list<string> ResList::expand(Rcl::Doc& doc)
{
if (m_source.isNull())
return list<string>();
return m_source->expand(doc);
}
// Get document number from paragraph number
int ResList::docnumfromparnum(int par)
{
+5 -7
View File
@@ -42,15 +42,13 @@ class ResList : public QTextBrowser
ResList(QWidget* parent = 0, const char* name = 0);
virtual ~ResList();
// Return document for given docnum. We act as an intermediary to
// the docseq here. This has also the side-effect of making the
// entry current (visible and highlighted), and only works if the
// num is inside the current page or its immediate neighbours.
// Return document for given docnum. We mostly act as an
// intermediary to the docseq here, but this has also the
// side-effect of making the entry current (visible and
// highlighted), and only works if the num is inside the current
// page or its immediate neighbours.
bool getDoc(int docnum, Rcl::Doc &);
bool displayingHistory();
bool getTerms(vector<string>& terms,
vector<vector<string> >& groups, vector<int>& gslks);
list<string> expand(Rcl::Doc& doc);
int listId() const {return m_listId;}
public slots: