From 453a3bb5c664d1bf3e5984ba0f9b209cf4e8131b Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 5 Jan 2018 16:33:55 +0100 Subject: [PATCH] GUI: Fix broken test which would prevent opening a viewer when %F was used (e.g. for a chm file) --- src/qtgui/rclm_view.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qtgui/rclm_view.cpp b/src/qtgui/rclm_view.cpp index 0469905f..14cadcdc 100644 --- a/src/qtgui/rclm_view.cpp +++ b/src/qtgui/rclm_view.cpp @@ -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;