adjust message about re-indexing out of date doc for the case where the real-time indexer is running
This commit is contained in:
parent
53db4958b7
commit
8af1b7728f
@ -1207,10 +1207,11 @@ void RclMain::startPreview(int docnum, Rcl::Doc doc, int mod)
|
|||||||
// a partial index pass does no purge, so its ref date will stay
|
// a partial index pass does no purge, so its ref date will stay
|
||||||
// the same and you keep getting the message about the index being
|
// the same and you keep getting the message about the index being
|
||||||
// out of date. The only way to fix this is to run a normal
|
// out of date. The only way to fix this is to run a normal
|
||||||
// indexing pass.
|
// indexing pass (common case: the mbox was shortened and the
|
||||||
|
// result msgnum is beyond the new end)
|
||||||
// Also we should re-run the query after updating the index
|
// Also we should re-run the query after updating the index
|
||||||
// because the ipaths may be wrong in the current result list
|
// because the ipaths may be wrong in the current result list We
|
||||||
// We only do this for the main index, else jump and prey (cant
|
// only do this for the main index, else jump and prey (cant
|
||||||
// update anyway, even the makesig() call might not make sense for
|
// update anyway, even the makesig() call might not make sense for
|
||||||
// our base config)
|
// our base config)
|
||||||
if (!doc.ipath.empty() && rcldb && rcldb->whatDbIdx(doc) == 0) {
|
if (!doc.ipath.empty() && rcldb && rcldb->whatDbIdx(doc) == 0) {
|
||||||
@ -1220,18 +1221,28 @@ void RclMain::startPreview(int docnum, Rcl::Doc doc, int mod)
|
|||||||
string sig;
|
string sig;
|
||||||
FileInterner::makesig(theconfig, doc, sig);
|
FileInterner::makesig(theconfig, doc, sig);
|
||||||
if (rcldb->needUpdate(udi, sig)) {
|
if (rcldb->needUpdate(udi, sig)) {
|
||||||
|
QString msg =
|
||||||
|
tr("Index not up to date for this file. "
|
||||||
|
"Refusing to risk showing the wrong entry.");
|
||||||
|
if (m_indexerState == IXST_NOTRUNNING) {
|
||||||
|
msg += tr("Click Ok to update the "
|
||||||
|
"index for this file, then re-run the "
|
||||||
|
"query when indexing is done. "
|
||||||
|
"Else, Cancel.");
|
||||||
|
} else {
|
||||||
|
msg += tr("Indexer running so things should improve when "
|
||||||
|
"it's done");
|
||||||
|
}
|
||||||
int rep =
|
int rep =
|
||||||
QMessageBox::warning(0, tr("Warning"),
|
QMessageBox::warning(0, tr("Warning"),
|
||||||
tr("Index not up to date for this file. "
|
msg,
|
||||||
"Refusing to risk showing the wrong "
|
|
||||||
"entry. Click Ok to update the "
|
|
||||||
"index for this file, then re-run the "
|
|
||||||
"query when indexing is done. "
|
|
||||||
"Else, Cancel."),
|
|
||||||
QMessageBox::Ok,
|
QMessageBox::Ok,
|
||||||
QMessageBox::Cancel,
|
(m_indexerState == IXST_NOTRUNNING) ?
|
||||||
|
QMessageBox::Cancel :
|
||||||
|
QMessageBox::NoButton,
|
||||||
QMessageBox::NoButton);
|
QMessageBox::NoButton);
|
||||||
if (rep == QMessageBox::Ok) {
|
if (m_indexerState == IXST_NOTRUNNING &&
|
||||||
|
rep == QMessageBox::Ok) {
|
||||||
LOGDEB(("Requesting index update for %s\n",
|
LOGDEB(("Requesting index update for %s\n",
|
||||||
doc.url.c_str()));
|
doc.url.c_str()));
|
||||||
vector<Rcl::Doc> docs(1, doc);
|
vector<Rcl::Doc> docs(1, doc);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user