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:
parent
718019ba88
commit
453a3bb5c6
@ -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
|
// URL (http or https). Trying to guess based on %u or %f is
|
||||||
// doomed because we pass %u to xdg-open.
|
// doomed because we pass %u to xdg-open.
|
||||||
bool wantsfile = false;
|
bool wantsfile = false;
|
||||||
if (cmd.find("%f") != string::npos || urlisfileurl(doc.url) ||
|
bool wantsparentfile = cmd.find("%F") != string::npos;
|
||||||
doc.mimetype.compare("text/html")) {
|
if (!wantsparentfile &&
|
||||||
|
(cmd.find("%f") != string::npos || urlisfileurl(doc.url) ||
|
||||||
|
doc.mimetype.compare("text/html"))) {
|
||||||
wantsfile = true;
|
wantsfile = true;
|
||||||
}
|
}
|
||||||
bool wantsparentfile = cmd.find("%F") != string::npos;
|
|
||||||
|
|
||||||
if (wantsparentfile && !urlisfileurl(doc.url)) {
|
if (wantsparentfile && !urlisfileurl(doc.url)) {
|
||||||
QMessageBox::warning(0, "Recoll",
|
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")
|
"parent file but URL is http[s]: unsupported")
|
||||||
.arg(QString::fromUtf8(doc.mimetype.c_str())));
|
.arg(QString::fromUtf8(doc.mimetype.c_str())));
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user