GUI: only do the result up to date check before preview for the main index (we cant update the others anyway)
This commit is contained in:
@@ -841,6 +841,16 @@ bool Db::rmQueryDb(const string &dir)
|
||||
return adjustdbs();
|
||||
}
|
||||
|
||||
// Determining what index a doc result comes from is based on the
|
||||
// modulo of the docid against the db count. Ref:
|
||||
// http://trac.xapian.org/wiki/FAQ/MultiDatabaseDocumentID
|
||||
size_t Db::whatDbIdx(const Doc& doc)
|
||||
{
|
||||
if (doc.xdocid == 0)
|
||||
return (size_t)-1;
|
||||
return doc.xdocid % m_extraDbs.size();
|
||||
}
|
||||
|
||||
bool Db::testDbDir(const string &dir)
|
||||
{
|
||||
string aerr;
|
||||
|
||||
@@ -197,6 +197,11 @@ class Db {
|
||||
bool addQueryDb(const string &dir);
|
||||
/** Remove extra database. if dir == "", remove all. */
|
||||
bool rmQueryDb(const string &dir);
|
||||
/** Look where the doc result comes from.
|
||||
* @return: 0 main index, (size_t)-1 don't know,
|
||||
* other: order of database in add_database() sequence.
|
||||
*/
|
||||
size_t whatDbIdx(const Doc& doc);
|
||||
/** Tell if directory seems to hold xapian db */
|
||||
static bool testDbDir(const string &dir);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user