translation of result list title. Show query details when clicking on header
This commit is contained in:
+10
-7
@@ -1,6 +1,6 @@
|
||||
#ifndef _DOCSEQ_H_INCLUDED_
|
||||
#define _DOCSEQ_H_INCLUDED_
|
||||
/* @(#$Id: docseq.h,v 1.3 2005-12-05 16:13:12 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: docseq.h,v 1.4 2006-01-11 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include "rcldb.h"
|
||||
#include "history.h"
|
||||
@@ -11,11 +11,14 @@
|
||||
history or Db query). We have an interface to make things cleaner.
|
||||
*/
|
||||
class DocSequence {
|
||||
std::string m_title;
|
||||
public:
|
||||
DocSequence(const std::string &t) : m_title(t) {}
|
||||
virtual ~DocSequence() {}
|
||||
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0)
|
||||
= 0;
|
||||
virtual int getResCnt() = 0;
|
||||
virtual std::string title() = 0;
|
||||
virtual std::string title() {return m_title;}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,11 +26,12 @@ class DocSequence {
|
||||
to make sense */
|
||||
class DocSequenceDb : public DocSequence {
|
||||
public:
|
||||
DocSequenceDb(Rcl::Db *d) : m_db(d), m_rescnt(-1) {}
|
||||
DocSequenceDb(Rcl::Db *d, const std::string &t) :
|
||||
DocSequence(t), m_db(d), m_rescnt(-1)
|
||||
{}
|
||||
virtual ~DocSequenceDb() {}
|
||||
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string * = 0);
|
||||
virtual int getResCnt();
|
||||
virtual std::string title() {return string("Query results");}
|
||||
private:
|
||||
Rcl::Db *m_db;
|
||||
int m_rescnt;
|
||||
@@ -36,13 +40,12 @@ class DocSequenceDb : public DocSequence {
|
||||
/** A DocSequence coming from the history file */
|
||||
class DocSequenceHistory : public DocSequence {
|
||||
public:
|
||||
DocSequenceHistory(Rcl::Db *d, RclDHistory *h)
|
||||
: m_db(d), m_hist(h), m_prevnum(-1), m_prevtime(-1) {}
|
||||
DocSequenceHistory(Rcl::Db *d, RclDHistory *h, const std::string &t)
|
||||
: DocSequence(t), m_db(d), m_hist(h), m_prevnum(-1), m_prevtime(-1) {}
|
||||
virtual ~DocSequenceHistory() {}
|
||||
|
||||
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0);
|
||||
virtual int getResCnt();
|
||||
virtual std::string title() {return string("Document history");}
|
||||
private:
|
||||
Rcl::Db *m_db;
|
||||
RclDHistory *m_hist;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: sortseq.cpp,v 1.4 2005-12-05 12:02:01 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: sortseq.cpp,v 1.5 2006-01-11 15:08:22 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
#include <algorithm>
|
||||
|
||||
@@ -66,7 +66,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
DocSeqSorted::DocSeqSorted(DocSequence &iseq, int cnt, RclSortSpec &sortspec)
|
||||
DocSeqSorted::DocSeqSorted(DocSequence &iseq, int cnt, RclSortSpec &sortspec,
|
||||
const std::string &t)
|
||||
: DocSequence(t)
|
||||
{
|
||||
LOGDEB(("DocSeqSorted:: count %d\n", cnt));
|
||||
|
||||
@@ -87,7 +89,6 @@ DocSeqSorted::DocSeqSorted(DocSequence &iseq, int cnt, RclSortSpec &sortspec)
|
||||
for (i = 0; i < m_count; i++)
|
||||
m_docsp[i] = &m_docs[i];
|
||||
|
||||
m_title = iseq.title() + " (sorted)";
|
||||
CompareDocs cmp(sortspec);
|
||||
sort(m_docsp.begin(), m_docsp.end(), cmp);
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
#ifndef _SORTSEQ_H_INCLUDED_
|
||||
#define _SORTSEQ_H_INCLUDED_
|
||||
/* @(#$Id: sortseq.h,v 1.2 2005-12-02 16:18:20 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: sortseq.h,v 1.3 2006-01-11 15:08:22 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -24,7 +24,8 @@ class RclSortSpec {
|
||||
*/
|
||||
class DocSeqSorted : public DocSequence {
|
||||
public:
|
||||
DocSeqSorted(DocSequence &iseq, int cnt, RclSortSpec &sortspec);
|
||||
DocSeqSorted(DocSequence &iseq, int cnt, RclSortSpec &sortspec,
|
||||
const std::string &t);
|
||||
virtual ~DocSeqSorted() {}
|
||||
virtual bool getDoc(int num, Rcl::Doc &doc, int *percent, string *sh = 0);
|
||||
virtual int getResCnt() {return m_count;}
|
||||
|
||||
Reference in New Issue
Block a user