use path_pathtofileurl

This commit is contained in:
Jean-Francois Dockes 2015-09-02 09:13:07 +02:00
parent 5f9b0110de
commit 16cc149e40

View file

@ -310,7 +310,7 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
istempfile = true; istempfile = true;
rememberTempFile(temp); rememberTempFile(temp);
fn = temp->filename(); fn = temp->filename();
url = string("file://") + fn; url = path_pathtofileurl(fn);
} }
// If using an actual file, check that it exists, and if it is // 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) { if (temp) {
rememberTempFile(temp); rememberTempFile(temp);
fn = temp->filename(); fn = temp->filename();
url = string("file://") + fn; url = path_pathtofileurl(fn);
} }
} }
@ -430,16 +430,16 @@ void RclMain::startManual()
void RclMain::startManual(const string& index) void RclMain::startManual(const string& index)
{ {
Rcl::Doc doc; Rcl::Doc doc;
doc.url = "file://"; string path = theconfig->getDatadir();
doc.url = path_cat(doc.url, theconfig->getDatadir()); path = path_cat(path, "doc");
doc.url = path_cat(doc.url, "doc"); path = path_cat(path, "usermanual.html");
doc.url = path_cat(doc.url, "usermanual.html");
LOGDEB(("RclMain::startManual: help index is %s\n", LOGDEB(("RclMain::startManual: help index is %s\n",
index.empty()?"(null)":index.c_str())); index.empty()?"(null)":index.c_str()));
if (!index.empty()) { if (!index.empty()) {
doc.url += "#"; path += "#";
doc.url += index; path += index;
} }
doc.url = path_pathtofileurl(path);
doc.mimetype = "text/html"; doc.mimetype = "text/html";
startNativeViewer(doc); startNativeViewer(doc);
} }