GUI: add error dialog from spell_w when db cant be opened

This commit is contained in:
Jean-Francois Dockes 2012-05-04 10:56:48 +02:00
parent 73a3106a6d
commit 442385376d
2 changed files with 4 additions and 2 deletions

View File

@ -122,9 +122,10 @@ bool maybeOpenDb(string &reason, bool force, bool *maindberror)
}
Rcl::Db::OpenError error;
if (!rcldb->isopen() && !rcldb->open(Rcl::Db::DbRO, &error)) {
reason = "Could not open database in " +
theconfig->getDbDir() + " wait for indexing to complete?";
reason = "Could not open database";
if (maindberror) {
reason += " in " + theconfig->getDbDir() +
" wait for indexing to complete?";
*maindberror = (error == Rcl::Db::DbOpenMainDb) ? true : false;
}
return false;

View File

@ -115,6 +115,7 @@ void SpellW::doExpand()
string reason;
if (!maybeOpenDb(reason)) {
QMessageBox::critical(0, "Recoll", QString(reason.c_str()));
LOGDEB(("SpellW::doExpand: db error: %s\n", reason.c_str()));
return;
}