allow opening parent/enclosing doc with native editor in reslist
This commit is contained in:
@@ -104,6 +104,8 @@ class DocSequence {
|
||||
return doc.meta[Rcl::Doc::keyabs];
|
||||
}
|
||||
|
||||
virtual bool getEnclosing(Rcl::Doc&, Rcl::Doc&) {return false;}
|
||||
|
||||
/** Get estimated total count in results */
|
||||
virtual int getResCnt() = 0;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ static char rcsid[] = "@(#$Id: docseqdb.cpp,v 1.9 2008-11-13 10:57:46 dockes Exp
|
||||
#include "docseqdb.h"
|
||||
#include "rcldb.h"
|
||||
#include "debuglog.h"
|
||||
#include "internfile.h"
|
||||
|
||||
DocSequenceDb::DocSequenceDb(RefCntr<Rcl::Query> q, const string &t,
|
||||
RefCntr<Rcl::SearchData> sdata)
|
||||
@@ -78,6 +79,15 @@ string DocSequenceDb::getAbstract(Rcl::Doc &doc)
|
||||
return abstract.empty() ? doc.meta[Rcl::Doc::keyabs] : abstract;
|
||||
}
|
||||
|
||||
bool DocSequenceDb::getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc)
|
||||
{
|
||||
string udi;
|
||||
if (!FileInterner::getEnclosing(doc.url, doc.ipath, pdoc.url, pdoc.ipath,
|
||||
udi))
|
||||
return false;
|
||||
return m_q->whatDb()->getDoc(udi, pdoc);
|
||||
}
|
||||
|
||||
list<string> DocSequenceDb::expand(Rcl::Doc &doc)
|
||||
{
|
||||
return m_q->expand(doc);
|
||||
|
||||
@@ -36,6 +36,7 @@ class DocSequenceDb : public DocSequence {
|
||||
vector<vector<string> >& groups,
|
||||
vector<int>& gslks);
|
||||
virtual string getAbstract(Rcl::Doc &doc);
|
||||
virtual bool getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc);
|
||||
virtual string getDescription();
|
||||
virtual list<string> expand(Rcl::Doc &doc);
|
||||
virtual bool canFilter() {return true;}
|
||||
|
||||
@@ -24,6 +24,7 @@ static char rcsid[] = "@(#$Id: docseqhist.cpp,v 1.4 2008-09-29 08:59:20 dockes E
|
||||
#include "docseqhist.h"
|
||||
#include "rcldb.h"
|
||||
#include "fileudi.h"
|
||||
#include "internfile.h"
|
||||
|
||||
bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, string *sh)
|
||||
{
|
||||
@@ -66,6 +67,15 @@ bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, string *sh)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool DocSequenceHistory::getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc)
|
||||
{
|
||||
string udi;
|
||||
if (!FileInterner::getEnclosing(doc.url, doc.ipath, pdoc.url, pdoc.ipath,
|
||||
udi))
|
||||
return false;
|
||||
return m_db->getDoc(udi, pdoc);
|
||||
}
|
||||
|
||||
int DocSequenceHistory::getResCnt()
|
||||
{
|
||||
if (m_hlist.empty())
|
||||
|
||||
@@ -35,6 +35,7 @@ class DocSequenceHistory : public DocSequence {
|
||||
virtual ~DocSequenceHistory() {}
|
||||
|
||||
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
|
||||
virtual bool getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc);
|
||||
virtual int getResCnt();
|
||||
virtual string getDescription() {return m_description;}
|
||||
void setDescription(const string& desc) {m_description = desc;}
|
||||
|
||||
Reference in New Issue
Block a user