Preview and Open for web cache: setKeyDir(getfather("")) resulted in ./ and getConfParam() failures

This commit is contained in:
Jean-Francois Dockes 2016-04-12 18:13:10 +02:00
parent 9db024791f
commit 5d6b1ea2a1
2 changed files with 4 additions and 4 deletions

View File

@ -832,7 +832,7 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum)
// If the command wants a file but this is not a file url, or
// there is an ipath that it won't understand, we need a temp file:
theconfig->setKeyDir(path_getfather(fn));
theconfig->setKeyDir(fn.empty() ? "" : path_getfather(fn));
if (fn.empty() || !idoc.ipath.empty()) {
TempFile temp = lthr.tmpimg;
if (temp) {

View File

@ -293,12 +293,12 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
bool enterHistory = false;
bool istempfile = false;
LOGDEB(("RclMain::startNV: groksipath %d wantsf %d wantsparentf %d\n",
groksipath, wantsfile, wantsparentfile));
LOGDEB(("RclMain::startNV: groksipath %d wantsf %d wantsparentf %d\n",
groksipath, wantsfile, wantsparentfile));
// If the command wants a file but this is not a file url, or
// there is an ipath that it won't understand, we need a temp file:
theconfig->setKeyDir(path_getfather(fn));
theconfig->setKeyDir(fn.empty() ? "" : path_getfather(fn));
if (!doc.isFsFile() ||
((wantsfile || wantsparentfile) && fn.empty()) ||
(!groksipath && !doc.ipath.empty()) ) {