handle removed docs in history
This commit is contained in:
parent
45af3d3651
commit
0e3e91853d
@ -486,9 +486,9 @@ void RecollMain::showResultPage()
|
|||||||
doc.erase();
|
doc.erase();
|
||||||
|
|
||||||
if (!docsource->getDoc(reslist_winfirst + i, doc, &percent, &sh)) {
|
if (!docsource->getDoc(reslist_winfirst + i, doc, &percent, &sh)) {
|
||||||
if (i == 0)
|
// This may very well happen for history if the doc has
|
||||||
reslist_winfirst = -1;
|
// been removed since. So don't treat it as fatal.
|
||||||
break;
|
doc.abstract = string(tr("Unavailable document").utf8());
|
||||||
}
|
}
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
// Display header
|
// Display header
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.51 2006-01-11 15:08:21 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: rcldb.cpp,v 1.52 2006-01-12 09:13:55 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -1211,9 +1211,9 @@ bool Rcl::Db::getDoc(const string &fn, const string &ipath, Doc &doc)
|
|||||||
const char *ermsg = "";
|
const char *ermsg = "";
|
||||||
try {
|
try {
|
||||||
if (!ndb->db.term_exists(pathterm)) {
|
if (!ndb->db.term_exists(pathterm)) {
|
||||||
LOGDEB(("Db::getDoc: path inexistant: [%s] len %d\n",
|
char len[20];
|
||||||
pathterm.c_str(), pathterm.length()));
|
sprintf(len, "%d", pathterm.length());
|
||||||
return false;
|
throw string("path inexistant: [") + pathterm +"] length " + len;
|
||||||
}
|
}
|
||||||
for (Xapian::PostingIterator docid =
|
for (Xapian::PostingIterator docid =
|
||||||
ndb->db.postlist_begin(pathterm);
|
ndb->db.postlist_begin(pathterm);
|
||||||
@ -1235,6 +1235,10 @@ bool Rcl::Db::getDoc(const string &fn, const string &ipath, Doc &doc)
|
|||||||
}
|
}
|
||||||
if (*ermsg) {
|
if (*ermsg) {
|
||||||
LOGERR(("Rcl::Db::getDoc: %s\n", ermsg));
|
LOGERR(("Rcl::Db::getDoc: %s\n", ermsg));
|
||||||
|
// Initialize what we can anyway. If this is history, caller
|
||||||
|
// will make partial display
|
||||||
|
doc.ipath = ipath;
|
||||||
|
doc.url = string("file://") + fn;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user