From 16cc149e40a0d38c85d3d1c34b94b3912c2bd30a Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Wed, 2 Sep 2015 09:13:07 +0200 Subject: [PATCH] use path_pathtofileurl --- src/qtgui/rclm_view.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qtgui/rclm_view.cpp b/src/qtgui/rclm_view.cpp index 97ed2ed5..b34696b6 100644 --- a/src/qtgui/rclm_view.cpp +++ b/src/qtgui/rclm_view.cpp @@ -310,7 +310,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term) istempfile = true; rememberTempFile(temp); fn = temp->filename(); - url = string("file://") + fn; + url = path_pathtofileurl(fn); } // If using an actual file, check that it exists, and if it is @@ -335,7 +335,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term) if (temp) { rememberTempFile(temp); fn = temp->filename(); - url = string("file://") + fn; + url = path_pathtofileurl(fn); } } @@ -430,16 +430,16 @@ void RclMain::startManual() void RclMain::startManual(const string& index) { Rcl::Doc doc; - doc.url = "file://"; - doc.url = path_cat(doc.url, theconfig->getDatadir()); - doc.url = path_cat(doc.url, "doc"); - doc.url = path_cat(doc.url, "usermanual.html"); + string path = theconfig->getDatadir(); + path = path_cat(path, "doc"); + path = path_cat(path, "usermanual.html"); LOGDEB(("RclMain::startManual: help index is %s\n", index.empty()?"(null)":index.c_str())); if (!index.empty()) { - doc.url += "#"; - doc.url += index; + path += "#"; + path += index; } + doc.url = path_pathtofileurl(path); doc.mimetype = "text/html"; startNativeViewer(doc); }