GUI: Fix broken test which would prevent opening a viewer when %F was used (e.g. for a chm file)

This commit is contained in:
Jean-Francois Dockes 2018-01-05 16:33:55 +01:00
parent 718019ba88
commit 453a3bb5c6

View File

@ -264,15 +264,16 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
// URL (http or https). Trying to guess based on %u or %f is
// doomed because we pass %u to xdg-open.
bool wantsfile = false;
if (cmd.find("%f") != string::npos || urlisfileurl(doc.url) ||
doc.mimetype.compare("text/html")) {
bool wantsparentfile = cmd.find("%F") != string::npos;
if (!wantsparentfile &&
(cmd.find("%f") != string::npos || urlisfileurl(doc.url) ||
doc.mimetype.compare("text/html"))) {
wantsfile = true;
}
bool wantsparentfile = cmd.find("%F") != string::npos;
if (wantsparentfile && !urlisfileurl(doc.url)) {
QMessageBox::warning(0, "Recoll",
tr("Viewer command line for %1 specifies both "
tr("Viewer command line for %1 specifies "
"parent file but URL is http[s]: unsupported")
.arg(QString::fromUtf8(doc.mimetype.c_str())));
return;